This class contains the core of the proper algorithm.
More...
#include <proper.hh>
|
| properer (automaton_t &aut, bool prune=true) |
| Get ready to eliminate spontaneous transitions. More...
|
|
|
static bool | in_situ_remover (automaton_t &aut, bool prune=true) |
| The core of the (backward) epsilon-removal. More...
|
|
static void | proper_here (automaton_t &aut, bool prune=true) |
| Remove the epsilon-transitions of the input The behaviour of this method depends on the star_status of the weight_set: – starrable : always valid, does not throw any exception – tops : the proper algo is directly launched on the input; if it returns false, an exception is launched – non_starrable / absval: is_valid is called before launching the algorithm. More...
|
|
template<typename Aut, bool has_one = labelset_t_of<Aut>::has_one()>
class awali::sttc::internal::properer< Aut, has_one >
This class contains the core of the proper algorithm.
This class is specialized for labels_are_letter automata since all these methods become trivial.
◆ properer()
template<typename Aut , bool has_one = labelset_t_of<Aut>::has_one()>
Get ready to eliminate spontaneous transitions.
- Parameters
-
aut | the automaton in which to remove them |
prune | whether to delete states that become inaccessible |
◆ in_situ_remover()
template<typename Aut , bool has_one = labelset_t_of<Aut>::has_one()>
The core of the (backward) epsilon-removal.
For each state s if s has an epsilon-loop with weight w if w is not starrable, return false else compute ws = star(w) endif remove the loop else ws = 1 endif for each incoming epsilon transition e:p-->s with weight h for each outgoing transition s–a|k-->q add (and not set) transition p– a | h.ws.k --> q endfor if s is final with weight h add final weight h.ws to p endif remove e endfor endfor return true
If the method returns false, aut is corrupted.
- Parameters
-
aut | The automaton in which epsilon-transitions will be removed |
prune | Whether to remove states that become inaccessible. |
- Returns
- true if the proper succeeds, or false otherwise.
◆ proper_here()
template<typename Aut , bool has_one = labelset_t_of<Aut>::has_one()>
Remove the epsilon-transitions of the input The behaviour of this method depends on the star_status of the weight_set: – starrable : always valid, does not throw any exception – tops : the proper algo is directly launched on the input; if it returns false, an exception is launched – non_starrable / absval: is_valid is called before launching the algorithm.
- Parameters
-
aut | The automaton in which epsilon-transitions will be removed |
prune | Whether to remove states that become inaccessible. |
- Exceptions
-
runtime_error | if the input is not valid |
The documentation for this class was generated from the following file:
- /home/marsault/git-client/telecom/awali.git/awali/sttc/algos/proper.hh