Composing tidy computations #
tm₂.comp tm₁ mark runs tm₁ with its output written to a work tape, then runs tm₂ reading its
input from that tape, and finally clears the tape. If both machines compute tidily, so does the
composition. Its time is the sum of the two times plus a term linear in the length of the
intermediate word; so is its space, since the intermediate word is kept on a work tape.
Main definitions #
Turing.MultiTapeTM.comp: the composed machine.
Main results #
Turing.MultiTapeTM.ComputesTidilyInTimeAndSpace.comp: tidy computations compose.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.comp: tidily computable functions compose.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.comp_linear: the same, with the overhead a constant multiple of the length of the intermediate word plus one.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.comp': the same, with the length of the intermediate word bounded by the time of the inner function.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpaceOfLength.comp: the same for bounds of the input length, given a boundlon the length of the intermediate word.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.computableInTimeAndSpace_comp: hencef ∘ gis computable in the sense ofTuring.MultiTapeTM.ComputableInTimeAndSpace.Turing.MultiTapeTM.ComputableTidilyInTimeAndSpaceOfLength.computableInTimeAndSpaceOfLength_comp: the same for bounds of the input length.
tm₂ after tm₁, both with their work tapes padded to max k₁ k₂: run tm₁ with its output
written to the work tape Fin.natAdd (max k₁ k₂) 0, run tm₂ reading its input from that tape
(using mark on the last work tape to flag the left end of the input), then clear that tape.
Instances For
Clearing the only non-blank work tape leaves all work tapes blank.
If tm₁ computes w from x tidily and tm₂ computes y from w tidily, then
tm₂.comp tm₁ mark computes y from x tidily.
If g and f are tidily computable, so is f ∘ g, in the sum of their times and spaces plus
a term linear in the length of the intermediate word encMid (g a).
If g and f are tidily computable, so is f ∘ g, in the sum of their times and spaces plus
a constant multiple of the length of the intermediate word encMid (g a) plus one.
If g and f are tidily computable, so is f ∘ g: the intermediate word is no longer than
the time of g.
If g and f are tidily computable in time t₁, t₂ and space s₁, s₂ of the length of
their input, for monotone t₂ and s₂, and the output of g on inputs of length n has length at
most l n, then f ∘ g is tidily computable with bounds depending on t₂ (l n), s₂ (l n) and
l n.
If g and f are tidily computable, then f ∘ g is computable.
If g and f are tidily computable in time t₁, t₂ and space s₁, s₂ of the length of
their input, for monotone t₂ and s₂, and the output of g on inputs of length n has length at
most l n, then f ∘ g is computable.