In [1]:
import vcsn
The following automaton has useless states: 2 is not accessible, and 3 is not coaccessible.
In [2]:
%%automaton a
context = "lal_char(abc), b"
$ -> 0
0 -> 1 a
1 -> $
2 -> 0 a
1 -> 3 a
In [3]:
a.is_trim()
Out[3]:
Calling trim
returns the same automaton, but without any useless states:
In [4]:
a.trim()
Out[4]:
In [5]:
a.trim().is_trim()
Out[5]:
In [6]:
a.accessible()
Out[6]:
In [7]:
a.accessible().is_trim()
Out[7]:
In [8]:
a.coaccessible()
Out[8]:
In [9]:
a.coaccessible().is_trim()
Out[9]: