Clock infrastructure for the time-bounded universal machine #
The generic liftTM frame rules live in Lift.Hoare, re-exported here for
compatibility. They preserve arbitrary non-marker extra tapes with the source's
unchanged time bound; the clocked UTM uses them to pin tape 6 while running a
six-tape phase.
The module also defines two standalone clock machines. They are not part of
the clocked universal machine, whose loop uses the frontier-parked variants
decFrontierTM and orZeroTM from UTM/Internal/ClockFrontier.lean; nothing
in the library uses them. Both are TM 7, acting on work tape 6 (clkT),
which holds a unary counter (1s on cells 1..v, head parked at 1):
decClockTM— scan right to the last mark, blank it, rewind to cell 1; a zero counter is left unchanged. Spec:decClockTM_hoareTime(ghost style:2*v + 6steps, every other tape exactly unchanged).zeroTestTM— read clock cell 1 and write the verdict to the real output cell 1 (1iff the counter is zero), leaving the output head at cell 1 and every work tape exactly unchanged. Spec:zeroTestTM_hoareTime(4 steps).
The clock tape: work tape 6 of the 7-tape layout (6 UTM body tapes plus the clock).
Equations
Instances For
Control states of decClockTM.
- scan : ClockPhase
- erase : ClockPhase
- back : ClockPhase
- park : ClockPhase
- done : ClockPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Decrement the clock: scan right over the marks on tape clkT,
erase the last one, rewind to cell 1. From v marks to v - 1 marks
in at most 2v + 6 steps; every other tape idles throughout (and is
exactly preserved while parked). The zero clock is left unchanged.
Standalone: the clocked universal machine uses decFrontierTM
instead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
decClockTM specification (ghost-initial-tapes style). Starting
from qstart with the clock tape (clkT = work tape 6) holding v
unary marks with its head at cell 1, and every other tape parked on a
non-▷ symbol, decClockTM halts within 2v + 6 steps having
decremented the clock to v - 1 marks (head back at cell 1); the
input tape, the output tape, and every other work tape are preserved
exactly. The zero clock is left unchanged (0 - 1 = 0).
Equations
- Complexity.TM.instFintypeZeroTestPhase = { elems := {Complexity.TM.ZeroTestPhase.test, Complexity.TM.ZeroTestPhase.done}, complete := ⋯ }
Clock zero test: read clock cell 1 (head parked at 1) and write
the verdict to the real output cell 1 — 1 if it is blank (the
counter is zero), else 0 — leaving the output head at cell 1;
then halt. Every work tape and the input tape idle. Standalone: the
clocked universal machine uses orZeroTM instead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
zeroTestTM specification (ghost-initial-tapes style). Starting
from qstart with the clock tape (clkT = work tape 6) holding v
unary marks with its head at cell 1, the output head resting at cell 1
on a non-▷ symbol, and every other tape parked on a non-▷ symbol,
zeroTestTM halts within 4 steps having
- written the verdict at output cell 1:
Γ.oneiffv = 0, elseΓ.zero(all other output cells unchanged, head back at cell 1); - left the input tape and every work tape exactly unchanged.