Cslib.URM.Regs
abbrevimported Lean
Register contents: maps register indices to natural number contents. Uses the functional representation ℕ → ℕ for efficiency with rewrites, following the advice from the grind tactic documentation.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in abbrev Cslib.URM.Regs
- Defined in
- CSLib, `Cslib.URM.Regs`
- Lean proof
- By Jesse Alama, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2026 Jesse Alama. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.URM.Regs← Cslib.URM.Regs (Cslib/Computability/URM/Defs.lean:103): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Used by 18
- urm_halts_toStandardFormFor any URM program p and input list inputs, p halts on inputs if and only if its standard form p.toStandardForm halts on inputs.
- Cslib.URM.Regs.zeroThe zero registers where all registers contain 0.
- Cslib.URM.Regs.writeWrite value v to register n.
- Cslib.URM.State.extExtensionality for State: two states are equal iff their components are equal.
- Cslib.URM.straightLineFinalRegsThe final registers after running a straight-line program from given starting registers.
- Cslib.URM.straight_line_halts_from_regsStraight-line programs halt from any starting registers, not just State.init. Useful for chaining: after running one program, we can run…
- Cslib.URM.Regs.write_read_selfCslib.URM.Regs.write_read_self
- Cslib.URM.Step.toStandardFormForward step correspondence: if p steps from s to s', then either: (1) p.toStandardForm steps from s to s' (same step), or (2) s' is…
- Cslib.URM.Step.from_toStandardFormReverse step correspondence: if p.toStandardForm steps from s to s', then either: (1) p steps from s to s' (same step), or (2) s' is…
- Cslib.URM.Regs.outputExtract output from register 0.
- Cslib.URM.Regs.write_read_of_neCslib.URM.Regs.write_read_of_ne
- Cslib.URM.Regs.readRead the contents of register n.
- urm_halts_toStandardForm_of_haltsIf a URM program p halts on inputs, then its standard form p.toStandardForm halts on inputs.
- Cslib.URM.straight_line_state_at_pcIn a straight-line program, we can characterize the state at any intermediate pc. This gives us the state after executing instructions…
- Cslib.URM.straightLinefinalState_specSpecification: the state from straightLinefinalState satisfies Steps, isHalted, and has pc = p.length.
- Cslib.URM.Regs.ofInputsInitialize registers with input values in registers 0, 1, ..., k-1. Registers beyond the inputs are initialized to 0.
- Cslib.URM.StateMachine state: program counter (0-indexed) and register contents.
- Cslib.URM.straightLinefinalStateThe halting state for a straight-line program starting from registers r. Wraps Classical.choose to hide it from the API.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in /-- Register contents: maps register indices to natural number contents. Uses the functional representation `ℕ → ℕ` for efficiency with rewrites, following the advice from the `grind` tactic documentation. -/ abbrev Cslib.URM.Regs := ℕ → ℕ