The bounded closure loop #
tcCode decides bounded reachability of a target tuple from a source tuple along the edges
computed by compiled body code, in a universe of size n. It keeps the current tuple and a step
counter, tests the current tuple against the target, guesses a successor below n ^ k, decodes its
base-n digits, runs the body, and counts the step; it rejects once the counter reaches the value
M₀ of the step-bound expression. Every branch therefore halts, and the loop certifies exactly
the paths of at most M₀ steps. Closures use M₀ = n ^ k; inductive counting uses smaller
bounds.
Main results #
Cslib.Logic.FO.Ordered.TCModelChecker.loop_sound: every branch rejects or reaches the exit with the target reachable withinM₀steps.Cslib.Logic.FO.Ordered.TCModelChecker.loop_complete: a path of at mostM₀steps gives a branch reaching the exit.
Decoding register r, holding g < n ^ k, into registers d + i writes the tuple
finFunctionFinEquiv.symm g.
The loop invariant at the test label: registers below base and the length are kept, the
current tuple is in registers base + i, and the step counter is t.
- kept : Turing.CounterProgram.Kept B base regs₀ regs
The registers below
baseand the length are kept, and every register is bounded. The loop's registers exist.
The current tuple is in registers
base + i.The step counter is in register
base + 2 * k + 1.
Instances For
The state after decoding a successor: the loop invariant, the decoded tuple in registers
base + k + i.
- kept : Turing.CounterProgram.Kept B base regs₀ regs
The decoded successor is in registers
base + k + i.
Instances For
Initialization: copy the source tuple and reset the step counter.
Soundness of the closure loop: from a state with step counter t ≤ M₀ and current tuple
reachable from s₀ within t steps, every branch either rejects or reaches T with the target
z₀ reachable from s₀ within M₀ steps.
Completeness of the closure loop: from a state with step counter t, a path of m steps
to the target with t + m ≤ M₀ gives a branch reaching T.