On this page, we describe three different models of transducers, which describe the same kinds of functions. The idea is that the functions process the input from left to right, but have some kind of mechanism (lookahead, or maybe nondeterminism) to query the part of the input that has not been seen yet.
NFA with output
An NFA with output is a nondeterministic finite automaton over an input alphabet , where each transition is labelled by a possibly empty word over the output alphabet. When given an input word over the input alphabet, the automaton produces all those words over the output alphabet which can be found by taking an accepting run, and reading from left to right the words on the transitions. Such an automaton is called functional if for every input word, there is exactly one output word (but possibly realised through several different accepting runs). Such an automaton is called unambiguous if for every input word, it has a unique accepting run; this implies being functional.
Here is an example of such an NFA, which is unambiguous, and which realises the function “identity if the last letter is , otherwise erase the entire word”.
Lookahead DFA with output
Define a lookahead DFA with output to be the following tuple:
• an input alphabet ;
• an output alphabet ;
• a finite automaton, called the lookahead automaton, which has input alphabet and is deterministic from right to left;
• a set of control states with a distinguished initial state ;
• a transition function
where are the states of the lookahead automaton.
The behaviour of the automaton, when given an input word over the input alphabet, is as follows. The automaton begins before the first position in the initial state. Suppose that the automaton has already read the letters , and is in state . One runs the lookahead automaton on the remaining input from right to left, yielding a state . To the pair the transition function is applied, yielding a new state and some output word. The output word is added to the output produced so far, and the automaton moves to the next letter in the new state.
Here is an example of a lookahead DFA with output which realises the function “identity if the last letter is , otherwise erase the entire word”. The automaton has only one control state, and uses a lookahead automaton whose states partition the input words into four kinds:
Here is the picture of the automaton:
In general, there might be a need to use control states, e.g. for the function “swap the first and last letter”.
Eilenberg bimachine
An Eilenberg bimachine is very similar to a lookahead DFA with output, only the definition is more symmetric. The machine consists of the following ingredients:
• an input alphabet ;
• an output alphabet ;
• a finite, called the past automaton, which has input alphabet and is deterministic from left to right, i.e. in the usual sense of determinism;
• a finite, called the future automaton, which has input alphabet and is deterministic from right to left;
• an output function
where are the states of the past automaton and are the states of the future automaton.
The function defined by such a machine is as follows. When given a word over the input alphabet, the automaton replaces, in parallel, each position by the value of the function on the triple consisting of:
• the state of the past automaton on the prefix up to but not including ;
• the -th letter;
• the state of the future automaton on the suffix from but not including .
This definition is illustrated below:
Theorem. The following models are equivalent, in terms of the functions from words to words that they define:
1. functional NFA with output;
2. unambiguous NFA with output;
3. lookahead DFA with output;
4. Eilenberg bimachines.
Proof.
Leave a Reply