automaton
.proper
(prune
=True
, backward
=False)
¶Create an equivalent automaton without any spontaneous transitions (i.e., transitions labeled by \e
).
Arguments:
prune
whether to remove the states that become inaccessible (or non coaccsessible in the case of forward closure).backward
whether to perform backward closure, or forward closure.Preconditions:
Postconditions:
See also:
References:
import vcsn
The typical use of proper
is to remove spontaneous transitions from a Thompson automaton.
a = vcsn.context('lan_char, b').ratexp('(ab)*').thompson(); a
p = a.proper(); p
p.context()
The closure can be run "forwardly" instead of "backwardly", which the default (sort of a "coproper"):
a.proper(backward = False)
a.proper().is_equivalent(a.proper(backward = False))
States that become inaccessible are removed. To remove this pruning, pass prune = False
to proper
:
%%automaton a
vcsn_context = "lan_char(abc), b"
I -> 0
0 -> 1 a
1 -> F
i -> 0 a
1 -> f \\e
a.proper()
a.proper(prune = False)