Kernel: Python 3
automaton.factor
An automaton that accepts all the factors (aka subwords) of the words accepted by an automaton.
Algorithm:
Every accessible non-initial state is made initial, with weight one.
Every coaccessible non-final state is made final, with weight one.
Preconditions:
None
Postconditions:
Result == aut.prefix().suffix() == aut.suffix().prefix()
Caveat:
While semantically sound for Boolean automata, hardly makes sense on weighted automata.
See also:
Examples
In [1]:
In [2]:
In [3]: