Create a new automaton from the useful part of the input, i.e., the subautomaton whose states both accessible (can be reached from a initial state) and coaccessible (can reach a final state).
Preconditions:
Postconditions:
See also:
import vcsn
The following automaton has states that cannot be reach any final(s) states:
%%automaton -s a
context = "lal_char(abc), b"
$ -> 0
0 -> 1 a
1 -> $
2 -> 0 a
1 -> 3 a
a.is_trim()
Calling trim
returns the same automaton, but without any useless states:
a.trim()
a.trim().is_trim()