Awali
Another Weighted Automata library
Public Member Functions | Static Public Member Functions
awali::sttc::internal::properer< Aut, has_one > Class Template Reference

This class contains the core of the proper algorithm. More...

#include <proper.hh>

Public Member Functions

 properer (automaton_t &aut, bool prune=true)
 Get ready to eliminate spontaneous transitions. More...
 

Static Public Member Functions

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ properer()

template<typename Aut , bool has_one = labelset_t_of<Aut>::has_one()>
awali::sttc::internal::properer< Aut, has_one >::properer ( automaton_t &  aut,
bool  prune = true 
)

Get ready to eliminate spontaneous transitions.

Parameters
autthe automaton in which to remove them
prunewhether to delete states that become inaccessible

Member Function Documentation

◆ in_situ_remover()

template<typename Aut , bool has_one = labelset_t_of<Aut>::has_one()>
static bool awali::sttc::internal::properer< Aut, has_one >::in_situ_remover ( automaton_t &  aut,
bool  prune = true 
)
static

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
autThe automaton in which epsilon-transitions will be removed
pruneWhether 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()>
static void awali::sttc::internal::properer< Aut, has_one >::proper_here ( automaton_t &  aut,
bool  prune = true 
)
static

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
autThe automaton in which epsilon-transitions will be removed
pruneWhether to remove states that become inaccessible.
Exceptions
runtime_errorif the input is not valid

The documentation for this class was generated from the following file: