Kernel: Python 3
automaton.filter(states)
Return a subautomaton such that their states are in the input states set.
Postcondition:
The result automaton is subautomaton of input automaton.
The states of automaton are in the input states set.
See also:
Examples
In [1]:
In [2]:
To keep only states :
In [3]:
"Keeping" a non-existing state is not an error:
In [4]:
Calls to filter
can be filtered:
In [5]:
but it is less efficient than filtering on the intersection. This is on purpose: the outter automaton has a view on the filtered automaton.
In [6]:
filter_automaton<filter_automaton<mutable_automaton<letterset<char_letters(a)>, b>>>
filter_automaton<mutable_automaton<letterset<char_letters(a)>, b>>
True
We can filter a transposed automaton:
In [7]:
In [8]: