Kernel: Python 3
automaton.trim
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:
None
Postconditions:
Result.is_accessible
Result.is_coaccessible
Result.is_trim
See also:
Examples
In [1]:
The following automaton has states that cannot be reach any final(s) states:
In [2]:
In [3]:
False
Calling trim
returns the same automaton, but without any useless states:
In [4]:
In [5]:
True