UTM initialization machine #
initTM : TM 6 is the first phase of the universal Turing machine
(docs/UTM-design.md). On input pair α x it:
- parses the α-region of the input (α's bits doubled, terminated by the
separator
01), translating each 2-bit group into one desc symbol (symOfPair) written onto the desc tape (work tape 4); - copies
xonto the virtual input tape (work tape 0) shifted one cell right (the +1-shift representation: work-0 cell 1 stays□,x[i]goes to celli + 2); - copies the first desc field (the
qstartfield, i.e. the symbols before the first□) onto the state tape (work tape 3); - parks all work-tape heads at cell 1 and halts, leaving the output tape untouched.
The specification is initTM_hoareTime. Malformed inputs (a 10 cell pair
or a blank in the middle of a 2-cell group in the α-region) make the machine
halt immediately; the specification only covers well-formed inputs.
Control states of initTM.
start— the forced first step (every head bounces off▷to cell 1);readFst pending— phase 1, at the first cell of a 2-cell input group;pendingholds an α-bit waiting for its partner (desc symbols are built from two α-bits);readSnd fst pending— phase 1, at the second cell of a 2-cell group whose first cell held the bitfst;copyX— phase 2, copyingxto work tape 0 (shifted);rewindDesc— phase 3, rewinding the desc tape (work 4) to cell 1;copyField— phase 3, copying theqstartfield of the desc tape onto the state tape (work 3);rewindDesc2,rewindState,rewindV0— final rewinds of work tapes 4, 3, 0;done— halt.
- start : InitQ
- readFst (pending : Option Bool) : InitQ
- readSnd (fst : Bool) (pending : Option Bool) : InitQ
- copyX : InitQ
- rewindDesc : InitQ
- copyField : InitQ
- rewindDesc2 : InitQ
- rewindState : InitQ
- rewindV0 : InitQ
- done : InitQ
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
The UTM initialization machine. See the module docstring and
docs/UTM-design.md for the phase structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
initTM specification. Started on input pair α x with all work
tapes and the output tape empty, initTM halts within
4·|pair α x| + 4·|groupPairs α| + 24 steps having:
- left the input tape cells untouched;
- copied
xonto the virtual input tape (work 0) in the +1-shift representation (theVShiftshadow ofTape.init (x.map Γ.ofBool)); - translated α onto the desc tape (work 4):
groupPairs α; - copied the qstart field
(takeField (groupPairs α)).1onto the state tape (work 3); - left work tapes 1, 2, 5 and the output tape blank;
- parked every work-tape head and the output head at cell 1.
initTM specification, started form. Identical postcondition and
time bound to initTM_hoareTime, but the tapes arrive already bounced
off ▷: the input head is parked at cell 1 over the same cells, every
work tape is (Tape.init []).move Dir3.right (blank cells, head 1), and
the output tape is blank with head 1. This is the form in which a lifted
initTM receives its tapes when it runs mid-sequence rather than as the
first phase of a machine.