Kernel: Python 3
automaton
.difference(
aut
)
automaton
% aut
Restricting an automaton to the words not accepted by the second. In other words:
$$ (\mathcal{A} \% \mathcal{B})(u) = \begin{cases} \mathcal{A}(u) & \text{if $\mathcal{B}(u) \ne 0$} \ 0 & \text{otherwise} \end{cases} $$
Preconditions:
None
Caveat:
The name
difference
is wrong, and will certainly be changed in the future.If the second argument is not Boolean, because we determinize it, the process might loop for ever.
See also:
Examples
In the following example, we map every non empty word on to with the exception of words that are repetitions of or of .
In [1]:
a | b |
In [2]:
In [3]: