automaton.shortest(num = None, len = None)
Return a (finite) approximation of the behavior of the automaton controled by the length of the words. In other words, compute the polynomial of the first accepted words (according to the shortlex order), and their associated weight.
Arguments:
numthe number of words to find (there might be fewer).Nonestands for iflenis specified, 1 otherwise.lenthe maximum length of the words to find.Nonestands for .
Default values are handled as follows:
| len = None | len = | |
| num = None | ||
| num = |
Preconditions:
the automaton must not have spontaneous cycles
See also:
Examples
Boolean Automata
Calling a.shortest() is equivalent to a.shortest(1) which is equivalent to a.shortest(1, 0): find the shortest word, whatever its length:
To get the first four words, use a.shortest(4) (or a.shortest(len = 4)):
The words with at most four letters:
At most 10 words of at most 4 letters:
At most 10 words of at most 3 letters:
Weighted Automata
The following automaton decodes binary numbers.
Transducers
The following automaton maps words to words. The length of a multitape words is the largest length of its components: .