Reading the input from a work tape #
inputFromTape tm behaves like tm, except that it reads its input from a work tape — the
virtual input tape — instead of the real one, which it never touches. The virtual input head
lives at cell p - 1 when the simulated input head is at position p, so the word cells
0, …, len - 1 are the input positions 1, …, len and the two boundary positions read the blanks
at cells -1 and len.
The one thing a blank cell cannot tell the machine is which boundary it is at — and it must
know, because the input head clamps there. This ambiguity is resolved by tracking a boundary
classification. A second fresh work tape, the flag tape, moves in lockstep with the virtual input
head and carries a single non-blank mark at cell -1, so the left boundary is recognised by
reading the flag. Reading blank on both the virtual input tape and the flag tape means the right
boundary.
The configuration map inCfg places the simulated input on the virtual input tape, places the
marker on the flag tape, and leaves the real input tape unused. The main lemmas show that one step
and an entire run path of the redirected machine mirror the corresponding step and run path of tm.
The clamped move of the virtual input head: at the left boundary (blank under the virtual head, flag marked) left moves are blocked, at the right boundary (blank on both) right moves are.
Instances For
tm, reading its input from the virtual input tape Fin.natAdd k 0, with the flag tape
Fin.natAdd k 1 marking the cell left of the input. The real input tape is never read and never
moved.
Instances For
A configuration of tm on input, as the redirecting machine sees it, over an arbitrary
ambient input: input sits on the virtual input tape with the head at cell inputPos - 1, the flag
tape carries its mark at -1 with its head in lockstep, and the ambient input head rests at
1.
Instances For
The virtual input head reads exactly what the simulated input head reads: the word cells are the input positions, the two boundary cells are blank.
The redirection is a step-semiconjugation. One step of the machine reading its input from
the virtual tape mirrors one step of the original, under the embedding inCfg.
The redirection preserves steps, so it maps run paths of tm to run paths of the redirected
machine.
Instances For
Space of the input-redirected path. The k inner tapes visit exactly what the original
path visits; the two extra tapes (virtual input, flag) each move only with the simulated input
head, which stays within [-1, input.length], so they add at most 2 * (input.length + 2).