AFTD Auto-Formalizing Theoretical Domains

Cslib.URM.straight_line_state_at_pc

theoremverifiedformalizationimported Lean

In a straight-line program, we can characterize the state at any intermediate pc. This gives us the state after executing instructions 0..pc-1.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
theorem Cslib.URM.straight_line_state_at_pc {p : Program} (hsl : p.IsStraightLine)
    (r : Regs) (targetPc : ℕ) (htarget : targetPc ≤ p.length) :
    ∃ s, Steps p ⟨0, r⟩ s ∧ s.pc = targetPc
Formalizes
CSLib, `Cslib.URM.straight_line_state_at_pc`
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.
Verified
08 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 18

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true in/-- In a straight-line program, we can characterize the state at any intermediate pc. This gives us the state after executing instructions 0..pc-1. -/theorem Cslib.URM.straight_line_state_at_pc {p : Program} (hsl : p.IsStraightLine)    (r : Regs) (targetPc : ℕ) (htarget : targetPc ≤ p.length) :    ∃ s, Steps p ⟨0, r⟩ s ∧ s.pc = targetPc := by  induction targetPc with  | zero => exact ⟨⟨0, r⟩, Relation.ReflTransGen.refl, rfl⟩  | succ n ih => grind [Step.of_nonJump, Program.IsStraightLine]
See it in the graphDiscuss this resultChallenge it