context.cerny(n)

Create the Černý automaton with $n$ states.

Preconditions:

  • the labelset is free
  • the labelset has at least two generators

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:

Examples

In [1]:
import vcsn
b = vcsn.context('lal_char(ab), b')
In [2]:
b.cerny(4)
Out[2]:
%3 I0 0 0 I0->0 F0 0->F0 0->0 b 1 1 0->1 a 1->1 b 2 2 1->2 a 2->2 b 3 3 2->3 a 3->0 a, b