Tidy computations #
A machine computes tidily if it clears its work tapes before halting and moves all tape heads to their initial position. This means tidy computations can easily be iterated and when applied to a subset of work tapes, a combinator can run a tidy machine as a subroutine and rely on nothing but the word it emits.
A tidy computation is defined as a Turing.MultiTapeTM.TransformsTapes from blank work tapes to
blank work tapes, so the lemmas about tape transformations apply to it directly. The three
notions below add tidiness to Turing.MultiTapeTM.ComputesInTimeAndSpace,
Turing.MultiTapeTM.ComputesFunInTimeAndSpace and Turing.MultiTapeTM.ComputableInTimeAndSpace.
Main definitions #
Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace: a machine computes an output tidily.Turing.MultiTapeTM.ComputesFunTidilyInTimeAndSpace: a machine computes a function tidily.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace: some machine with binary alphabet and finitely many states computes a function tidily.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpaceOfLength: the same, with bounds on the length of the encoded input.
Main results #
Turing.MultiTapeTM.computesTidily_iff: a tidy computation is a single run path betweenTuring.MultiTapeTM.wordsCfgconfigurations within the time and space bounds.
Tidy computations #
ComputesTidilyInTimeAndSpace tm input output t s: started on input with blank work tapes,
tm halts within t steps and s work-tape cells, having emitted output, with every work tape
blank and every head back at its starting cell.
Instances For
A tidy computation is a single run path between Turing.MultiTapeTM.wordsCfg configurations
with blank work tapes, which emits the output, within the time and space bounds.
Resource bounds can be weakened.
Tidily computing a function #
ComputesFunTidilyInTimeAndSpace tm encIn encOut f t s: for every a, the machine computes
encOut (f a) from encIn a tidily, within t a steps and s a cells.
Instances For
Resource bounds can be weakened independently on every input.
Tidy computability #
Some machine with binary alphabet and finitely many states computes f tidily within the
bounds t and s. The bounds include the cost of restoring the tapes.
Instances For
Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace with the bounds t and s evaluated at the
length of the encoded input: the tidy analog of
Turing.MultiTapeTM.ComputableInTimeAndSpaceOfLength.
Instances For
Tidy computability is monotone in the resource bounds.