Whether the automaton is deterministic:
Precondition:
See also:
In [1]:
import vcsn
b = vcsn.context("lal_char(ab), b")
The empty automaton is deterministic.
In [2]:
a = vcsn.automaton(''' digraph { vcsn_context = "lal_char(ab), b" } ''')
a
Out[2]:
In [3]:
a.is_deterministic()
Out[3]:
Having more than one initial state makes the automaton not deterministic.
In [4]:
a = b.expression('a').standard() | b.expression('b').standard()
a
Out[4]:
In [5]:
a.is_deterministic()
Out[5]:
Having a state, even unreachable, with two transitions with the same label makes the automaton not deterministic.
In [6]:
a = vcsn.automaton(''' digraph {
vcsn_context = "lal_char(ab), b"
0 -> 1 [label="a"]
0 -> 2 [label="a"]
} ''')
a
Out[6]:
In [7]:
a.is_deterministic()
Out[7]: