17 #ifndef DYN_ABSTRACT_CONTEXT_HH
18 #define DYN_ABSTRACT_CONTEXT_HH
29 namespace awali {
namespace dyn {
44 virtual std::string
sname()
const =0;
52 virtual std::string
vname(
bool full =
true)
const =0;
61 virtual std::vector<any_t>
alphabet()
const = 0;
153 return !(*
this == other);
An automaton_t is essentially a shared pointer to an abstract_automaton_t, but also contains static f...
Definition: automaton.hh:93
Main class for representing rational expresson at the dynamical layer.
Definition: ratexp.hh:66
std::shared_ptr< context_description_impl > context_description
Definition: description_types.hh:31
auto format(const ValueSet &vs, const typename ValueSet::value_t &v, Args &&... args) -> std::string
Format v via vs.print.
Definition: stream.hh:109
static const std::string full
Completely version of Awali as a std::string.
Definition: version.hh:42
Main namespace of Awali.
Definition: ato.hh:22
Abstract interface representing the weightset and labelset of an automaton, a rational expression or ...
Definition: abstract_context.hh:37
virtual bool show_one() const =0
Returns true if one (neutral multiplicative element of the weightset) should be printed in expression...
virtual bool has_letter(label_t let) const =0
Tests whether let is a valid letter for this context.
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).
virtual void add_letter(label_t let)=0
Adds a letter in the alphabet.
ratexp_t make_ratexp(std::string str, bool fixed_alphabet=true)
Builds a ratexp_t from its string-representation.
virtual std::string label_to_string(label_t w) const =0
Computes the string-representation of given label.
virtual weight_t get_word(std::string str) const =0
Converts given string to a weight.
virtual std::string weightset_name(std::string format="text") const =0
Gives the name of the weightset.
virtual std::vector< any_t > alphabet() const =0
Returns the alphabet.
virtual abstract_context_t * copy()=0
Makes a copy of this abstract_context_t.
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).
virtual label_t epsilon() const =0
bool operator!=(abstract_context_t const &other)
Definition: abstract_context.hh:152
virtual bool is_eps_allowed() const =0
Returns true if epsilon is allowed as label.
virtual context::context_description description() const =0
Returns the context::context_description corresponding to this abstract_context_t.
virtual bool is_finite_weightset() const =0
Returns true if the weightset contains a finite number of elements.
virtual weight_t get_weight(std::string str) const =0
Converts given string to a weight.
virtual label_t get_label(std::string str) const =0
Converts given string to a label.
virtual std::string labelset_name() const =0
Gives the name of the labelset.
virtual ~abstract_context_t()
Definition: abstract_context.hh:149
virtual std::string vname(bool full=true) const =0
Returns the runtime internal name of the context.
virtual bool is_locally_finite_weightset() const =0
Returns true if all finitely-generated sub-semiring of the weightset are all finite.
virtual weight_t div_weights(weight_t l, weight_t r) const =0
Returns the quotient of given weights, as computed by the weightset.
virtual std::string sname() const =0
Returns the compile-time internal name of the context.
virtual std::string weight_to_string(weight_t w) const =0
Computes the string-representation of given weight.
virtual weight_t weight_zero() const =0
Gives the value zero, that is, the neutral additive element of the weightset.
virtual weight_t add_weights(weight_t l, weight_t r) const =0
Returns the sum of given weights, as computed by the weightset.
virtual weight_t mul_weights(weight_t l, weight_t r) const =0
Returns the product of given weights, as computed by the weightset.
virtual weight_t weight_one() const =0
Returns the value one, that is, the neutral multiplicative element of the weightset.
bool operator==(abstract_context_t const &other)
Definition: abstract_context.hh:155
automaton_t make_automaton()
Builds an empty automaton_t with this context.
Structure used to erase the type of labels/weights at the dyn layer.
Definition: any.hh:59