Kernel: Python 3
polynomial.cotrie
Generate a "cotrie" automaton (multiple initial state, single final state automaton: a reversed tree) from a finite series, given as a polynomial of words.
Postconditions:
Result.is_codeterministic()
Result = p.cotrie.shortest(N)
for a large enough N.
See also:
Examples
In [1]:
Boolean weights (finite language)
In [2]:
In [3]:
Since the cotrie is codeterministic, determinizing it suffices to minimize it. It turns out that in the current implementation of Vcsn, it is faster to determinize than to minimize:
In [4]:
10000 loops, best of 3: 71.5 µs per loop
In [5]:
10000 loops, best of 3: 39.6 µs per loop
In [6]:
True