Vcsn
2.0
Be Rational
|
The abstract parameterized, root for all rational expression types. More...
#include <fwd.hh>
Public Types | |
using | context_t = Context |
using | node_t = rat::node< context_t > |
using | value_t = std::shared_ptr< const node_t > |
A ratexp 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 ratexps. 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 ratexp 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 ratexp, ratexps need to be able to hash and equality-compare the ratexps, 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 ratexp 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 ratexp 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.
using vcsn::rat::node< Context >::const_visitor = vcsn::rat::const_visitor<context_t> |
using vcsn::rat::node< Context >::context_t = Context |
using vcsn::rat::node< Context >::node_t = rat::node<context_t> |
using vcsn::rat::node< Context >::value_t = std::shared_ptr<const node_t> |
using vcsn::rat::node< Context >::values_t = std::vector<value_t> |
|
pure virtual |