Awali
Another Weighted Automata library
Public Member Functions
awali::dyn::abstract_automaton_t Struct Referenceabstract

Abstract interface listing the services provided by automata at the dynamical layer. More...

#include <abstract_automaton.hh>

Public Member Functions

virtual ~abstract_automaton_t ()
 
virtual weight_t add_eps_transition (state_t src, state_t dst)=0
 Adds an epsilon transition going from src to dst. More...
 
virtual weight_t add_eps_transition (state_t src, state_t dst, weight_t weight)=0
 Adds an epsilon transition going from src to dst and weighted by weight. More...
 
virtual weight_t add_final (state_t s, weight_t w)=0
 Adds some final weight of state s to w (useful only for weighted automata). More...
 
virtual weight_t add_initial (state_t s, weight_t w)=0
 Adds some initial weight of state s to w (useful only for weighted automata). More...
 
virtual state_t add_state ()=0
 Adds a new isolated states. More...
 
virtual state_t add_state (std::string name)=0
 Adds a new isolated states with a custom name. More...
 
virtual weight_t add_transition (state_t src, state_t dst, label_t label)=0
 Adds a transition going from src to dst, labelled by label. More...
 
virtual weight_t add_transition (state_t src, state_t dst, label_t label, weight_t weight)=0
 Adds a transition going from src to dst, labelled by label and with weight weight; or adds weight to an existing transition. More...
 
virtual weight_t add_weight (transition_t tr, weight_t w)=0
 Adds w to the weight of transition tr. More...
 
virtual std::vector< label_talphabet () const =0
 Return the alphabet of this abstract_automaton_t. More...
 
virtual bool are_words_allowed () const =0
 Returns true if words are allowed as labels. More...
 
virtual void del_eps_transition (state_t src, state_t dst)=0
 Deletes the epsilon transition going from state src to state dst. More...
 
virtual void del_state (state_t s)=0
 Deletes state s from this abstract_automaton_t. More...
 
virtual void del_transition (state_t src, state_t dst)=0
 Deletes all transitions going from state src to state dst. More...
 
virtual transition_t del_transition (state_t src, state_t dst, label_t label)=0
 Deletes the transition labelled by label and going from state src to state dst. More...
 
virtual void del_transition (transition_t tr)=0
 Deletes transition tr. More...
 
virtual state_t dst_of (transition_t t) const =0
 Returns the destination state of transition t. More...
 
virtual std::vector< state_tfinal_states () const =0
 Returns the final states of this abstract_automaton_t. More...
 
virtual context_t get_context () const =0
 Gets the context of this abstract_automaton_t. More...
 
virtual const std::string & get_desc () const =0
 Return the description of this abstract_automaton_t. More...
 
virtual weight_t get_final_weight (state_t s) const =0
 Gets the final weight of s. More...
 
virtual weight_t get_initial_weight (state_t s) const =0
 Gets the initial weight of s. More...
 
virtual const std::string & get_name () const =0
 Return the name of this abstract_automaton_t. More...
 
virtual state_t get_state_by_name (std::string name) const =0
 Gets one of the state with given name. More...
 
virtual std::string get_state_name (state_t s) const =0
 Gets the name of state s. More...
 
virtual transition_t get_transition (state_t src, state_t dst, label_t label) const =0
 Gets the transition identifier going from state src to state dst and labelled by label. More...
 
virtual bool has_explicit_name (state_t s) const =0
 Returns true if state s has a name set. More...
 
virtual bool has_state (state_t s) const =0
 Returns true if this abstract_automaton_t contains state s. More...
 
virtual bool has_transition (state_t src, state_t dst, label_t label) const =0
 Returns true if there is a transition going from state src to state dst and labelled by label. More...
 
virtual bool has_transition (transition_t t) const =0
 Returns true if a transition with identifier t exists in this abstract_automaton_t. More...
 
virtual history_kind_t history_kind () const =0
 [experimental] Gives the kind of data this abstract_automaton_t comes from. More...
 
