automaton.is_standard

Whether an automaton is standard, i.e.:

  • a single initial state
  • whose (initial) weight is 1
  • without incoming transitions

See also:

Examples


In [1]:
import vcsn
b = vcsn.context('lal_char(abc), b')
a = b.expression('a').standard() | b.expression('b').standard()
a


Out[1]:
%3 I0 0 0 I0->0 I2 2 2 I2->2 F1 F3 1 1 0->1 a 1->F1 3 3 2->3 b 3->F3

In [2]:
assert(not a.is_standard())
assert(a.standard().is_standard())

In [3]:
%%automaton a
context = "lal_char(abc), z"
$ -> 0 <2>
0 -> 1 a
1 -> $


%3 I0 0 0 I0->0 ⟨2⟩ F1 1 1 0->1 a 1->F1

In [4]:
assert(not a.is_standard())
assert(a.standard().is_standard())

In [5]:
%%automaton a
context = "lal_char(abc), z"
$ -> 0 <2>
0 -> $ <2>
0 -> 1 a
1 -> 0 b


%3 I0 0 0 I0->0 ⟨2⟩ F0 0->F0 ⟨2⟩ 1 1 0->1 a 1->0 b

In [6]:
assert(not a.is_standard())
assert(a.standard().is_standard())