Vcsn  2.3
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, 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_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 

Traditional plus distribution. Used for series identities.

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 48 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 associative, deflt, distributive, ids_, linear, none, and trivial.

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

Build from a literal string.

Definition at line 37 of file identities.cc.

Member Function Documentation

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

Definition at line 58 of file identities.hh.

References ids_.

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

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

Whether associative.

Definition at line 64 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 76 of file identities.hh.

References ids_, and linear.

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

Whether not none.

Definition at line 82 of file identities.hh.

References ids_, and none.

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

Definition at line 97 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 87 of file identities.hh.

References ids_.

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

Definition at line 92 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: