Vcsn  2.3a
Be Rational
vcsn::rat::identities Class Reference

An expressionset can implement several different sets of identities on expressions. More...

#include <identities.hh>

Collaboration diagram for vcsn::rat::identities:

Public Types

enum  ids_t {
  none, trivial, associative, linear,
  distributive, agressive, deflt = linear
}
 
using self_t = identities
 

Public Member Functions

 identities (ids_t id=deflt)
 
 identities (const std::string &i)
 Build from a string. More...
 
 identities (const char *cp)
 Build from a literal string. More...
 
ids_t ids () const
 
bool is_agressive () const
 Whether agressive optimizations are on. More...
 
bool is_associative () const
 Whether associative. More...
 
bool is_distributive () const
 Whether distributive. More...
 
bool is_linear () const
 Whether linear. More...
 
 operator bool () const
 Whether not none. More...
 
bool operator< (self_t that) const
 
bool operator== (self_t that) const
 
bool operator!= (self_t that) const
 

Private Attributes

ids_t ids_
 

Detailed Description

An expressionset can implement several different sets of identities on expressions.

This type represents one of those sets.

Could have been a simple enum class, but having a constructor is helping to select the default identities other than the first one.

Definition at line 21 of file identities.hh.

Member Typedef Documentation

Definition at line 24 of file identities.hh.

Member Enumeration Documentation

Enumerator
none 

Strictly obey to the syntax.

trivial 

Trivial identities only.

associative 

Trivial, plus associativity of add and product.

linear 

Associative plus commutativity, and "idempotence" for add.

distributive 

Linear plus distribution. Used for series identities.

agressive 

Linear plus optimizations.

deflt 

The default value.

Definition at line 26 of file identities.hh.

Constructor & Destructor Documentation

vcsn::rat::identities::identities ( ids_t  id = deflt)
inline

Definition at line 51 of file identities.hh.

vcsn::rat::identities::identities ( const std::string &  i)

Build from a string.

Definition at line 17 of file identities.cc.

References agressive, associative, deflt, distributive, ids_, linear, none, and trivial.

vcsn::rat::identities::identities ( const char cp)

Build from a literal string.

Definition at line 38 of file identities.cc.

Member Function Documentation

ids_t vcsn::rat::identities::ids ( ) const
inline

Definition at line 61 of file identities.hh.

References ids_.

Referenced by vcsn::rat::to_string().

bool vcsn::rat::identities::is_agressive ( ) const
inline

Whether agressive optimizations are on.

Definition at line 67 of file identities.hh.

References agressive, and ids_.

bool vcsn::rat::identities::is_associative ( ) const
inline

Whether associative.

Definition at line 73 of file identities.hh.

References associative, and ids_.

bool vcsn::rat::identities::is_distributive ( ) const
inline
bool vcsn::rat::identities::is_linear ( ) const
inline

Whether linear.

Definition at line 85 of file identities.hh.

References ids_, and linear.

vcsn::rat::identities::operator bool ( ) const
inline

Whether not none.

Definition at line 91 of file identities.hh.

References ids_, and none.

bool vcsn::rat::identities::operator!= ( self_t  that) const
inline

Definition at line 106 of file identities.hh.

References operator==().

Here is the call graph for this function:

bool vcsn::rat::identities::operator< ( self_t  that) const
inline

Definition at line 96 of file identities.hh.

References ids_.

bool vcsn::rat::identities::operator== ( self_t  that) const
inline

Definition at line 101 of file identities.hh.

References ids_.

Referenced by operator!=().

Member Data Documentation

ids_t vcsn::rat::identities::ids_
private

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