AFTD Auto-Formalizing Theoretical Domains

Cslib.URM.Program.shiftJumps

defimported Lean

Shift all jump targets in a program by offset. Used when concatenating programs: the second program's jumps must be adjusted by the length of the first program.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
@[scoped grind =]
def Cslib.URM.Program.shiftJumps (p : Program) (offset : ℕ) : Program
Defined in
CSLib, `Cslib.URM.Program.shiftJumps`
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
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.Instr.shiftJumpsShift all jump targets in an instruction by offset. Used when concatenating programs to maintain correct jump destinations.
  • Cslib.URM.ProgramA URM program is a list of instructions.

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
/-- Shift all jump targets in a program by `offset`. Used when concatenating programs: the second program's jumps must be adjusted by the length of the first program. -/
@[scoped grind =]
def Cslib.URM.Program.shiftJumps (p : Program) (offset : ℕ) : Program :=
  p.map (Instr.shiftJumps offset)
See it in the graphDiscuss this resultChallenge it