Running a machine inside the algebra — proof internals #
Everything the completeness direction needs about a run, as opposed to a single
step: a total step function that stands still once the machine has halted, the
standing invariants of a run (the left-end marker where it belongs, every head
inside the encoded window), and the iterated versions of Cobham.stepFn and
Cobham.rewindFn.
Main results #
Complexity.TM.runCfg— the configuration afternsteps, halting-idempotentComplexity.Cobham.iterate_stepFn— the encoded iteration tracks itComplexity.Cobham.iterate_rewindFn— the rewind iteration drives the head to cell0
A total run #
The standing invariants of a run #
One step preserves the left-end marker's position on every tape.
Every tape of a run keeps its left-end marker.
The rewind iteration #
Reading the output off the rewound tape #
With the head at cell 0 the tape's right half-block is the whole window, in
order and two bits per cell. The first bit of each cell says whether it holds
data — symCode is arranged so that only 0 and 1 have it set — and the
second is the bit itself. So the output is the second bits, truncated where the
first bits stop: Complexity.cellBits twice and one Complexity.runTrue.
The whole simulation #
Everything above, wired together: a clock long enough to run the machine to a halt and to rewind the output head, a first iteration that runs the machine, a second that rewinds, and the extraction.
The three stages, as functions of the clock #
The clock string u fixes the encoded window: the ruler is 2|u| bits wide, so
the window is W = |u| - 1 cells and u.tail is a ruler of exactly W bits.
The block ruler belonging to a clock value.
Equations
Instances For
Stage one: the encoding after running the machine to a halt.
Equations
Instances For
The simulation computes the machine's function. Provided the clock outlasts the run, covers the input and is wide enough for the state code, the three stages reproduce exactly the string the machine leaves on its output tape.