virtual std::vector< transition_tin (state_t s, label_t label) const
 Alias to incoming(state_t,label_t)const. More...
 
std::vector< transition_tin (state_t s, options_t opts={}) const
 Alias to incoming. More...
 
virtual std::vector< transition_tincoming (state_t s, label_t label) const =0
 Returns the transitions coming in state s and labelled by label. More...
 
std::vector< transition_tincoming (state_t s, options_t opts={}) const
 Returns the transitions coming in state s. More...
 
virtual std::vector< state_tinitial_states () const =0
 Returns the initial states of this abstract_automaton_t. More...
 
virtual bool is_eps_allowed () const =0
 Returns true if epsilon transitions are allowed. More...
 
virtual bool is_eps_transition (transition_t t) const =0
 Returns true if transition t is an epsilon-transition. More...
 
virtual bool is_final (state_t s) const =0
 Returns true if given state s is final in this abstract_automaton_t. More...
 
virtual bool is_initial (state_t s) const =0
 Returns true if given state s is initial in this abstract_automaton_t. More...
 
virtual bool is_int_automaton () const =0
 Returns true if the labelset of this abstract_automaton_t is Z. More...
 
virtual bool is_transducer () const =0
 Returns true if this abstract_automaton_t has multiple tapes. More...
 
virtual label_t label_of (transition_t t) const =0
 Returns the label of transition t. More...
 
virtual label_t label_of (transition_t t, unsigned i) const =0
 Returns the label of the i-th tape on the transition t (transducers only). More...
 
virtual std::list< label_tlabels_of (transition_t t) const =0
 Returns the label of all tapes on the transition t (transducers only). More...
 
virtual weight_t lmul_weight (transition_t tr, weight_t w)=0
 Multiplies by w on the left the weight of transition tr. More...
 
virtual state_t null_state () const =0
 Returns the phony state, used for instance when no state is found. More...
 
virtual transition_t null_transition () const =0
 Returns the phony transition_t, used for instance when transition is found. More...
 
virtual size_t num_finals () const =0
 Returns the number of final states in this abstract_automaton_t. More...
 
virtual size_t num_initials () const =0
 Returns the number of initial states in this abstract_automaton_t. More...
 
virtual size_t num_states () const =0
 Returns the number of states in this abstract_automaton_t. More...
 
virtual size_t num_transitions () const =0
 Returns the number of transitions in this abstract_automaton_t. More...
 
virtual state_t origin_of (state_t s) const =0
 [experimental] Gives the the origin of state s, in the case where it comes from a single state. More...
 
virtual std::vector< state_torigins_of (state_t s) const =0
 [experimental] Gives the origin of state s, in the case where it comes from a tuple of states. More...
 
std::vector< transition_tout (state_t s, label_t label) const
 Alias to outgoing(state_t, label_t)const. More...
 
std::vector< transition_tout (state_t s, options_t opts={}) const
 Alias to outgoing. More...
 
virtual std::vector< transition_toutgoing (state_t s, label_t label) const =0
 Returns the transitions going out of state s and labelled by label. More...
 
std::vector< transition_toutgoing (state_t s, options_t opts={}) const
 Returns the transitions going out ofstate s. More...
 
virtual std::vector< transition_toutin (state_t src, state_t dst) const =0
 Returns all transitions going from src to dst. More...
 
virtual state_t post () const =0
 Returns the postfinal state. More...
 
virtual state_t pre () const =0
 Returns the preinitial state. More...
 
virtual std::vector< state_tpredecessors (state_t s) const =0
 Returns the sources of all transitions coming in state s. More...
 
virtual std::vector< state_tpredecessors (state_t s, label_t label) const =0
 Returns the sources of all transitions labelled by label that are coming in state s. More...
 
virtual weight_t rmul_weight (transition_t tr, weight_t we)=0
 Multiplies by w on the right the weight of transition tr. More...
 
virtual void set_desc (const std::string &desc)=0
 Sets the description of this abstract_automaton_t. More...
 
virtual transition_t set_eps_transition (state_t src, state_t dst)=0
 Sets an epsilon transition going from src to dst. More...
 
virtual transition_t set_eps_transition (state_t src, state_t dst, weight_t weight)=0
 Sets an epsilon transition going from src to dst and weighted by weight. More...
 
virtual void set_final (state_t s)=0
 Sets state s as final. More...
 
virtual void set_final (state_t s, weight_t w)=0
 Sets final weight of state s to w (useful only for weightset automata). More...
 
virtual void set_initial (state_t s)=0
 Sets state s as initial. More...
 
virtual void set_initial (state_t s, weight_t w)=0
 Sets initial weight of state s to w (useful only for weightset automata). More...
 
virtual void set_name (const std::string &name)=0
 Sets the name of this abstract_automaton_t. More...
 
virtual void set_state_name (state_t s, std::string name)=0
 Sets to name the name of s. More...
 
virtual void set_state_names_from_history ()=0
 [experimental] Sets the name of each state based on its history. More...
 
virtual transition_t set_transition (state_t src, state_t dst, label_t label)=0
 Sets a transition going from src to dst and labelled by label. More...
 
virtual transition_t set_transition (state_t src, state_t dst, label_t label, weight_t weight)=0
 Sets (and possibly replaces) a transition going from src to dst, labelled by label and with weight weight. More...
 
virtual weight_t set_weight (transition_t tr, weight_t w)=0
 Sets to w the weight of transition tr. More...
 
virtual state_t src_of (transition_t t) const =0
 Returns the source state of transition t. More...
 
std::vector< state_tstates (options_t opts={}) const
 Returns the states of this abstract_automaton_t. More...
 
virtual void strip_history ()=0
 Deletes all state history. More...
 
virtual std::vector< state_tsuccessors (state_t s) const =0
 Returns the destinations of all transitions going out of s. More...
 
virtual std::vector< state_tsuccessors (state_t s, label_t label) const =0
 Returns the destinations of all transitions labelled by label going out of s. More...
 
std::vector< transition_ttransitions (options_t opts={}) const
 Returns the transitions in this abstract_automaton_t. More...
 
virtual void unset_final (state_t s)=0
 Sets state s as non-final. More...
 
virtual void unset_initial (state_t s)=0
 Sets state s as non-initial. More...
 
virtual weight_t weight_of (transition_t t) const =0
 Returns the weight of transition t. More...
 

Detailed Description

Abstract interface listing the services provided by automata at the dynamical layer.

Difference between adding and setting transitions.

First, note that there is no difference if the automaton is Booolean (that is, if it as "classical" automaton).

In the following, let us assume that the automaton is weighted over a semiring (W,+,x).

Let src and dst be two states and lbl be a label. (lbl might be epsilon if the automaton allows it, or a tuple in the case of transducers.) In Awali, there is at most one transitions tr going from src to dst and labelled by lbl. In addition, This transition also bears weight wght.

When modifying the transition going from src to dst and labelled by lbl, one has to decide what to do with wght.

If the automaton features no transition going from src to dst and labelled by lbl, everything behaves as if it had such a transition weighted by zero (in fact, the neutral element for +). In this case both functions above do the same thing.

Constructor & Destructor Documentation

◆ ~abstract_automaton_t()

virtual awali::dyn::abstract_automaton_t::~abstract_automaton_t ( )
virtual

Member Function Documentation

◆ add_eps_transition() [1/2]

virtual weight_t awali::dyn::abstract_automaton_t::add_eps_transition ( state_t  src,
state_t  dst 
)
pure virtual

Adds an epsilon transition going from src to dst.

Precondition
This abstract_automaton_t needs to allow epsilon transitions. (See is_eps_allowed).
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ add_eps_transition() [2/2]

virtual weight_t awali::dyn::abstract_automaton_t::add_eps_transition ( state_t  src,
state_t  dst,
weight_t  weight 
)
pure virtual

Adds an epsilon transition going from src to dst and weighted by weight.

Precondition
This abstract_automaton_t needs to allow epsilon transitions. (See is_eps_allowed).
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ add_final()

virtual weight_t awali::dyn::abstract_automaton_t::add_final ( state_t  s,
weight_t  w 
)
pure virtual

Adds some final weight of state s to w (useful only for weighted automata).

Let (W,+,x) be the weightset of this abstract_automaton_t. A call to this method makes the final weight of s to become old+w, where old is the final weight of s prior to the call.

Returns
the new initial weight of s

◆ add_initial()

virtual weight_t awali::dyn::abstract_automaton_t::add_initial ( state_t  s,
weight_t  w 
)
pure virtual

Adds some initial weight of state s to w (useful only for weighted automata).

Let (W,+,x) be the weightset of this abstract_automaton_t. A call to this method makes the initial weight of s to become old+w, where old is the initial weight of s prior to the call.

Returns
the new initial weight of s

◆ add_state() [1/2]

virtual state_t awali::dyn::abstract_automaton_t::add_state ( )
pure virtual

Adds a new isolated states.

This method is not equivalent to calling add_state(std::string) with an empty string as parameter. This method leaves undefined the name of the new state.

◆ add_state() [2/2]

virtual state_t awali::dyn::abstract_automaton_t::add_state ( std::string  name)
pure virtual

Adds a new isolated states with a custom name.

◆ add_transition() [1/2]

virtual weight_t awali::dyn::abstract_automaton_t::add_transition ( state_t  src,
state_t  dst,
label_t  label 
)
pure virtual

Adds a transition going from src to dst, labelled by label.

If this abstract_automaton_t is weighted over (W,+,x), this is the same as add_transition(src,dst,label,one) where one is the neutral element for x.

Returns
The weight of the transition going from src to dst and labelled by label.
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ add_transition() [2/2]

virtual weight_t awali::dyn::abstract_automaton_t::add_transition ( state_t  src,
state_t  dst,
label_t  label,
weight_t  weight 
)
pure virtual

Adds a transition going from src to dst, labelled by label and with weight weight; or adds weight to an existing transition.

Returns
The weight of the transition going from src to dst and labelled by label.
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ add_weight()

virtual weight_t awali::dyn::abstract_automaton_t::add_weight ( transition_t  tr,
weight_t  w 
)
pure virtual

Adds w to the weight of transition tr.

◆ alphabet()

virtual std::vector<label_t> awali::dyn::abstract_automaton_t::alphabet ( ) const
pure virtual

Return the alphabet of this abstract_automaton_t.

◆ are_words_allowed()

virtual bool awali::dyn::abstract_automaton_t::are_words_allowed ( ) const
pure virtual

Returns true if words are allowed as labels.

◆ del_eps_transition()

virtual void awali::dyn::abstract_automaton_t::del_eps_transition ( state_t  src,
state_t  dst 
)
pure virtual

Deletes the epsilon transition going from state src to state dst.

◆ del_state()

virtual void awali::dyn::abstract_automaton_t::del_state ( state_t  s)
pure virtual

Deletes state s from this abstract_automaton_t.

◆ del_transition() [1/3]

virtual void awali::dyn::abstract_automaton_t::del_transition ( state_t  src,
state_t  dst 
)
pure virtual

Deletes all transitions going from state src to state dst.

◆ del_transition() [2/3]

virtual transition_t awali::dyn::abstract_automaton_t::del_transition ( state_t  src,
state_t  dst,
label_t  label 
)
pure virtual

Deletes the transition labelled by label and going from state src to state dst.

◆ del_transition() [3/3]

virtual void awali::dyn::abstract_automaton_t::del_transition ( transition_t  tr)
pure virtual

Deletes transition tr.

◆ dst_of()

virtual state_t awali::dyn::abstract_automaton_t::dst_of ( transition_t  t) const
pure virtual

Returns the destination state of transition t.

◆ final_states()

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::final_states ( ) const
pure virtual

Returns the final states of this abstract_automaton_t.

◆ get_context()

virtual context_t awali::dyn::abstract_automaton_t::get_context ( ) const
pure virtual

