One loopTM iteration that continues #
TM.loopTM_iteration_halt traces a single pass through loopTM that ends in the halting
branch. The complementary pass — the one where the test says keep going — had no counterpart,
which left the indexed loop rule TM.loopTM_hoareTime_indexed without a way to discharge its
per-iteration obligation: that obligation asks for a run from the loop's start state back to the
loop's start state, and only the check phase's continue branch produces one.
The pass is body, then test, then the rewind of the output tape, then the check. Everything
outside the two simulations moves each tape by idleDir and writes back what it read, so on
tapes that carry their left marker and are parked past it the whole phase machinery is the
identity — which is what makes an invariant on the work tapes survive into the next iteration.
Main results #
TM.loopTM_check_continue_frame— the continue branch of the check phase leaves every tape identicalTM.loopTM_iteration_continue— a full iteration returning toqstart, tapes and allTM.loopTM_check_halt_frame,TM.loopTM_iteration_halt_frame— the halting pass, likewise reporting the tapes it ends onTM.loopTM_continue_of_hoare,TM.loopTM_halt_of_hoare— both passes packaged as the two obligations ofTM.loopTM_hoareTime_indexed, from a contract for the body and one for the test
The continue branch of the check phase, framed. Everything the branch does is write back
what it read and move by idleDir, so a tape parked past its left marker is untouched.
One full loopTM iteration that continues. The body runs to its halt state, the test
runs to its halt state, the output tape is rewound to cell one, and the verdict cell fails to
hold 1 — so the machine returns to its own start state with the test's tapes intact.
The step count matches TM.loopTM_iteration_halt: the two simulations, the two phase
transitions between them, the rewind of p + 1 steps, and the check.
The halting branch of the check phase, framed. As with the continue branch, the step writes back what it read and idles, so parked tapes are untouched.
One full loopTM iteration that halts, framed. The same pass as
TM.loopTM_iteration_halt, but reporting the input and work tapes of the halted configuration —
which a loop's postcondition generally talks about, and which the unframed version discards.
The side conditions a loop's intermediate and final tape states must meet for the phase machinery to be transparent: every tape carries its left marker nowhere but cell zero, and every head is parked past it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The per-iteration obligation of TM.loopTM_hoareTime_indexed, from two Hoare triples.
Give a contract for the body and one for the test; if the test's postcondition leaves the tapes
parked with a verdict cell that is not 1, the loop returns to its own start state with that
postcondition intact.
The terminating obligation of TM.loopTM_hoareTime_indexed, from two Hoare triples. The
companion of TM.loopTM_continue_of_hoare for the pass whose verdict cell does hold 1.