Kernel: Python 3
automaton.is_useless
Whether the automaton is useless, i.e., whether it has successful computations. Morally, should be equivalent to whether it accepts no words, but see below.
This is equivalent to testing whether the trim part is empty.
Caveat:
an non-useless automaton might still accept no words (see below).
See also:
Examples
In [1]:
In [2]:
This automaton is not empty, but totally useless:
In [3]:
False
In [4]:
True
If we trim it, then it is empty (which is why it seems that there is no result):
In [5]:
In [6]:
True
Caveat
On some specific structures, automaton.is_useless
returns false although the automaton accepts no words.
In [7]:
In [8]:
False
In [9]: