automaton
.compose(aut, lazy=False)
The (accessible part of the) composition of two transducers ( and ).
Preconditions:
and are transducers
has at least 2 tapes
The second tape of must have the same labelset as the first tape of
Postconditions:
See also:
Examples
The result of the composition has a useless state. Note that only the accessible part has been computed.
Translations
The composition of a "translator" from French to English with one from English to Spanish is analogous to the computation of the French to Spanish "translator".
The states are decorated: they are pairs of states of both automata. For technical reason, to ensure correctness of the result, since this is a composition between automata with spontaneous transition, the second automaton was "insplit": its states with both proper and spontaneous transitions (such as state 5), were split in two: a state swith only incoming proper transitions (labeled with ) and a state with only incoming spontaneous transitions (labeled with ). See automaton.insplit for more details.
To remove the decoration, use automaton.strip.
Lazy composition
The composition can be computed on-the-fly. This is especially useful when composing two large automata with a small one: one will only compute the parts of the large composition that are needed for the small composition.
The state is unresolved, and will only be computed when necessary.
Relying on "string-letters"
This example follows the same path, but using letters that are strings.