Cslib.URM.instDecidableIsStraightLine
instanceimported Lean
Cslib.URM.instDecidableIsStraightLine
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in instance Cslib.URM.instDecidableIsStraightLine (p : Program) : Decidable p.IsStraightLine
- Defined in
- CSLib, `Cslib.URM.instDecidableIsStraightLine`
- 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.instDecidableIsStraightLine← @Cslib/Computability/URM/StraightLine.lean:36 (Cslib/Computability/URM/StraightLine.lean:36): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 9
- Cslib.URM.State.instDecidableIsHaltedCslib.URM.State.instDecidableIsHalted
- Cslib.URM.InstrURM instructions. -
Z n: Set register n to zero -S n: Increment register n by one -T m n: Transfer (copy) the contents of register… - Cslib.URM.State.isHalted_iffCslib.URM.State.isHalted_iff
- Cslib.URM.Instr.IsJumpAn instruction is a jump instruction.
- Cslib.URM.Instr.instDecidableIsJumpCslib.URM.Instr.instDecidableIsJump
- Cslib.URM.instSetoidProgramSetoid instance for programs, enabling the ≈ notation.
- Cslib.URM.Instr.instDecidableJumpsBoundedByCslib.URM.Instr.instDecidableJumpsBoundedBy
- Cslib.URM.Program.IsStraightLineA program is "straight-line" if it contains no jump instructions.
- Cslib.URM.ProgramA URM program is a list of instructions.
- Used by 20
- Cslib.URM.Program.toStandardForm_lengthtoStandardForm preserves program length.
- Cslib.URM.Program.instDecidableIsStandardFormCslib.URM.Program.instDecidableIsStandardForm
- 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.Step.of_nonJumpA non-jumping instruction produces a step that increments PC by 1.
- Cslib.URM.Program.IsStandardFormA program is in standard form if all jump targets are bounded by the program length. Jumps can target any instruction (0..length-1) or the…
- Cslib.URM.Program.IsStraightLine.consCons of non-jumping instruction preserves straight-line.
- 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.Program.IsStraightLine.singletonSingleton non-jumping instruction is straight-line.
- 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.Program.IsStraightLine.appendAppend preserves straight-line property.
- Cslib.URM.Program.toStandardForm_isStandardFormtoStandardForm produces a standard form program.
- Cslib.URM.straight_line_IsStandardFormStraight-line programs are in standard form.
- 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.Program.toStandardFormConvert a program to standard form by capping all jump targets at the program length.
- Cslib.URM.Program.toStandardForm_idempotenttoStandardForm is idempotent: applying it twice equals applying it once.
- Cslib.URM.straightLinefinalState_specSpecification: the state from straightLinefinalState satisfies Steps, isHalted, and has pc = p.length.
- Cslib.URM.straight_line_haltsA straight-line program halts on any input.
- Cslib.URM.straightLinefinalStateThe halting state for a straight-line program starting from registers r. Wraps Classical.choose to hide it from the API.
- Cslib.URM.Program.getElem?_toStandardFormAccessing an instruction in toStandardForm gives the capJump'd instruction.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in instance Cslib.URM.instDecidableIsStraightLine (p : Program) : Decidable p.IsStraightLine := inferInstanceAs (Decidable (∀ i ∈ p, ¬i.IsJump))