Writing the output as a word on a work tape #
The additions of cslib PR #1111 to
Cslib.Computability.Machines.Turing.MultiTape.Plumbing.OutputToTape.
outputToWord tm runs tm with its output redirected to a new last work tape
(Turing.MultiTapeTM.outputToTape), then moves the head of that tape back to cell 0
(Turing.MultiTapeTM.rewindWork). If tm computes output tidily
(Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace), then outputToWord tm takes blank work tapes
to blank work tapes, except that the last one holds output, and emits nothing.
Main definitions #
Turing.MultiTapeTM.outputToWord: the machine writing its output as a word on a work tape.
Main results #
Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.outputToWord: its specification.Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.outputToWord_extendTapes: preserve unselected tapes while writing the output.Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.outputToWord_onTape: the blank-tape case.
Rewinding the output tape #
tm with its output written to a new last work tape, whose head is then moved back to
cell 0.
Instances For
If tm computes output tidily, then outputToWord tm, started on blank work tapes, halts
with output on its last work tape, every other work tape blank, and nothing emitted.
A tidy computation writes its output on the selected last tape, leaves its selected scratch tapes blank, and preserves all unselected words. All selected tapes must initially be blank.
Write a tidy computation's output to a selected tape, leaving every other tape blank.