Gets the context of this abstract_automaton_t.

◆ get_desc()

virtual const std::string& awali::dyn::abstract_automaton_t::get_desc ( ) const
pure virtual

Return the description of this abstract_automaton_t.

See also
set_desc

◆ get_final_weight()

virtual weight_t awali::dyn::abstract_automaton_t::get_final_weight ( state_t  s) const
pure virtual

Gets the final weight of s.

◆ get_initial_weight()

virtual weight_t awali::dyn::abstract_automaton_t::get_initial_weight ( state_t  s) const
pure virtual

Gets the initial weight of s.

◆ get_name()

virtual const std::string& awali::dyn::abstract_automaton_t::get_name ( ) const
pure virtual

Return the name of this abstract_automaton_t.

See also
set_name

◆ get_state_by_name()

virtual state_t awali::dyn::abstract_automaton_t::get_state_by_name ( std::string  name) const
pure virtual

Gets one of the state with given name.

If there is no state with given name, a phony state is returned. Use method has_state to test if a state is phony or not.

◆ get_state_name()

virtual std::string awali::dyn::abstract_automaton_t::get_state_name ( state_t  s) const
pure virtual

Gets the name of state s.

If the state has no name, one is generated (but not registered).

See also
has_explicit_name(state_t)

◆ get_transition()

virtual transition_t awali::dyn::abstract_automaton_t::get_transition ( state_t  src,
state_t  dst,
label_t  label 
) const
pure virtual

Gets the transition identifier going from state src to state dst and labelled by label.

Returns
A transition id if there is such a transition or a phony transition id otherwise. Use has_transition or null_transition to know if this id is phony or not.

◆ has_explicit_name()

virtual bool awali::dyn::abstract_automaton_t::has_explicit_name ( state_t  s) const
pure virtual

Returns true if state s has a name set.

◆ has_state()

virtual bool awali::dyn::abstract_automaton_t::has_state ( state_t  s) const
pure virtual

Returns true if this abstract_automaton_t contains state s.

Parameters
s

◆ has_transition() [1/2]

virtual bool awali::dyn::abstract_automaton_t::has_transition ( state_t  src,
state_t  dst,
label_t  label 
) const
pure virtual

Returns true if there is a transition going from state src to state dst and labelled by label.

◆ has_transition() [2/2]

virtual bool awali::dyn::abstract_automaton_t::has_transition ( transition_t  t) const
pure virtual

Returns true if a transition with identifier t exists in this abstract_automaton_t.

◆ history_kind()

virtual history_kind_t awali::dyn::abstract_automaton_t::history_kind ( ) const
pure virtual

[experimental] Gives the kind of data this abstract_automaton_t comes from.

Attention
This feature is experimental: its name and specifications might change in the future.

◆ in() [1/2]

virtual std::vector<transition_t> awali::dyn::abstract_automaton_t::in ( state_t  s,
label_t  label 
) const
virtual

◆ in() [2/2]

std::vector<transition_t> awali::dyn::abstract_automaton_t::in ( state_t  s,
options_t  opts = {} 
) const

Alias to incoming.

◆ incoming() [1/2]

virtual std::vector<transition_t> awali::dyn::abstract_automaton_t::incoming ( state_t  s,
label_t  label 
) const
pure virtual

Returns the transitions coming in state s and labelled by label.

◆ incoming() [2/2]

std::vector<transition_t> awali::dyn::abstract_automaton_t::incoming ( state_t  s,
options_t  opts = {} 
) const

Returns the transitions coming in state s.

Parameters
s
optsA set of options; only PREPOST_PARADIGM is meaningful.
Returns
The transitions in this automaton. If PREPOST_PARADIGM is true (default is false), the initial transitions coming in s are also returned.

◆ initial_states()

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::initial_states ( ) const
pure virtual

Returns the initial states of this abstract_automaton_t.

◆ is_eps_allowed()

virtual bool awali::dyn::abstract_automaton_t::is_eps_allowed ( ) const
pure virtual

Returns true if epsilon transitions are allowed.

