automaton.is_coaccessible

Whether all its states are coaccessible, i.e., its transposed automaton is accessible, in other words, all its states cab reach a final state.

Preconditions:

  • None

See also:

Examples


In [1]:
import vcsn


State 3 of the following automaton cannot reach a final state.


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


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

In [3]:
a.is_coaccessible()


Out[3]:
False

Calling accessible returns a copy of the automaton without non-accessible states:


In [4]:
a.coaccessible()


Out[4]:
%3 I0 0 0 I0->0 F1 1 1 0->1 a 1->F1 2 2 2->0 a

In [5]:
a.coaccessible().is_coaccessible()


Out[5]:
True