Finite-state transducers #
A finite-state transducer reads its input once from left to right. In state q, on the symbol
a, it moves to state (τ.step q a).1 and emits the word (τ.step q a).2; at the end of the
input it emits τ.final q. Every emitted word has length at most two.
τ.toTM runs a transducer as a Turing machine without work tapes, so every function computed by a
transducer is tidily computable in linear time and zero space.
Main definitions #
Turing.MultiTapeTM.Transducer: finite-state transducers.Turing.MultiTapeTM.Transducer.run: the word a transducer emits on a word.Turing.MultiTapeTM.Transducer.toTM: the transducer as a machine without work tapes.
Main results #
Turing.MultiTapeTM.Transducer.computesInTimeAndSpace_toTM:τ.toTMemitsτ.run τ.q₀ wonwwithin2 * w.length + 3steps and zero space.Turing.MultiTapeTM.Transducer.computableTidilyInTimeAndSpace: a function computed by a transducer with finitely many states is tidily computable in linear time and zero space.
A finite-state transducer with input and output alphabet Symbol and states Q. In state q
on the symbol a it moves to (step q a).1 and emits (step q a).2; at the end of the input it
emits final q.
- q₀ : Q
The initial state.
The successor state and the emitted word on reading a symbol.
- final : Q → List Symbol
The word emitted at the end of the input.
At most two symbols are emitted per input symbol.
At most two symbols are emitted at the end of the input.
Instances For
The word τ emits on w, started in state q.
Instances For
τ as a machine without work tapes. Its states are the states of τ, a pending output
symbol, and whether the end of the input has been reached.
Instances For
τ.toTM emits τ.run τ.q₀ input on input, in 2 * input.length + 3 steps and zero
space.
Followed by a rewind of the input head, τ.toTM emits τ.run τ.q₀ input tidily.
A function computed by a transducer with finitely many states is tidily computable in linear time and zero space.