Vcsn
2.2
Be Rational
|
The abstract parameterized, root for all rational expression types. More...
#include <expression.hh>
Public Types | |
using | context_t = Context |
using | node_t = rat::node< context_t > |
using | value_t = std::shared_ptr< const node_t > |
An expression usable with value semantics. More... | |
using | values_t = std::vector< value_t > |
using | const_visitor = vcsn::rat::const_visitor< context_t > |
Public Types inherited from vcsn::rat::exp | |
using | type_t = rat::type_t |
The possible types of expressions. More... | |
Public Member Functions | |
virtual void | accept (const_visitor &v) const =0 |
Public Member Functions inherited from vcsn::rat::exp | |
virtual | ~exp ()=default |
virtual type_t | type () const =0 |
The type of this node. More... | |
bool | is_unary () const |
Whether star, complement. More... | |
bool | is_leaf () const |
Whether a leaf of the expression tree. More... | |
The abstract parameterized, root for all rational expression types.
The rational expressions are values, and as such, they are "stupid", and just "contain" some value without knowing how to interpret them (very much the same way as "bool" weights do not know whether they below to F2 or to B).
However, in order to support hash-consing on the expression, expressions need to be able to hash and equality-compare the expressions, which means to be able to hash the labels and weights, which is something that only labelset and weightset can do.
So there are two options:
a. have the expression know the labelset and weightset (their types suffices, we don't need a value as the hash function is static in valuesets), i.e., have the expression know its context type.
b. move the hash and equality-compare functions from valueset to value. This seems wrong, as it would prevent the valueset from using equivalences to between values, or use a specific order.
So nodes are parameterized by Context, instead of only <Label, Weight> as was the case before.
Definition at line 80 of file expression.hh.
using vcsn::rat::node< Context >::const_visitor = vcsn::rat::const_visitor<context_t> |
Definition at line 90 of file expression.hh.
using vcsn::rat::node< Context >::context_t = Context |
Definition at line 85 of file expression.hh.
using vcsn::rat::node< Context >::node_t = rat::node<context_t> |
Definition at line 86 of file expression.hh.
using vcsn::rat::node< Context >::value_t = std::shared_ptr<const node_t> |
An expression usable with value semantics.
Definition at line 88 of file expression.hh.
using vcsn::rat::node< Context >::values_t = std::vector<value_t> |
Definition at line 89 of file expression.hh.
|
pure virtual |