◆ is_eps_transition()

virtual bool awali::dyn::abstract_automaton_t::is_eps_transition ( transition_t  t) const
pure virtual

Returns true if transition t is an epsilon-transition.

◆ is_final()

virtual bool awali::dyn::abstract_automaton_t::is_final ( state_t  s) const
pure virtual

Returns true if given state s is final in this abstract_automaton_t.

If this abstract_automaton_t is weighted over a weightset (W,+,.), it returns true if the final weight associated with s is not the neutral element for +.

◆ is_initial()

virtual bool awali::dyn::abstract_automaton_t::is_initial ( state_t  s) const
pure virtual

Returns true if given state s is initial in this abstract_automaton_t.

If this abstract_automaton_t is weighted over a weightset (W,+,.), it returns true if the initial weight associated with s is not the neutral element for +.

◆ is_int_automaton()

virtual bool awali::dyn::abstract_automaton_t::is_int_automaton ( ) const
pure virtual

Returns true if the labelset of this abstract_automaton_t is Z.

◆ is_transducer()

virtual bool awali::dyn::abstract_automaton_t::is_transducer ( ) const
pure virtual

Returns true if this abstract_automaton_t has multiple tapes.

◆ label_of() [1/2]

virtual label_t awali::dyn::abstract_automaton_t::label_of ( transition_t  t) const
pure virtual

Returns the label of transition t.

◆ label_of() [2/2]

virtual label_t awali::dyn::abstract_automaton_t::label_of ( transition_t  t,
unsigned  i 
) const
pure virtual

Returns the label of the i-th tape on the transition t (transducers only).

◆ labels_of()

virtual std::list<label_t> awali::dyn::abstract_automaton_t::labels_of ( transition_t  t) const
pure virtual

Returns the label of all tapes on the transition t (transducers only).

◆ lmul_weight()

virtual weight_t awali::dyn::abstract_automaton_t::lmul_weight ( transition_t  tr,
weight_t  w 
)
pure virtual

Multiplies by w on the left the weight of transition tr.

◆ null_state()

virtual state_t awali::dyn::abstract_automaton_t::null_state ( ) const
pure virtual

Returns the phony state, used for instance when no state is found.

◆ null_transition()

virtual transition_t awali::dyn::abstract_automaton_t::null_transition ( ) const
pure virtual

Returns the phony transition_t, used for instance when transition is found.

◆ num_finals()

virtual size_t awali::dyn::abstract_automaton_t::num_finals ( ) const
pure virtual

Returns the number of final states in this abstract_automaton_t.

◆ num_initials()

virtual size_t awali::dyn::abstract_automaton_t::num_initials ( ) const
pure virtual

Returns the number of initial states in this abstract_automaton_t.

◆ num_states()

virtual size_t awali::dyn::abstract_automaton_t::num_states ( ) const
pure virtual

Returns the number of states in this abstract_automaton_t.

◆ num_transitions()

virtual size_t awali::dyn::abstract_automaton_t::num_transitions ( ) const
pure virtual

Returns the number of transitions in this abstract_automaton_t.

◆ origin_of()

virtual state_t awali::dyn::abstract_automaton_t::origin_of ( state_t  s) const
pure virtual

[experimental] Gives the the origin of state s, in the case where it comes from a single state.

Attention
This function assumes without check that the history kind is history_kind_t::SINGLE. Use with caution.
This feature is experimental: its name and specifications might change in the future.

◆ origins_of()

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::origins_of ( state_t  s) const
pure virtual

[experimental] Gives the origin of state s, in the case where it comes from a tuple of states.

Attention
This function assumes without check that the history kind is history_kind_t::TUPLE. Use with caution.
This feature is experimental: its name and specifications might change in the future.

◆ out() [1/2]

std::vector<transition_t> awali::dyn::abstract_automaton_t::out ( state_t  s,
label_t  label 
) const

◆ out() [2/2]

std::vector<transition_t> awali::dyn::abstract_automaton_t::out ( state_t  s,
options_t  opts = {} 
) const

