Machines reading their input by address #
A read machine has a state, and in each state either halts or takes a step. A step may read the
bit of the input at an address given by the state, and may emit output bits. It is a convenient
intermediate model for space-bounded algorithms that consult their input at computed positions:
Turing.StepMachines, which move a head one cell at a time, simulate read machines by keeping
the head position in their state.
Main definitions #
Turing.ReadMachine: read machines, with an initial state, a halting test, the address read by a step and the step itself.Turing.ReadMachine.run: the configuration after a number of steps.
Main results #
Turing.ReadMachine.run_add: runs compose.Turing.ReadMachine.runFrom_loop: a loop of a read machine, emitting a word in each round.
A machine reading its input by address. In a state q that is not halting, it reads the input
bit at addr q (if any; false beyond the input or without an address), and moves to
(step q b).1, emitting (step q b).2.
- init : σ
The initial state.
- halt : σ → Bool
The halting states.
The address of the input bit read by the next step, if any.
The next state and the emitted bits, given the bit read.
Instances For
The bit read in state q.
Instances For
One step on the input x; halting configurations are fixed.
Instances For
The configuration after n steps on the input x, from c.
Instances For
The configuration after n steps on the input x.
Instances For
A step from a state that is not halting.
A loop of a read machine: if from the state s i the machine steps to s (i + 1) and
emits e i, for i < M, then after j ≤ M steps from s 0 it is in s j, having emitted
e 0, …, e (j - 1).