Universal machine: the clocked (time-bounded) simulate/halt-test loop #
The time-bounded variant of utm_loop_simulates: the 7-tape loop
clockedLoop = loopTM clockedBody clockedTest runs the interpreted machine
for min (halting time, clock budget) steps, where
clockedBody = seqTM (bodyTM.liftTM 1) decFrontierTM— one body pass of the 6-tape UTM (lifted to 7 tapes, the clock tape pinned by the frame ruleliftTM_hoareTime_frame) followed by an O(1) decrement of the frontier-parked unary clock on tape 6 (clkT);clockedTest = seqTM (haltTestTM.liftTM 1) orZeroTM— the lifted halt test writes the halt verdict at output cell 1, andorZeroTMoverwrites it with the combined loop-exit verdict (halted or clock zero).
Frontier representation: clock value v ⟺ tape-6 cells are
regCells v and the head is at max v 1.
Proof structure #
Composition strategy (option (i) of the design space): bodyIteration is
packaged as a ghost-style HoareTime triple at fixed tapes
(clockedBody_hoareTime's inner triple), lifted through
liftTM_hoareTime_frame with the clock tape as the pinned extra, and
composed with decFrontierTM_hoareTime via seqTM_hoareTime; similarly
for the test half with haltTestTM_hoareTime and orZeroTM_hoareTime.
The per-iteration lemma clocked_iteration then mirrors SimLoop's
loop_iteration at the loop level (body/test phase embeddings plus a
local copy of the rewind/check bookkeeping), and two strong inductions on
the remaining fuel (clocked_aux_halt / clocked_aux_timeout) deliver
the two cases of the headline theorem clocked_loop_simulates.
Statement notes (deviations from the naive statement) #
The loop is do-while: even a T = 0 run (initial configuration already
halted) executes one full iteration, which decrements the clock. Hence
case A leaves the clock at V - max T 1 (equal to V - T for T ≥ 1).
Case B requires 1 ≤ V: with a zero budget the do-while loop still
simulates one interpreted step before its first exit test, so "exactly
V simulated steps" would be false for V = 0. In both cases the exit
verdict at output cell 1 is Γ.one; the two exits are distinguished by
the state tape (SimInv at the final interpreted configuration makes a
subsequent halt test conclusive via simInv_verdict).
The clocked loop body: one (lifted) UTM body pass, then one O(1) decrement of the frontier-parked clock on tape 6.
Equations
Instances For
The clocked loop test: the (lifted) halt test writes the halt verdict
at output cell 1; orZeroTM replaces it with the combined loop-exit
verdict (halted or clock zero).
Equations
Instances For
The clocked simulate/halt-test loop.
Equations
Instances For
The clocked UTM loop simulates the interpreted machine for
min (halting time, clock budget) steps. From any tapes realizing
SimInv at the interpreted machine's initial configuration on the six
embedded tapes — with the frontier-parked unary clock at V on tape 6
(clkT) and the output tape ▷-clean and parked at cell 1 — the loop
clockedLoop = loopTM clockedBody clockedTest halts with the exit
verdict Γ.one at output cell 1, and:
- (A: halt within budget) if
(decodeDesc α).toTMhalts onxatmcFinT ≤ Vsteps, the loop exits within(T + 1) * (utmStepTime α + 10)steps withSimInvre-established atmcFand the clock atV - max T 1(i.e.V - TforT ≥ 1; the do-while loop burns one tick even when the machine starts halted); - (B: timeout) if the machine is still running after
V ≥ 1steps (atmcV), the loop exits within(V + 1) * (utmStepTime α + 10)steps withSimInvat theV-step configurationmcVand the clock at0.
In both cases the output tape is parked (▷-clean, head at cell 1).
The two exits are distinguished by the final state tape: SimInv at
the exit configuration makes a subsequent (lifted) halt test
conclusive via simInv_verdict. Note that no-halt-before-V in case
B is automatic: the prefix configurations of the V-step run all
step, and halted configurations cannot step.