DDD  1.9.0.20240425101308
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Constant Class Reference
Inheritance diagram for Constant:
Inheritance graph
Collaboration diagram for Constant:
Collaboration graph

Public Member Functions

 Constant (const GDDD &d, int ref=0)
 
bool operator== (const _GHom &h) const
 Comparator. More...
 
size_t hash () const
 Hash key computation. More...
 
_GHomclone () const
 
GDDD eval (const GDDD &d) const
 The computation function responsible for evaluation over a node. More...
 
GHom invert (const GDDD &pot) const
 returns the predescessor homomorphism, using pot to determine variable domains More...
 
GHom negate () const
 returns a negation of a selector homomorphism h, such that h.negate() (d) = d - h(d) More...
 
bool is_selector () const
 The isSelector predicate indicates a homomorphism that only selects paths in the SDD (no modifications, no additions) Tagging with isSelector() allows to enable optimizations and makes the homomorphism eligible as "condition" in ITE construct. More...
 
void mark () const
 For garbage collection. Used in first phase of garbage collection. More...
 
void print (std::ostream &os) const
 
GDDD has_image_skip (const GDDD &) const
 
virtual bool skip_variable (int) const
 The skip_variable predicate indicates which variables are "don't care" with respect to this SHom. More...
 
virtual const GHom::range_t get_range () const
 The range returns the dual of skip_variable, default implem considers that all variables are affected by this homomorphism. More...
 
bool operator< (const _GHom &h) const
 Ordering between _GHom. It is the chronological ordering of creation. More...
 
virtual GDDD has_image (const GDDD &) const
 
virtual GHom compose (const GHom &r) const
 

Static Public Member Functions

static const _GHomget_concret (const GHom &ghom)
 

Private Member Functions

GDDD eval_skip (const GDDD &) const
 

Private Attributes

GDDD value
 
int refCounter
 For garbage collection. More...
 
bool marking
 For garbage collection. More...
 
bool immediat
 For operation cache management. More...
 
size_t creation_counter
 Counter of objects created (see constructors). More...
 

Constructor & Destructor Documentation

◆ Constant()

Constant::Constant ( const GDDD d,
int  ref = 0 
)
inline

Referenced by clone().

Member Function Documentation

◆ clone()

_GHom* Constant::clone ( ) const
inlinevirtual

Implements _GHom.

References Constant().

◆ compose()

GHom _GHom::compose ( const GHom r) const
virtualinherited

Reimplemented in _VarCompVar, and _VarCompState.

References GHom::id, and GDDD::null.

Referenced by _VarCompState::compose(), _VarCompVar::compose(), and GHom::compose().

◆ eval()

GDDD Constant::eval ( const GDDD ) const
inlinevirtual

The computation function responsible for evaluation over a node.

Users should not directly use this. Normal behavior is to use GShom::operator() that encapsulates this call with operation caching.

Implements _GHom.

References GDDD::null, and value.

◆ eval_skip()

GDDD _GHom::eval_skip ( const GDDD d) const
privateinherited

◆ get_concret()

static const _GHom* _GHom::get_concret ( const GHom ghom)
inlinestaticinherited

◆ get_range()

virtual const GHom::range_t _GHom::get_range ( ) const
inlinevirtualinherited

The range returns the dual of skip_variable, default implem considers that all variables are affected by this homomorphism.

Reimplemented in _VarCompVar, _incVar, _setVarConst, _VarCompState, Fixpoint, And, Compose, Monotonic, Add, and NotCond.

References GHom::full_range.

Referenced by GHom::get_range().

◆ has_image()

GDDD _GHom::has_image ( const GDDD d) const
virtualinherited

◆ has_image_skip()

GDDD _GHom::has_image_skip ( const GDDD d) const
inherited

◆ hash()

size_t Constant::hash ( ) const
inlinevirtual

Hash key computation.

It is essential for good hash table operation that the spread of the keys be as good as possible. Also, fast hash key computation is a good design goal. Note that bad hash functions will yield more collisions, thus equality comparisons which may be quite costly.

Implements _GHom.

References GDDD::hash(), and value.

◆ invert()

GHom Constant::invert ( const GDDD ) const
inlinevirtual

returns the predescessor homomorphism, using pot to determine variable domains

Reimplemented from _GHom.

◆ is_selector()

bool Constant::is_selector ( ) const
inlinevirtual

The isSelector predicate indicates a homomorphism that only selects paths in the SDD (no modifications, no additions) Tagging with isSelector() allows to enable optimizations and makes the homomorphism eligible as "condition" in ITE construct.

Reimplemented from _GHom.

References GDDD::null, and value.

◆ mark()

void Constant::mark ( ) const
inlinevirtual

For garbage collection. Used in first phase of garbage collection.

Reimplemented from _GHom.

References GDDD::mark(), and value.

◆ negate()

GHom Constant::negate ( ) const
inlinevirtual

returns a negation of a selector homomorphism h, such that h.negate() (d) = d - h(d)

Reimplemented from _GHom.

References GHom::id, GDDD::null, and value.

◆ operator<()

bool _GHom::operator< ( const _GHom h) const
inherited

Ordering between _GHom. It is the chronological ordering of creation.

References _GHom::creation_counter.

◆ operator==()

bool Constant::operator== ( const _GHom h) const
inlinevirtual

Comparator.

Used in case of hash collision. Should be appropriately defined in derived classes, in particular in user defined homomorphisms.

Implements _GHom.

References value.

◆ print()

void Constant::print ( std::ostream &  os) const
inlinevirtual

Implements _GHom.

References value.

◆ skip_variable()

virtual bool _GHom::skip_variable ( int  ) const
inlinevirtualinherited

The skip_variable predicate indicates which variables are "don't care" with respect to this SHom.

This is defined as a StrongHom with : phi(var,val) { if ( skip_variable(var) ) return GShom( var, val, this ); else { real behavior } }

Reimplemented in Identity, _VarCompVar, _setVarConst, _VarCompState, _incVar, Fixpoint, RightConcat, And, Compose, Monotonic, Add, NotCond, Inter, and DomExtract.

Referenced by _GHom::eval_skip(), _GHom::has_image_skip(), Inter::skip_variable(), NotCond::skip_variable(), Add::skip_variable(), Monotonic::skip_variable(), Compose::skip_variable(), RightConcat::skip_variable(), Fixpoint::skip_variable(), and GHom::skip_variable().

Member Data Documentation

◆ creation_counter

size_t _GHom::creation_counter
privateinherited

Counter of objects created (see constructors).

This is used for the ordering between homomorphisms.

Referenced by _GHom::_GHom(), and _GHom::operator<().

◆ immediat

bool _GHom::immediat
mutableprivateinherited

For operation cache management.

If immediat==true, eval is called without attempting a cache hit. Currently only the constant homomorphism has this attribute set to true.

Referenced by GHom::operator()().

◆ marking

bool _GHom::marking
mutableprivateinherited

For garbage collection.

Used in the two phase garbage collection process. A Hom that is not marked after the first pass over the unicity table, will be sweeped in the second phase. Outside of garbage collection routine, marking should always bear the value false.

Referenced by GHom::garbage(), and GHom::mark().

◆ refCounter

int _GHom::refCounter
mutableprivateinherited

For garbage collection.

Counts the number of times a _GShom is referenced from the context of an Shom.

Referenced by Hom::Hom(), Hom::operator=(), GHom::refCounter(), and Hom::~Hom().

◆ value

GDDD Constant::value
private

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

Please comment this page and report errors about it on the RefDocComments page.
Generated on Thu Apr 25 2024 10:15:16 for DDD by doxygen 1.9.1