automaton.complete

Make an automaton complete, i.e., there is an outgoing transition from every state for every labels.

Precondition:

  • the labelset is free

Postcondition:

  • Result.is_complete()

See also:

Examples

In [1]:
import vcsn
z = vcsn.context('lal_char(abc), z')
In [2]:
a = z.expression('(<2>a<3>b)*').standard()
a
Out[2]:
%3 I0 0 0 I0->0 F0 F3 0->F0 1 1 0->1 ⟨6⟩a 3 3 1->3 b 3->F3 3->1 ⟨6⟩a
In [3]:
a.is_complete()
Out[3]:
False
In [4]:
a.complete()
Out[4]:
%3 I0 0 0 I0->0 F0 F2 0->F0 1 1 0->1 ⟨6⟩a 3 3 0->3 b, c 2 2 1->2 b 1->3 a, c 2->F2 2->1 ⟨6⟩a 2->3 b, c 3->3 [^]
In [5]:
a.complete().is_complete()
Out[5]:
True