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')


:0: FutureWarning: IPython widgets are experimental and may change in the future.

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 ⟨2⟩a 3 3 1->3 ⟨3⟩b 3->F3 3->1 ⟨2⟩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 ⟨2⟩a 3 3 0->3 b, c 2 2 1->2 ⟨3⟩b 1->3 a, c 2->F2 2->1 ⟨2⟩a 2->3 b, c 3->3 [a-c]

In [5]:
a.complete().is_complete()


Out[5]:
True