Reading from the input at the input head #
An InputReader is a finite-state device that reads the input from the input head on: in state
q on the symbol a it emits at most one symbol and continues in a new state, or stops after a.
It also stops at the end of the input. appendRead r i appends what r emits to the word on work
tape i and leaves the input head after what r read. Reading one token of a self-delimiting
encoding is an instance.
Main definitions #
Turing.MultiTapeTM.InputReader: finite-state input readers.Turing.MultiTapeTM.InputReader.read: the word a reader emits and the number of symbols it reads.Turing.MultiTapeTM.appendRead: the machine that runs a reader, appending to a work tape.
Main results #
Turing.MultiTapeTM.transformsTapesAt_appendRead: its specification.
A finite-state input reader: in state q on the symbol a it emits (step q a).2 and
continues in (step q a).1, or stops after a if that is none.
- q₀ : Q
The initial state.
The next state, or
noneto stop, and the emitted symbol, if any.
Instances For
The word r emits on w from state q, and the number of symbols it reads: it stops after a
symbol leading to none, or at the end of w.
Instances For
r run on one work tape: move the head to the end of the word, append what r emits while
reading the input, and move the head back to the start.
Instances For
r run on work tape i, appending what it emits to the word there.
Instances For
appendRead r i, started with the input head at p on the input x and v on work tape i,
appends what r emits reading x from p on to v, moves the input head over what r read, and
changes nothing else.