The UTM halt test machine #
haltTestTM : TM 6 compares the state tape (work tape 3) against the
description's second field (the qhalt field of the desc tape, work tape 4)
and writes the verdict to output cell 1: Γ.one on match, Γ.zero on
mismatch. Both tape heads are rewound to cell 1 before halting.
Phases (from qstart = .skip):
- A (skip) — move the desc head right past the first field and its
separator (
□), landing on the first cell of theqhaltfield; - B (compare) — lockstep compare of state head vs desc head: both
□simultaneously ⇒ match; any difference ⇒ mismatch; - C (verdict) — one step: write
Γ.one/Γ.zeroat output cell 1 (output head stays at 1); - D (rewind) — rewind the state head to cell 1, then the desc head to cell 1, then halt.
The machine writes readBackWrite on every work tape at every step, so no
work-tape cell is ever changed; tapes 3 and 4 are restored exactly (same
head, same cells), and all other tapes are untouched.
Main results #
TM.haltTestTM_hoareTime— full HoareTime specification with ghost initial tapes, verdictΓ.oneiffstSyms = (takeField (takeField dSyms).2).1, in time2·|dSyms| + 2·|stSyms| + 12.
takeField connection: the desc tape holds dSyms (Tape.HoldsExact);
cells beyond the content read Γ.blank, indistinguishable from an
in-content Γw.blank — and takeField semantics agrees, by design. The
stSyms blank-freeness hypothesis is required: a □ inside stSyms would
truncate the machine's comparison at that point while stSyms as a list
extends beyond it (and takeField fields are always blank-free). The UTM
state tape holds bit symbols only, so this is no restriction in use.
Control states of haltTestTM.
- skip : HaltTestPhase
- compare : HaltTestPhase
- writeOne : HaltTestPhase
- writeZero : HaltTestPhase
- rewindSt : HaltTestPhase
- rewindD : HaltTestPhase
- done : HaltTestPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
The UTM halt test: skip the first desc field, compare the state tape (work tape 3) with the second desc field (work tape 4), write the verdict to output cell 1, rewind both heads to cell 1, halt.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Halt test specification (ghost-initial-tape style). Starting from
qstart where the state tape (work tape 3) holds the blank-free string
stSyms and the desc tape (work tape 4) holds dSyms (both heads at
cell 1), with the output head resting at cell 1, haltTestTM halts
within 2·|dSyms| + 2·|stSyms| + 12 steps having
- written the verdict at output cell 1:
Γ.oneiffstSymsequals the second field ofdSyms(the qhalt field,(takeField (takeField dSyms).2).1),Γ.zerootherwise; - restored work tapes 3 and 4 exactly (same cells, head back at 1);
- left the input tape, the other four work tapes, all other output cells, and the output head unchanged.