Sequential composition of machines on shared tapes #
seq tm₀ tm₁ behaves like tm₀ until tm₀ would halt, at which point it continues as tm₁,
started in its initial state on the tapes as tm₀ left them. The state space is
State₀ ⊕ State₁, and the halting transition of the first phase is mapped to the initial state
of the second, so the handoff costs no extra step.
At the specification level this is transformsTapes_seq: transformations compose, with the time
and space bounds adding. The postcondition of TransformsTapes is what makes the proof direct:
the first machine halts in a full wordsCfg, which is exactly a starting configuration for the
second.
Main results #
Turing.MultiTapeTM.seq: the composed machine.Turing.MultiTapeTM.transformsTapes_seq: transformations compose, bounds adding.
The sequential composition of tm₀ and tm₁: it behaves like tm₀ until tm₀ would halt,
at which point it switches to the initial state of tm₁ and behaves like tm₁. The switch is
folded into the halting transition of tm₀, so it costs no step.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A configuration of the first phase: a configuration of tm₀, with a halted state mapped to
the initial state of the second phase. Under this map, the whole first phase of seq mirrors the
run of tm₀, including its halting step.
Equations
- Turing.MultiTapeTM.Sequential.leftCfg tm₁ cfg = Turing.Cfg.mapState (fun (st : Option State₀) => some (st.elim (Sum.inr tm₁.q₀) Sum.inl)) cfg
Instances For
The second phase of seq mirrors the run of tm₁.
While tm₀ is running, seq mirrors it.
Sequential composition of transformations. If the postcondition of the first transformation implies the precondition of the second, the composed machine performs the two transformations one after the other, with the time and space bounds adding.