The universal Turing machine #
utmTM — a single, fixed six-work-tape machine. On input pair α x it
simulates the single-work-tape machine (decodeDesc α).toTM on input x:
initTMparses the input — the descriptionαis translated onto the desc tape,xonto the (+1-shifted) virtual input tape, and the start state onto the state tape;- the loop alternates
bodyTM(one simulated step: first-match table scan and application) withhaltTestTM(compare the state tape against the description's halt field, reporting the verdict on the output tape); extractTMcopies the virtual output tape to the real output tape.
Its specification is the interpreter TMDesc.toTM (UTM/Interp.lean);
the simulation and time-bound theorems are assembled in UTM/Sim.lean
from the phase Hoare triples.
The universal Turing machine: initialization, then the simulate-one-step / test-halt loop, then output extraction.