context
.cerny
(n
)¶Create the Černý automaton with $n$ states.
Preconditions:
The Černý automata are $n$-states DFA defined by the following transition function:
$$\delta(s, l) = \begin{cases} (q + 1)~\text{mod}~n & \text{if}~l = a\\ q & \text{if}~l = b \wedge q \neq n - 1\\ 0 & \text{if}~l = b \wedge q = n - 1\\ \end{cases}$$where $a$ and $b$ denote two letters of the labelsets.
See also:
import vcsn
b = vcsn.context('lal_char(ab), b')
b.cerny(4)