termCheckTM: deciding TerminatedRegion by a single input scan #
The body machine's per-iteration theorem (bodyIteration) carries the side
condition TerminatedRegion α on the encoded description. The time-hierarchy
diagonalizer must decide this property of its own input by machine, so it
can route the (malformed) inputs violating it around the universal simulation.
Contents:
terminatedRegionB— a Boolean version ofTerminatedRegion, with the bridgeterminatedRegionB_iff.scanStep/ctrlVerdict— a six-state symbol-level automaton whose left-fold overgroupPairs αcomputesterminatedRegionB α(scanVerdict_eq): track the two□separators of thetakeFielddecomposition, then inspect the first two symbols of the entry region.termCheckTM : TM 8— the machine: a single left-to-right scan of the input decoding bit pairs into symbols (symOfPair) and driving the automaton, then an input rewind to cell 1 and a verdict write at output cell 1. All 8 work tapes idle throughout.termCheckTM_hoareTime— the Hoare specification:2·|x| + 8steps, input head returned to cell 1, work tapes preserved exactly, verdictΓ.one/Γ.zeroat output cell 1 (output head parked back at 1).
Boolean version of TerminatedRegion: the entry region (after the two
takeField splits) fails the check exactly when it starts with a □
followed by a non-□ symbol.
Equations
- One or more equations did not get rendered due to their size.
Instances For
terminatedRegionB decides TerminatedRegion.
Equations
- One or more equations did not get rendered due to their size.
One decoded desc symbol updates the scan control: □s advance through
the takeField structure, the first two region symbols decide the
verdict, and verdicts are absorbing.
Equations
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.seek1 Complexity.Γw.blank = Complexity.TM.UTMBody.TermCtrl.seek2
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.seek1 x✝ = Complexity.TM.UTMBody.TermCtrl.seek1
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.seek2 Complexity.Γw.blank = Complexity.TM.UTMBody.TermCtrl.look1
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.seek2 x✝ = Complexity.TM.UTMBody.TermCtrl.seek2
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.look1 Complexity.Γw.blank = Complexity.TM.UTMBody.TermCtrl.look2
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.look1 x✝ = Complexity.TM.UTMBody.TermCtrl.good
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.look2 Complexity.Γw.blank = Complexity.TM.UTMBody.TermCtrl.good
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.look2 x✝ = Complexity.TM.UTMBody.TermCtrl.bad
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.good x✝ = Complexity.TM.UTMBody.TermCtrl.good
- Complexity.TM.UTMBody.scanStep Complexity.TM.UTMBody.TermCtrl.bad x✝ = Complexity.TM.UTMBody.TermCtrl.bad
Instances For
End-of-stream verdict: only bad rejects (a truncated region is fine —
TerminatedRegion needs two symbols after the second □ to fire).
Equations
Instances For
The scan computes the region check: folding the automaton over the
decoded symbol stream of α and taking the end-of-stream verdict is
exactly terminatedRegionB α.
Control states of termCheckTM:
readFst ctrl— scanning, at the first bit of the current pair;readSnd ctrl b— scanning, at the second bit of a pair whose first bit wasb;rewind v— walking the input head back to▷, verdictvin hand;emit v— input head at cell 1: write the verdict at output cell 1;done— halt.
- readFst (ctrl : TermCtrl) : TermCheckQ
- readSnd (ctrl : TermCtrl) (b : Bool) : TermCheckQ
- rewind (v : Bool) : TermCheckQ
- emit (v : Bool) : TermCheckQ
- done : TermCheckQ
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readFst a) (Complexity.TM.UTMBody.TermCheckQ.readFst b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl_1 b) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) (Complexity.TM.UTMBody.TermCheckQ.rewind v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) (Complexity.TM.UTMBody.TermCheckQ.emit v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) Complexity.TM.UTMBody.TermCheckQ.done = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl_1) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) (Complexity.TM.UTMBody.TermCheckQ.rewind v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) (Complexity.TM.UTMBody.TermCheckQ.emit v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) Complexity.TM.UTMBody.TermCheckQ.done = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.rewind v) (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.rewind v) (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.rewind a) (Complexity.TM.UTMBody.TermCheckQ.rewind b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.rewind v) (Complexity.TM.UTMBody.TermCheckQ.emit v_1) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.rewind v) Complexity.TM.UTMBody.TermCheckQ.done = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.emit v) (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.emit v) (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.emit v) (Complexity.TM.UTMBody.TermCheckQ.rewind v_1) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.emit a) (Complexity.TM.UTMBody.TermCheckQ.emit b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq (Complexity.TM.UTMBody.TermCheckQ.emit v) Complexity.TM.UTMBody.TermCheckQ.done = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq Complexity.TM.UTMBody.TermCheckQ.done (Complexity.TM.UTMBody.TermCheckQ.readFst ctrl) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq Complexity.TM.UTMBody.TermCheckQ.done (Complexity.TM.UTMBody.TermCheckQ.readSnd ctrl b) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq Complexity.TM.UTMBody.TermCheckQ.done (Complexity.TM.UTMBody.TermCheckQ.rewind v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq Complexity.TM.UTMBody.TermCheckQ.done (Complexity.TM.UTMBody.TermCheckQ.emit v) = isFalse ⋯
- Complexity.TM.UTMBody.instDecidableEqTermCheckQ.decEq Complexity.TM.UTMBody.TermCheckQ.done Complexity.TM.UTMBody.TermCheckQ.done = isTrue ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Terminated-region check: scan the input left to right decoding bit
pairs into desc symbols (symOfPair) and driving scanStep; at the
input's first blank (end of x, or a dropped trailing odd bit) take
ctrlVerdict, rewind the input head to cell 1, and write the verdict
(1 = terminated, 0 = not) at output cell 1. All 8 work tapes idle
throughout.
Equations
- One or more equations did not get rendered due to their size.
Instances For
termCheckTM specification (ghost-initial-tapes style): started on
the input tape of x with head at cell 1, all work tapes parked
(head ≥ 1, not reading ▷) and the output tape ▷-clean with head at
cell 1, the machine halts within 2·|x| + 8 steps having written the
terminatedRegionB x verdict (1 = holds, 0 = fails) at output
cell 1. The input head returns to cell 1, every work tape is preserved
exactly, and the output head is parked back at cell 1.