Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45894
Kernel: Python 3

automaton.is_cycle_ambiguous

Whether the automaton is cycle ambiguous, i.e., there exist a state ss and a label xx such that there is more than one cycle in ss labeled with xx.

Preconditions:

  • the labelset is free.

Examples

import vcsn
%%automaton -s a context = "lal_char, b" $ -> 0 0 -> $ 0 -> 1 a 0 -> 2 a 1 -> 0 b 2 -> 0 b
Image in a Jupyter notebook

At state 00, the automaton has two cycles "ab" so it is cycle ambiguous.

a.is_cycle_ambiguous()
True
%%automaton -s a context = "lal_char, b" $ -> 0 0 -> $ 0 -> 1 a 0 -> 2 a 1 -> 0 b 2 -> 0 c
Image in a Jupyter notebook

At state 00, the automaton has two cycles with different label "ab", "ac" so it is not cycle ambiguous (it is cycle-unambiguous).

a.is_cycle_ambiguous()
False
a = vcsn.context("lal_char(abc), b").ladybird(3) a
Image in a Jupyter notebook

Two cycles in 00 with label "acac".

a.is_cycle_ambiguous()
True
%%automaton -s a vcsn_context = "lal_char, b" $ -> 0 0 -> $ 0 -> 1 a 0 -> 2 a 1 -> 0 b 1 -> 3 b 2 -> 1 c 2 -> 2 b 3 -> 1 c
Image in a Jupyter notebook

Two cycles in 00 with label "babc".

a.is_cycle_ambiguous()
True
%%automaton -s a $ -> 0 0 -> $ 1 -> 2 a 1 -> 3 a 2 -> 1 b 3 -> 1 b
Image in a Jupyter notebook
a.is_cycle_ambiguous()
True