Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::rat::node< Context > Class Template Referenceabstract

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

#include <fwd.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 >
 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...
 

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

Definition at line 80 of file fwd.hh.

Member Typedef Documentation

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

Definition at line 92 of file ratexp.hh.

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

Definition at line 87 of file ratexp.hh.

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

Definition at line 88 of file ratexp.hh.

template<typename Context >
using vcsn::rat::node< Context >::value_t = std::shared_ptr<const node_t>

A ratexp usable with value semantics.

Definition at line 90 of file ratexp.hh.

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

Definition at line 91 of file ratexp.hh.

Member Function Documentation


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