Cslib.URM.State.isHalted
defimported Lean
A state is halted if the program counter is at or beyond the program length.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in @[scoped grind =] def Cslib.URM.State.isHalted (s : State) (p : Program) : Prop
- Defined in
- CSLib, `Cslib.URM.State.isHalted`
- 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.State.isHalted← Cslib.URM.State.isHalted (Cslib/Computability/URM/Defs.lean:175): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 3
- 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.StateMachine state: program counter (0-indexed) and register contents.
- Cslib.URM.ProgramA URM program is a list of instructions.
- Cslib.URM.InstrURM instructions. -
- Used by 18
- Cslib.URM.State.instDecidableIsHaltedCslib.URM.State.instDecidableIsHalted
- 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.State.isHalted_iffCslib.URM.State.isHalted_iff
- Cslib.URM.Step.no_step_of_haltedA halted state has no successor in the step relation.
- Cslib.URM.evalStateEvaluation returning the full halting state.
- Cslib.URM.HaltsWithResult.toHaltsIf a program halts with a result, it halts.
- Cslib.URM.HaltsA program halts on given inputs if execution reaches a halted state. This is equivalent to
(Step p).Normalizable (State.init inputs)—… - 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.HaltsWithResultA program halts on given inputs with a specific result in R[0].
- 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.isHalted_iff_normalA state is halted iff it is normal (has no successor) in the reduction system.
- 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.evalState_specSpecification: the state from evalState satisfies Steps and isHalted.
- urm_halts_toStandardForm_of_haltsIf a URM program p halts on inputs, then its standard form p.toStandardForm halts on inputs.
- Cslib.URM.straightLinefinalState_specSpecification: the state from straightLinefinalState satisfies Steps, isHalted, and has pc = p.length.
- Cslib.URM.Halts.toHaltsWithResultIf a program halts, it halts with the output of the final state.
- 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.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in /-- A state is halted if the program counter is at or beyond the program length. -/ @[scoped grind =] def Cslib.URM.State.isHalted (s : State) (p : Program) : Prop := p.length ≤ s.pc