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.
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.