context.ladybird(n)

Create the Ladybird automaton with $n$ states. This family of automata is a worst case for determinization: its determinized automaton has $2^n$ states.

Preconditions:

  • the labelset has at least three generators

See also:

Examples

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

These automata are easier to read when states are put on a circle, as does the circo engine.

In [3]:
b.ladybird(7)
Out[3]:
%3 I0 0 0 I0->0 F0 0->F0 1 1 0->1 a 1->0 c 1->1 b, c 2 2 1->2 a 2->0 c 2->2 b, c 3 3 2->3 a 3->0 c 3->3 b, c 4 4 3->4 a 4->0 c 4->4 b, c 5 5 4->5 a 5->0 c 5->5 b, c 6 6 5->6 a 6->0 a, c 6->6 b, c
In [4]:
from IPython.display import SVG
SVG(b.ladybird(7).as_svg(engine='circo'))
Out[4]:
%3 I0 0 0 I0->0 F0 0->F0 1 1 0->1 a 1->0 c 1->1 b, c 2 2 1->2 a 2->0 c 2->2 b, c 3 3 2->3 a 3->0 c 3->3 b, c 4 4 3->4 a 4->0 c 4->4 b, c 5 5 4->5 a 5->0 c 5->5 b, c 6 6 5->6 a 6->0 a, c 6->6 b, c