DDD
1.9.0.20240826145154
|
The abstract base class for user defined operations. More...
#include <Hom.h>
Public Member Functions | |
StrongHom () | |
Default constructor. More... | |
virtual | ~StrongHom () |
Default destructor. More... | |
virtual GDDD | phiOne () const |
Evaluation over terminal GDDD::one. More... | |
virtual GHom | phi (int var, int val) const =0 |
Evaluation over an arbitrary arc of a SDD. More... | |
virtual bool | operator== (const StrongHom &h) const =0 |
Comparator is pure virtual. Define a behavior in user homomorphisms. More... | |
bool | operator== (const _GHom &h) const |
Comparator for unicity table. More... | |
virtual void | print (std::ostream &os) const |
pretty print More... | |
GDDD | eval (const GDDD &) const |
The evaluation mechanism of strong homomorphisms. More... | |
virtual GDDD | has_image (const GDDD &) 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 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... | |
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... | |
virtual GHom | invert (const GDDD &) const |
returns the predescessor homomorphism, using pot to determine variable domains More... | |
bool | operator< (const _GHom &h) const |
Ordering between _GHom. It is the chronological ordering of creation. More... | |
virtual size_t | hash () const =0 |
Hash key computation. More... | |
virtual _GHom * | clone () const =0 |
virtual void | mark () const |
For garbage collection. Used in first phase of garbage collection. More... | |
virtual GHom | negate () const |
returns a negation of a selector homomorphism h, such that h.negate() (d) = d - h(d) More... | |
virtual GHom | compose (const GHom &r) const |
Static Public Member Functions | |
static const _GHom * | get_concret (const GHom &ghom) |
Private Member Functions | |
GDDD | eval_skip (const GDDD &) const |
Private Attributes | |
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... | |
The abstract base class for user defined operations.
This is the class users should derive their operations from. It defines the interface of a Strong Homomorphism :
|
inline |
|
inlinevirtual |
|
pure virtualinherited |
Implemented in _VarCompVar, _incVar, _setVarConst, _VarCompState, MLHomAdapter, Fixpoint, Minus, RightConcat, LeftConcat, And, Compose, Monotonic, Add, NotCond, Inter, Mult, DomExtract, Apply2k, Constant, and Identity.
Reimplemented in _VarCompVar, and _VarCompState.
References GHom::id, and GDDD::null.
Referenced by _VarCompState::compose(), _VarCompVar::compose(), and GHom::compose().
The evaluation mechanism of strong homomorphisms.
Evaluation is defined as :
Let an SDD d= (var, Union_i (val_i, d_i) )
h (d) = Sum_i ( phi(var, val_i) (d_i) )
Implements _GHom.
References DED::add(), GDDD::begin(), GDDD::end(), GDDD::null, GDDD::one, phi(), phiOne(), GDDD::top, and GDDD::variable().
References GDDD::begin(), GDDD::end(), _GHom::eval(), GHom::id, GDDD::null, GDDD::one, _GHom::skip_variable(), GDDD::top, and GDDD::variable().
Referenced by GHom::eval().
References GHom::concret.
Referenced by Add::Add(), addCompositionParameter(), _VarCompState::compose(), _VarCompVar::compose(), And::eval(), Fixpoint::eval(), Fixpoint::has_image(), Inter::skip_variable(), NotCond::skip_variable(), Add::skip_variable(), Monotonic::skip_variable(), Compose::skip_variable(), RightConcat::skip_variable(), and Fixpoint::skip_variable().
|
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().
Reimplemented from _GHom.
References GDDD::begin(), GDDD::end(), GDDD::null, GDDD::one, phi(), phiOne(), GDDD::top, and GDDD::variable().
References GDDD::begin(), GDDD::end(), _GHom::has_image(), GHom::has_image(), GHom::id, GDDD::null, GDDD::one, _GHom::skip_variable(), GDDD::top, and GDDD::variable().
|
pure virtualinherited |
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.
Implemented in _VarCompVar, _incVar, _setVarConst, _VarCompState, MLHomAdapter, Fixpoint, Minus, RightConcat, LeftConcat, And, Compose, Monotonic, Add, NotCond, Inter, Mult, DomExtract, Apply2k, Constant, and Identity.
returns the predescessor homomorphism, using pot to determine variable domains
Reimplemented in _incVar, _setVarConst, Fixpoint, Minus, And, Compose, Monotonic, Add, Inter, Mult, Apply2k, Constant, and Identity.
References _GHom::GHom, _GHom::is_selector(), GDDD::null, and _GHom::print().
Referenced by GHom::invert().
|
inlinevirtualinherited |
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 in _VarCompVar, _VarCompState, Fixpoint, Minus, And, Compose, Monotonic, Add, NotCond, Inter, Mult, DomExtract, Constant, and Identity.
Referenced by _GHom::invert(), and GHom::is_selector().
|
inlinevirtualinherited |
For garbage collection. Used in first phase of garbage collection.
Reimplemented in MLHomAdapter, Fixpoint, Minus, RightConcat, LeftConcat, And, Compose, Monotonic, Add, NotCond, Inter, Mult, Apply2k, and Constant.
Referenced by GHom::mark().
|
virtualinherited |
returns a negation of a selector homomorphism h, such that h.negate() (d) = d - h(d)
Reimplemented in _VarCompState, And, Add, NotCond, Inter, Constant, and Identity.
References _GHom::GHom.
Referenced by GHom::negate().
|
inherited |
Ordering between _GHom. It is the chronological ordering of creation.
References _GHom::creation_counter.
|
virtual |
Comparator for unicity table.
Users should not use this. The behavior is to check for type mismatch (and return false if that is the case) or call specialized comparators of derived subclasses otherwise.
Implements _GHom.
|
pure virtual |
Comparator is pure virtual. Define a behavior in user homomorphisms.
Implemented in _VarCompVar, _incVar, _setVarConst, and _VarCompState.
|
pure virtual |
Evaluation over an arbitrary arc of a SDD.
var | the index of the variable labeling the node. |
val | the value labeling the arc. |
Implemented in _VarCompVar, _incVar, _setVarConst, and _VarCompState.
Referenced by eval(), and has_image().
|
inlinevirtual |
Evaluation over terminal GDDD::one.
Returns a constant DDD. A homomorphism that does not overload phiOne does not expect to meet the terminal during it's evaluation, therefore default behavior returns GDDD::top
Reimplemented in _VarCompVar, _incVar, _setVarConst, and _VarCompState.
References GDDD::top.
Referenced by eval(), and has_image().
|
virtual |
pretty print
Implements _GHom.
Reimplemented in _VarCompVar, _incVar, _setVarConst, and _VarCompState.
|
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().
|
privateinherited |
Counter of objects created (see constructors).
This is used for the ordering between homomorphisms.
Referenced by _GHom::_GHom(), and _GHom::operator<().
|
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()().
|
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().
|
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().