Whether the automaton is cycle ambiguous. It means that there exist a state $s$ and a label $x$ such that there is more than one cycle in $s$ labeled with $x$.
Preconditions:
In [1]:
import vcsn
In [2]:
a = vcsn.automaton('''digraph
{
vcsn_context = "lal_char(ab), b"
I0 -> 0
0 -> F0
0 -> 1 [label = "a"]
0 -> 2 [label = "a"]
1 -> 0 [label = "b"]
2 -> 0 [label = "b"]
}''')
a
Out[2]:
At state $0$, the automaton has two cycles "ab" so it is cycle ambiguous.
In [3]:
a.is_cycle_ambiguous()
Out[3]:
In [4]:
a = vcsn.automaton('''digraph
{
vcsn_context = "lal_char(abc), b"
I0 -> 0
0 -> F0
0 -> 1 [label = "a"]
0 -> 2 [label = "a"]
1 -> 0 [label = "b"]
2 -> 0 [label = "c"]
}''')
a
Out[4]:
At state $0$, the automaton has two cycles with different label "ab", "ac" so it is not cycle ambiguous (it is cycle-unambiguous).
In [5]:
a.is_cycle_ambiguous()
Out[5]:
In [6]:
a = vcsn.context("lal_char(abc), b").ladybird(3)
a
Out[6]:
Two cycles in $0$ with label "acac".
In [7]:
a.is_cycle_ambiguous()
Out[7]:
In [8]:
a = vcsn.automaton('''digraph {
vcsn_context = "lal_char(abc), b"
I0 -> 0
0 -> F0
0 -> 1 [label = "a"]
0 -> 2 [label = "a"]
1 -> 0 [label = "b"]
1 -> 3 [label = "b"]
2 -> 1 [label = "c"]
2 -> 2 [label = "b"]
3 -> 1 [label = "c"]
}''')
a
Out[8]:
Two cycles in $0$ with label "babc".
In [9]:
a.is_cycle_ambiguous()
Out[9]:
In [10]:
a = vcsn.automaton('''digraph {
vcsn_context = "lal_char(ab), b"
I0 -> 0
0 -> F0
1 -> 2 [label = "a"]
1 -> 3 [label = "a"]
2 -> 1 [label = "b"]
3 -> 1 [label = "b"]
}''')
a
Out[10]:
In [11]:
a.is_cycle_ambiguous()
Out[11]: