Awali
Another Weighted Automata library
|
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_t > | alphabet () 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_t > | expand_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_t * | copy ()=0 |
Makes a copy of this abstract_context_t. More... | |
Abstract interface representing the weightset and labelset of an automaton, a rational expression or a transducer.
|
virtual |
|
pure virtual |
Adds a letter in the alphabet.
|
pure virtual |
Returns the sum of given weights, as computed by the weightset.
|
pure virtual |
Returns the alphabet.
|
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.
|
pure virtual |
Returns the context::context_description corresponding to this abstract_context_t.
|
pure virtual |
Returns the quotient of given weights, as computed by the weightset.
|
pure virtual |
|
pure virtual |
Expands a label into a list of labels, one label per tape (transducer only).
lab | a proper label for this abstract_context_t |
|
pure virtual |
Converts given string to a label.
|
pure virtual |
Converts string s
to a label of the i
-th tape (transducer only).
|
pure virtual |
Converts given string to a weight.
|
pure virtual |
Converts given string to a weight.
|
pure virtual |
Tests whether let
is a valid letter for this context.
|
pure virtual |
Returns true
if epsilon is allowed as label.
|
pure virtual |
Returns true
if the weightset contains a finite number of elements.
|
pure virtual |
Returns true
if all finitely-generated sub-semiring of the weightset are all finite.
|
pure virtual |
Computes the string-representation of given label.
|
pure virtual |
Gives the name of the labelset.
automaton_t awali::dyn::abstract_context_t::make_automaton | ( | ) |
Builds an empty automaton_t with this context.
ratexp_t awali::dyn::abstract_context_t::make_ratexp | ( | std::string | str, |
bool | fixed_alphabet = true |
||
) |
Builds a ratexp_t from its string-representation.
|
pure virtual |
Returns the product of given weights, as computed by the weightset.
bool awali::dyn::abstract_context_t::operator!= | ( | abstract_context_t const & | other | ) |
bool awali::dyn::abstract_context_t::operator== | ( | abstract_context_t const & | other | ) |
|
pure virtual |
Returns true
if one (neutral multiplicative element of the weightset) should be printed in expressions.
|
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
.
|
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).
|
pure virtual |
Returns the value one, that is, the neutral multiplicative element of the weightset.
|
pure virtual |
Computes the string-representation of given weight.
|
pure virtual |
Gives the value zero, that is, the neutral additive element of the weightset.
|
pure virtual |
Gives the name of the weightset.