Awali
Another Weighted Automata library
Public Member Functions | Protected Member Functions
awali::dyn::abstract_context_t Struct Referenceabstract

Abstract interface representing the weightset and labelset of an automaton, a rational expression or a transducer. More...

#include <abstract_context.hh>

Public Member Functions

virtual ~abstract_context_t ()
 
virtual void add_letter (label_t let)=0
 Adds a letter in the alphabet. More...
 
virtual weight_t add_weights (weight_t l, weight_t r) const =0
 Returns the sum of given weights, as computed by the weightset. More...
 
virtual std::vector< any_talphabet () const =0
 Returns the alphabet. More...
 
virtual context::context_description description () const =0
 Returns the context::context_description corresponding to this abstract_context_t. More...
 
virtual weight_t div_weights (weight_t l, weight_t r) const =0
 Returns the quotient of given weights, as computed by the weightset. More...
 
virtual label_t epsilon () const =0
 
virtual std::list< any_texpand_label (label_t lab) const =0
 Expands a label into a list of labels, one label per tape (transducer only). More...
 
virtual label_t get_label (std::string str) const =0
 Converts given string to a label. More...
 
virtual label_t get_label (std::string str, size_t i) const =0
 Converts string s to a label of the i-th tape (transducer only). More...
 
virtual weight_t get_weight (std::string str) const =0
 Converts given string to a weight. More...
 
virtual weight_t get_word (std::string str) const =0
 Converts given string to a weight. More...
 
virtual bool has_letter (label_t let) const =0
 Tests whether let is a valid letter for this context. More...
 
virtual bool is_eps_allowed () const =0
 Returns true if epsilon is allowed as label. More...
 
virtual bool is_finite_weightset () const =0
 Returns true if the weightset contains a finite number of elements. More...
 
virtual bool is_locally_finite_weightset () const =0
 Returns true if all finitely-generated sub-semiring of the weightset are all finite. More...
 
virtual std::string label_to_string (label_t w) const =0
 Computes the string-representation of given label. More...
 
virtual std::string labelset_name () const =0
 Gives the name of the labelset. More...
 
automaton_t make_automaton ()
 Builds an empty automaton_t with this context. More...
 
ratexp_t make_ratexp (std::string str, bool fixed_alphabet=true)
 Builds a ratexp_t from its string-representation. More...
 
virtual weight_t mul_weights (weight_t l, weight_t r) const =0
 Returns the product of given weights, as computed by the weightset. More...
 
bool operator!= (abstract_context_t const &other)
 
bool operator== (abstract_context_t const &other)
 
virtual bool show_one () const =0
 Returns true if one (neutral multiplicative element of the weightset) should be printed in expressions. More...
 
virtual std::string sname () const =0
 Returns the compile-time internal name of the context. More...
 
virtual std::string vname (bool full=true) const =0
 Returns the runtime internal name of the context. More...
 
virtual weight_t weight_one () const =0
 Returns the value one, that is, the neutral multiplicative element of the weightset. More...
 
virtual std::string weight_to_string (weight_t w) const =0
 Computes the string-representation of given weight. More...
 
virtual weight_t weight_zero () const =0
 Gives the value zero, that is, the neutral additive element of the weightset. More...
 
virtual std::string weightset_name (std::string format="text") const =0
 Gives the name of the weightset. More...
 

Protected Member Functions

virtual abstract_context_tcopy ()=0
 Makes a copy of this abstract_context_t. More...
 

Detailed Description

Abstract interface representing the weightset and labelset of an automaton, a rational expression or a transducer.

Constructor & Destructor Documentation

◆ ~abstract_context_t()

virtual awali::dyn::abstract_context_t::~abstract_context_t ( )
virtual

Member Function Documentation

◆ add_letter()

virtual void awali::dyn::abstract_context_t::add_letter ( label_t  let)
pure virtual

Adds a letter in the alphabet.

◆ add_weights()

virtual weight_t awali::dyn::abstract_context_t::add_weights ( weight_t  l,
weight_t  r 
) const
pure virtual

Returns the sum of given weights, as computed by the weightset.

◆ alphabet()

virtual std::vector<any_t> awali::dyn::abstract_context_t::alphabet ( ) const
pure virtual

Returns the alphabet.

◆ copy()

virtual abstract_context_t* awali::dyn::abstract_context_t::copy ( )
protectedpure virtual

Makes a copy of this abstract_context_t.

This function should generally not be used because the type abstract_context_t is not designed to be manipulated directly : use context_t and its default copy constructor instead.

This function exists only to be able to build a context_t from a abstract_context_t, and then call dyn-level functions without breaking pointer ownership.

◆ description()

