The counting machine's tape layout #
⚠️ Unreviewed by Bolton
Placing the simulation with TM.placeWorkTM 0 m fixes where every tape sits: the simulated
machine's k tapes come first, then its choice tape — which is the loop's counter — then the
loop's own registers, and last the tape TM.retargetOutput sends the verdict to.
Six registers are needed: the two tallies, the horizon to compare the count against, a scratch cell for that comparison, a permanently blank tape to blank the verdict slot from, and the unary register that drives the wipe.
Main results #
NTM.bodyTapes— the tape count, and the named indices into itNTM.bodyIdx_distinct— the indices are pairwise distinctNTM.bodyRest— the resting contents of every tape the tally state does not nameNTM.wipeTargets— the tapes the body blanks on its way outNTM.natTape_zero,NTM.regTape_zero— a register holding zero is the blank tapeNTM.regTape_eq_natTape— a unary register ofTones is the binary numeral2 ^ T - 1
The counting machine's tape count: the simulation's k + 1, six registers, and the tape the
verdict is written to.
Instances For
The counter, which is also the simulation's choice tape.
Equations
- Complexity.NTM.cIdx k = ⟨k, ⋯⟩
Instances For
The horizon the counter is compared against.
Equations
- Complexity.NTM.nIdx k = ⟨k + 3, ⋯⟩
Instances For
A permanently blank tape, read whenever the verdict slot must be blanked.
Equations
- Complexity.NTM.zIdx k = ⟨k + 5, ⋯⟩
Instances For
The tape the simulation's output is redirected to.
Equations
- Complexity.NTM.vIdx k = ⟨k + 7, ⋯⟩
Instances For
The simulated machine's own work tapes: everything strictly left of the counter.
Equations
- Complexity.NTM.simTapes k = List.filter (fun (j : Fin (Complexity.NTM.bodyTapes k)) => decide (↑j < k)) (List.finRange (Complexity.NTM.bodyTapes k))
Instances For
A counter tape holding zero is the blank tape, and so is a unary register holding zero. The machine's initial configuration therefore already carries both, which is what a prologue can start from.
A unary register of T ones is the binary numeral 2 ^ T - 1. The two encodings agree
cell for cell: regCells writes 1 in cells 1 … T and blanks beyond, and so do the bits of
2 ^ T - 1. This is what lets the prologue produce the horizon 2 ^ T with a single increment,
instead of a doubling loop.
The resting contents of every tape the tally state does not name. The horizon sits on
NTM.nIdx and the wipe's unary register on NTM.regIdx; everything else rests blank.
Equations
Instances For
The tapes the body wipes on its way out: the simulated machine's own, and the tape its verdict was written to.