Tapes holding words and configurations of such tapes #
The normal form in which "tape transformer" machines (cf. TransformsTapes.lean) start and finish:
every work tape holds a word in the cells 0, 1, … and is blank everywhere else, with every head
at the start.
Main definitions #
Turing.tapeOfList: the tape holding exactly a given word.Turing.wordsCfg: the configuration whose tapes hold given words.
A tape containing exactly the symbols of xs at positions 0, ..., xs.length - 1.
Equations
- Turing.tapeOfList xs (Int.ofNat n) = xs[n]?
- Turing.tapeOfList xs (Int.negSucc a) = none
Instances For
Appending one symbol writes precisely the cell after the existing word.
A cell of tapeOfList xs is blank exactly outside the positions 0, …, xs.length - 1.
The blank tape holds the empty word.
The cell at position 0 holds the first symbol of the word.
The configuration whose work tape i holds exactly the word ws i with its head at the
start, whose input head is at the start of the input, in state q with output out.
Equations
- Turing.wordsCfg input q ws out = { state := q, inputPos := 1, workTapes := fun (i : Fin k) => Turing.tapeOfList (ws i), workTapePos := fun (x : Fin k) => 0, output := out }
Instances For
Remapping the state of a wordsCfg remaps its state and leaves the words alone.