automaton.is_letterized

Whethere the automaton is letterized, i.e. each transition is labeled by a single letter. It's always true when labels are letters, for example.

Examples


In [1]:
import vcsn


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

In [2]:
a1 = vcsn.b.expression("ab+c*").standard()
a1


Out[2]:
%3 I0 0 0 I0->0 F0 F3 F4 0->F0 1 1 0->1 a 4 4 0->4 c 3 3 1->3 b 3->F3 4->F4 4->4 c

In [3]:
a1.is_letterized()


Out[3]:
True

Here, no computation is done, the result is implied by the labelset.


In [4]:
ctx = vcsn.context("law_char, b")
a2 = ctx.expression("a+bc*").standard()
a2


Out[4]:
%3 I0 0 0 I0->0 F1 F3 F5 1 1 0->1 a 3 3 0->3 b 1->F1 3->F3 5 5 3->5 c 5->F5 5->5 c

In [5]:
a2.is_letterized()


Out[5]:
True

Here, as labels can be words, each transition's label is checked to see that it is a letter (or the empty word).


In [6]:
a3 = ctx.expression("abc").standard()
a3


Out[6]:
%3 I0 0 0 I0->0 F1 1 1 0->1 abc 1->F1

In [7]:
a3.is_letterized()


Out[7]:
False