Alias to outgoing.

◆ outgoing() [1/2]

virtual std::vector<transition_t> awali::dyn::abstract_automaton_t::outgoing ( state_t  s,
label_t  label 
) const
pure virtual

Returns the transitions going out of state s and labelled by label.

◆ outgoing() [2/2]

std::vector<transition_t> awali::dyn::abstract_automaton_t::outgoing ( state_t  s,
options_t  opts = {} 
) const

Returns the transitions going out ofstate s.

Parameters
s
optsA set of options; only PREPOST_PARADIGM is meaningful.
Returns
The transitions in this automaton. If PREPOST_PARADIGM is true (default is false), the initial transitions coming in s are also returned.

◆ outin()

virtual std::vector<transition_t> awali::dyn::abstract_automaton_t::outin ( state_t  src,
state_t  dst 
) const
pure virtual

Returns all transitions going from src to dst.

◆ post()

virtual state_t awali::dyn::abstract_automaton_t::post ( ) const
pure virtual

Returns the postfinal state.

See PREPOST_PARADIGM for details.

◆ pre()

virtual state_t awali::dyn::abstract_automaton_t::pre ( ) const
pure virtual

Returns the preinitial state.

See PREPOST_PARADIGM for details.

◆ predecessors() [1/2]

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::predecessors ( state_t  s) const
pure virtual

Returns the sources of all transitions coming in state s.

◆ predecessors() [2/2]

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::predecessors ( state_t  s,
label_t  label 
) const
pure virtual

Returns the sources of all transitions labelled by label that are coming in state s.

◆ rmul_weight()

virtual weight_t awali::dyn::abstract_automaton_t::rmul_weight ( transition_t  tr,
weight_t  we 
)
pure virtual

Multiplies by w on the right the weight of transition tr.

◆ set_desc()

virtual void awali::dyn::abstract_automaton_t::set_desc ( const std::string &  desc)
pure virtual

Sets the description of this abstract_automaton_t.

When an automaton is output in JSON format, the description is written in the metadata section.

Parameters
descNew description of this abstract_automaton_t.

◆ set_eps_transition() [1/2]

virtual transition_t awali::dyn::abstract_automaton_t::set_eps_transition ( state_t  src,
state_t  dst 
)
pure virtual

Sets an epsilon transition going from src to dst.

Precondition
This abstract_automaton_t needs to allow epsilon transitions. (See is_eps_allowed).
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ set_eps_transition() [2/2]

virtual transition_t awali::dyn::abstract_automaton_t::set_eps_transition ( state_t  src,
state_t  dst,
weight_t  weight 
)
pure virtual

Sets an epsilon transition going from src to dst and weighted by weight.

Precondition
This abstract_automaton_t needs to allow epsilon transitions. (See is_eps_allowed).
See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ set_final() [1/2]

virtual void awali::dyn::abstract_automaton_t::set_final ( state_t  s)
pure virtual

Sets state s as final.

If this abstract_automaton_t is weighted over (W,+,x), this method sets the final weight of s to the neutral element for x.

◆ set_final() [2/2]

virtual void awali::dyn::abstract_automaton_t::set_final ( state_t  s,
weight_t  w 
)
pure virtual

Sets final weight of state s to w (useful only for weightset automata).

◆ set_initial() [1/2]

virtual void awali::dyn::abstract_automaton_t::set_initial ( state_t  s)
pure virtual

Sets state s as initial.

If this abstract_automaton_t is weighted over (W,+,x), this method sets the initial weight of s to the neutral element for x.

◆ set_initial() [2/2]

virtual void awali::dyn::abstract_automaton_t::set_initial ( state_t  s,
weight_t  w 
)
pure virtual

Sets initial weight of state s to w (useful only for weightset automata).

◆ set_name()

virtual void awali::dyn::abstract_automaton_t::set_name ( const std::string &  name)
pure virtual

Sets the name of this abstract_automaton_t.

  • The name of an automaton is meant to be used as filename so it should not contain special characters (but no check is done to enforce that).
  • When an automaton is output in JSON format, the name is written in the metadata section.
  • Name is sometimes used in error message.
  • The name might be automatically generated when applying algorithm.
