Configurations of Multi-Tape Turing Machines #
Configurations of a multi-tape Turing machine with a read-only input tape, k work tapes and one
write-only output tape, together with what a single transition does to one and the space measure
read off a list of them.
Design #
Nothing here mentions a machine. A step is described in two parts: an Action, recording
which way the input head moves, what is written and where the work heads move, which symbol is
emitted and which state follows; and Action.apply, which carries it out on a
configuration.
The output tape is part of the configuration, so the string emitted along a run can be read off the configuration the run ends in.
Important Declarations #
Cfg: the configuration: the internal state, the tape contents and head positions, and the output tapeAction: what a machine does in one stepAction.apply: the effect of one action on a configurationCfg.Halted,Cfg.init: halting, and the configuration a machine starts inspaceUsedOfCfgs: work tape cells touched along a list of configurations
The configurations of a Turing machine is relative to the input of the machine and consist of:
- an
Optional state (or none for the halting state), - the position of the input head (shifted by one),
- the contents of the work tape,
- the positions of the work tape heads,
- the contents of the write-only output tape
- state : Option State
the state of the TM (or none for the halting state)
the position of the input head, shifted by one
the work tapes
the positions of the heads on the work tapes
- output : List Symbol
the contents of the write-only output tape
Instances For
Equations
- Turing.instInhabitedCfg = { default := Turing.instInhabitedCfg.default }
Two configurations of a machine without work tapes are equal if their states, input head positions and outputs are equal.
Attempt to move the input tape head. The machine can only read one empty cell outside of the input, any attempted movement beyond that results in no movement.
The addition is performed in ℤ before clamping. Performing it in Fin (n + 2) would wrap an
outward boundary move to the opposite end of the input.
Equations
Instances For
A left move away from the left input boundary decrements the native input position.
The symbol read by work tape i.
Equations
- cfg.workTapeSymbols i = cfg.workTapes i (cfg.workTapePos i)
Instances For
The same configuration in a different control state, possibly of a different state type.
Equations
Instances For
Remap the (optional) state of a configuration through φ, leaving the input head, the work
tapes, the work-tape heads and the output alone. This is the shape of embedding used to place a
sub-machine's configurations into a larger machine built from it.
Equations
- Turing.Cfg.mapState φ c = { state := φ c.state, inputPos := c.inputPos, workTapes := c.workTapes, workTapePos := c.workTapePos, output := c.output }
Instances For
The effect of an action on a configuration: move the input head, write and move on the work tapes, append the emitted symbol to the output tape, and go to the successor state. This is the part of a step that does not depend on how the action was chosen.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The work tape cells visited by the head of tape i along a list of configurations.
Equations
- Turing.visitedOfCfgs cfgs i = (List.map (fun (x : Turing.Cfg k Symbol State input) => x.workTapePos i) cfgs).toFinset
Instances For
The number of work tape cells touched by the heads along a list of configurations.
Equations
- Turing.spaceUsedOfCfgs cfgs = ∑ i : Fin k, (Turing.visitedOfCfgs cfgs i).card