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

automaton.is_trim

Whether all its states are useful, i.e., accessible and coaccessible.

Preconditions:

  • None

Postconditions:

  • Result = aut.is_accessible and aut.is_coaccessible

See also:

Examples

import vcsn

The following automaton has useless states: 2 is not accessible, and 3 is not coaccessible.

%%automaton a context = "lal_char(abc), b" $ -> 0 0 -> 1 a 1 -> $ 2 -> 0 a 1 -> 3 a
Image in a Jupyter notebook
a.is_trim()
False

Calling trim returns the same automaton, but without any useless states:

a.trim()
Image in a Jupyter notebook
a.trim().is_trim()
True
a.accessible()
Image in a Jupyter notebook
a.accessible().is_trim()
False
a.coaccessible()
Image in a Jupyter notebook
a.coaccessible().is_trim()
False