Vcsn  2.2
Be Rational
vcsn::rat::node< Context > Class Template Referenceabstract

The abstract parameterized, root for all rational expression types. More...

#include <expression.hh>

Inheritance diagram for vcsn::rat::node< Context >:
Collaboration diagram for vcsn::rat::node< Context >:

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...
 

Detailed Description

template<typename Context>
class vcsn::rat::node< Context >

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.

Member Typedef Documentation

template<typename Context >
using vcsn::rat::node< Context >::const_visitor = vcsn::rat::const_visitor<context_t>

Definition at line 90 of file expression.hh.

template<typename Context >
using vcsn::rat::node< Context >::context_t = Context

Definition at line 85 of file expression.hh.

template<typename Context >
using vcsn::rat::node< Context >::node_t = rat::node<context_t>

Definition at line 86 of file expression.hh.

template<typename Context >
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.

template<typename Context >
using vcsn::rat::node< Context >::values_t = std::vector<value_t>

Definition at line 89 of file expression.hh.

Member Function Documentation


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