virtual context::context_description awali::dyn::abstract_context_t::description ( ) const
pure virtual

Returns the context::context_description corresponding to this abstract_context_t.

◆ div_weights()

virtual weight_t awali::dyn::abstract_context_t::div_weights ( weight_t  l,
weight_t  r 
) const
pure virtual

Returns the quotient of given weights, as computed by the weightset.

◆ epsilon()

virtual label_t awali::dyn::abstract_context_t::epsilon ( ) const
pure virtual

◆ expand_label()

virtual std::list<any_t> awali::dyn::abstract_context_t::expand_label ( label_t  lab) const
pure virtual

Expands a label into a list of labels, one label per tape (transducer only).

Parameters
laba proper label for this abstract_context_t
Returns
A list of label from the sub-labelsets of the labelset of this abstract_context_t

◆ get_label() [1/2]

virtual label_t awali::dyn::abstract_context_t::get_label ( std::string  str) const
pure virtual

Converts given string to a label.

◆ get_label() [2/2]

virtual label_t awali::dyn::abstract_context_t::get_label ( std::string  str,
size_t  i 
) const
pure virtual

Converts string s to a label of the i-th tape (transducer only).

◆ get_weight()

virtual weight_t awali::dyn::abstract_context_t::get_weight ( std::string  str) const
pure virtual

Converts given string to a weight.

◆ get_word()

virtual weight_t awali::dyn::abstract_context_t::get_word ( std::string  str) const
pure virtual

Converts given string to a weight.

◆ has_letter()

virtual bool awali::dyn::abstract_context_t::has_letter ( label_t  let) const
pure virtual

Tests whether let is a valid letter for this context.

◆ is_eps_allowed()

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

Returns true if epsilon is allowed as label.

◆ is_finite_weightset()

virtual bool awali::dyn::abstract_context_t::is_finite_weightset ( ) const
pure virtual

Returns true if the weightset contains a finite number of elements.

◆ is_locally_finite_weightset()

virtual bool awali::dyn::abstract_context_t::is_locally_finite_weightset ( ) const
pure virtual

Returns true if all finitely-generated sub-semiring of the weightset are all finite.

◆ label_to_string()

virtual std::string awali::dyn::abstract_context_t::label_to_string ( label_t  w) const
pure virtual

Computes the string-representation of given label.

◆ labelset_name()

virtual std::string awali::dyn::abstract_context_t::labelset_name ( ) const
pure virtual

Gives the name of the labelset.

◆ make_automaton()

automaton_t awali::dyn::abstract_context_t::make_automaton ( )

Builds an empty automaton_t with this context.

◆ make_ratexp()

ratexp_t awali::dyn::abstract_context_t::make_ratexp ( std::string  str,
bool  fixed_alphabet = true 
)

Builds a ratexp_t from its string-representation.

◆ mul_weights()

virtual weight_t awali::dyn::abstract_context_t::mul_weights ( weight_t  l,
weight_t  r 
) const
pure virtual

Returns the product of given weights, as computed by the weightset.

◆ operator!=()

bool awali::dyn::abstract_context_t::operator!= ( abstract_context_t const &  other)

◆ operator==()

bool awali::dyn::abstract_context_t::operator== ( abstract_context_t const &  other)

◆ show_one()

virtual bool awali::dyn::abstract_context_t::show_one ( ) const
pure virtual

Returns true if one (neutral multiplicative element of the weightset) should be printed in expressions.

◆ sname()

virtual std::string awali::dyn::abstract_context_t::sname ( ) const
pure virtual

Returns the compile-time internal name of the context.

Two automaton_t (resp. ratexp_t, resp. transducer_t) wraps static objects of the exact same type if and only if with contexts that have equal sname.

◆ vname()

virtual std::string awali::dyn::abstract_context_t::vname ( bool  full = true) const
pure virtual

Returns the runtime internal name of the context.

The difference with sname is that the vname contains additional information that are not part of the static type (for instance the alphabet in the case of automata).

◆ weight_one()

virtual weight_t awali::dyn::abstract_context_t::weight_one ( ) const
pure virtual

Returns the value one, that is, the neutral multiplicative element of the weightset.

◆ weight_to_string()

virtual std::string awali::dyn::abstract_context_t::weight_to_string ( weight_t  w) const
pure virtual

Computes the string-representation of given weight.

◆ weight_zero()

virtual weight_t awali::dyn::abstract_context_t::weight_zero ( ) const
pure virtual

Gives the value zero, that is, the neutral additive element of the weightset.

◆ weightset_name()

virtual std::string awali::dyn::abstract_context_t::weightset_name ( std::string  format = "text") const
pure virtual

Gives the name of the weightset.


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