Composing step machines #
g.comp f runs g on the output of f without ever writing that output down. It keeps the state
of g and the position of its head on the output of f. Whenever g needs the symbol under its
head, g.comp f runs f from the start on its own input, counting down the bits that f emits to
the one under the head of g, and then makes a step of g and rewinds its input head to restart
f.
Main definitions #
Turing.StepMachine.comp: the composition.
Main results #
Turing.StepMachine.simulates_comp:g.comp fsimulatesgon the output off, withcompPeriodsteps per step ofg.Turing.StepMachine.exists_haltsAt_comp:g.comp fhalts withinug * compPeriodsteps, with the output ofgon the output off.Turing.StepMachine.Computes.comp:g.comp fcomputesgafterf.
The countdown to the bit at the position p, before any bit is emitted.
Instances For
One more emitted bit: the countdown goes down, and at 1 the bit is found.
Instances For
The composition: g run on the output of f, which is never written down.
Instances For
The run of the composition #
Rewinding: from the position r on the input in the rewinding phase, the input head
reaches the first cell after r + 1 steps, and the phase is back to running f.
While rewinding, the input head moves to the left and nothing else changes.
The time of the rewind from the position p.
Instances For
The rewind from the position p: after rewindTime p steps the input head is on the
first cell and the phase is back to running f.
During the rewind, only the phase changes.
Running f: from the start of a round, the composition follows the run of f on the
input, counting down its output to the position pg of the head of g.
The configuration of g.comp f at the start of the round for the configuration c of g:
the input head on the first cell, ready to run f.
Instances For
A round: after running f to its halt, the composition makes the step of g on the bit
under its head and starts rewinding.
s is made of states along the runs of f on x up to uf and of g on the output of f
up to ug, with its countdown within the output of f.
Instances For
The states along the run of g.comp f are made of states along the runs of f and g.
Composition: when f halts after uf steps and g on its output after ug steps,
g.comp f halts within ug rounds, with the output of g.