Building an input prefix into a description #
A description d and a word p give a description Turing.MultiTapeTM.Universal.hardwire d p
of a machine that behaves on every input of bits x as the machine described by d behaves on
p ++ x (Turing.MultiTapeTM.Universal.Desc.computes_hardwire). This is the s-m-n theorem for
descriptions, the counterpart of the machines printing a fixed word in
Sipser, Lemma 6.1; that the new description is computed from d and p in
polynomial time is proved in Complexity.Computability.Machines.Turing.MultiTape.Halting.SMN.
The machine first writes a marker, then p, then a copy of its input on a new work tape, the
virtual input tape, and rewinds that tape to the marker. It then runs the transitions of d
with every reading and every move of the input head redirected to the virtual input tape
(Turing.MultiTapeTM.Universal.Redirect.redirect): the marker stands for the blank left of the
input, and moves are clamped at both ends as the input head's are. The redirected run is the run
of d, step for step (Turing.MultiTapeTM.Universal.Redirect.iterate_stepOut_redirect), since on
the virtual input tape the redirected transitions read what d reads on its input. Redirection is
independent of the prefix and is reused, after other preparations of the virtual input tape, in
Complexity.Computability.Machines.Turing.MultiTape.Halting.Rice.
Main definitions #
Turing.MultiTapeTM.Universal.Redirect.vtape: a virtual input tape.Turing.MultiTapeTM.Universal.Redirect.redirect: transitions reading the input from the virtual input tape.Turing.MultiTapeTM.Universal.hardwire: the description with an input prefix built in.
Main results #
Turing.MultiTapeTM.Universal.Desc.computes_iff_of_iterate: a description whose run is, after some steps, the image of the run of another description computes the same outputs.Turing.MultiTapeTM.Universal.Redirect.iterate_stepOut_redirect: redirected runs.Turing.MultiTapeTM.Universal.Desc.computes_hardwire,Turing.MultiTapeTM.Universal.Desc.halts_hardwire: the behavior ofhardwire d p.
References #
Runs of descriptions #
Runs agreeing after some steps. If, after u steps, the run of D on X is the image
under F of the run of d on x, with the same outputs, and F preserves exactly the halted
configurations, then D and d halt with the same outputs.
Virtual input tapes #
The symbol marking the left end of a virtual input.
Instances For
A virtual input tape for the input xs: the marker at position base, the input right of it
and blanks beyond, the cells l left of the marker, nearest first, and the head on the v-th cell
right of the marker.
Instances For
Work tapes #
Actions that neither write nor move leave tapes as they are.
Actions cut to the first work tapes leave the others as they are.
Redirecting the input #
The symbols that a virtual input tape reads where the input head reads i: the marker or a
blank for a blank, and i itself otherwise. Nothing stands for the marker itself, so transitions
reading the marker on the input are dropped.
Instances For
The transition e reading s on the virtual input tape, the first work tape: the state
renamed by φ, the input head reading r and kept in place, the work tapes of e after further
tapes reading pre, left alone, and before suf blank ones, and the actions on the work tapes of
e adjusted by adj.
Instances For
Redirected transitions: the transitions of table reading the input from the virtual
input tape (Turing.MultiTapeTM.Universal.Redirect.redirectEntry).
Instances For
The redirected transition found for a key is the redirection of the transition found for the key it stands for.
The configuration standing for the configuration c of a redirected description: the state
renamed by φ, the input head at rp, the virtual input tape for xs with the head at the input
position of c, and the work tapes of c between preT and sufT.
Instances For
A redirected step: in a description holding the redirected transitions of d for the
renamed states, a step from a configuration standing for c stands for the step of d from c,
and emits the same symbol.
Redirected runs: from a configuration standing for c, the run of D stands for the run
of d from c, with the same output.
Rewinding the virtual input tape #
The symbols that the input head reads on an input of bits: blanks and the bits.
Instances For
Transitions rewinding the virtual input tape, the first work tape, in the state q, with the
input head reading r and the other work tapes reading rest: over blanks and bits to the marker,
and then onto the first cell after it, in the state next.
Instances For
Rewinding a virtual input tape of bits from the v-th cell takes v + 1 steps.
Building in an input prefix #
The transitions writing the marker and the prefix p on the virtual input tape, before k
blank work tapes, whatever the input head reads: the marker in the state 0, and the i-th symbol
from the end of p in the state 2 * i + 6. The state after the last symbol is 4.
Instances For
The description d with the input prefix p built in. It writes the marker and p on a
new first work tape, the virtual input tape
(Turing.MultiTapeTM.Universal.Hardwire.writeEntries), copies the input after them
(Turing.MultiTapeTM.Universal.Hardwire.copyEntries), rewinds that tape
(Turing.MultiTapeTM.Universal.Redirect.rewindEntries) and runs the transitions of d reading
the input from it (Turing.MultiTapeTM.Universal.Redirect.redirect). These steps use even states,
and the states of d become odd.
Instances For
The preparation: after 2 * (p.length + x.length) + 4 steps, hardwire d p is in the
configuration standing for the initial configuration of d on p ++ x, redirected.