Running a tidy computation on work tapes #
onWords tm mark reads its input as a word on one work tape and writes the output of tm as a
word on another, leaving every other tape alone. It is tm with its output redirected to a new
work tape (Turing.MultiTapeTM.outputToWord) and its input read from another new work tape
(Turing.MultiTapeTM.inputFromWord).
Its k + 1 + 2 work tapes are the k work tapes of tm, the output work tape
(Fin.last k).castAdd 2, the input work tape Fin.natAdd (k + 1) 0, and the flag tape of
inputFromWord.
Main definitions #
Turing.MultiTapeTM.onWords: the composed machine.
Main results #
Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.onWords_extendTapes: run between two selected tapes with exact time and space overheads.Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.onWords: iftmcomputesoutputfrominputtidily, thenonWords tm marktakesinputon its input work tape tooutputon its output work tape.
tm, with its output written to a new work tape and its input read from another, using mark
to flag the left end of the input. The output work tape is (Fin.last k).castAdd 2, the input
work tape Fin.natAdd (k + 1) 0.
Instances For
If tm computes output from input tidily, then onWords tm mark, started with input on
its input work tape and all other work tapes blank, halts with output on its output work tape,
every other work tape unchanged, and nothing emitted.
Run a tidy computation between two selected tapes, preserving the input and emitting nothing. The embedding ensures that the selected input and output tapes are distinct.