Parameters
nameThe new name of this abstract_automaton_t.

◆ set_state_name()

virtual void awali::dyn::abstract_automaton_t::set_state_name ( state_t  s,
std::string  name 
)
pure virtual

Sets to name the name of s.

◆ set_state_names_from_history()

virtual void awali::dyn::abstract_automaton_t::set_state_names_from_history ( )
pure virtual

[experimental] Sets the name of each state based on its history.

Attention
This feature is experimental: its name and specifications might change in the future.

◆ set_transition() [1/2]

virtual transition_t awali::dyn::abstract_automaton_t::set_transition ( state_t  src,
state_t  dst,
label_t  label 
)
pure virtual

Sets a transition going from src to dst and labelled by label.

If this abstract_automaton_t is weighted over (W,+,x), this is the same as set_transition(src,dst,label,one) where one is the neutral element for x.

See also
The section of the detailed description that describes the difference between setting and adding a transition in a weighted automaton.

◆ set_transition() [2/2]

virtual transition_t awali::dyn::abstract_automaton_t::set_transition ( state_t  src,
state_t  dst,
label_t  label,
weight_t  weight 
)
pure virtual

Sets (and possibly replaces) a transition going from src to dst, labelled by label and with weight weight.

If there is, prior to the call to this method, a transition going from src to dst and labelled by label, its weight is overriden by weight. Use add_transition if you want to add the weights instead.

Returns
Transition corresponding to the transition set.
See also
The respective section in the detailed description of abstract_automaton_t for explanation of a difference with add_transition(state_t,state_t,label_t, weight_t);

◆ set_weight()

virtual weight_t awali::dyn::abstract_automaton_t::set_weight ( transition_t  tr,
weight_t  w 
)
pure virtual

Sets to w the weight of transition tr.

◆ src_of()

virtual state_t awali::dyn::abstract_automaton_t::src_of ( transition_t  t) const
pure virtual

Returns the source state of transition t.

◆ states()

std::vector<state_t> awali::dyn::abstract_automaton_t::states ( options_t  opts = {}) const

Returns the states of this abstract_automaton_t.

Parameters
optsA set of options; Only PREPOST_PARADIGM is meaningful.
Returns
The states in this automaton. If PREPOST_PARADIGM is true (defaults is false), the "preinitial" and postfinal states are also returned.

◆ strip_history()

virtual void awali::dyn::abstract_automaton_t::strip_history ( )
pure virtual

Deletes all state history.

◆ successors() [1/2]

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::successors ( state_t  s) const
pure virtual

Returns the destinations of all transitions going out of s.

◆ successors() [2/2]

virtual std::vector<state_t> awali::dyn::abstract_automaton_t::successors ( state_t  s,
label_t  label 
) const
pure virtual

Returns the destinations of all transitions labelled by label going out of s.

◆ transitions()

std::vector<transition_t> awali::dyn::abstract_automaton_t::transitions ( options_t  opts = {}) const

Returns the transitions in this abstract_automaton_t.

Parameters
optsA set of options; only PREPOST_PARADIGM is meaningful.
Returns
The transitions in this automaton. If PREPOST_PARADIGM is true (default is false), the initial and final transitions are returned.

◆ unset_final()

virtual void awali::dyn::abstract_automaton_t::unset_final ( state_t  s)
pure virtual

Sets state s as non-final.

If this abstract_automaton_t is weighted over (W,+,x), this method sets the final weight of s to the neutral element for +.

◆ unset_initial()

virtual void awali::dyn::abstract_automaton_t::unset_initial ( state_t  s)
pure virtual

Sets state s as non-initial.

If this abstract_automaton_t is weighted over (W,+,x), this method sets the initial weight of s to the neutral element for +.

◆ weight_of()

virtual weight_t awali::dyn::abstract_automaton_t::weight_of ( transition_t  t) const
pure virtual

Returns the weight of transition t.


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