DDD  1.9.0.20240425101308
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
_GHom Class Referenceabstract

The concrete data class for Homomorphisms. More...

#include <Hom.h>

Inheritance diagram for _GHom:
Inheritance graph
Collaboration diagram for _GHom:
Collaboration graph

Public Member Functions

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...
 
 _GHom (int ref=0, bool im=false)
 Constructor. More...
 
virtual ~_GHom ()
 Virtual Destructor. Default behavior. More...
 
virtual bool operator== (const _GHom &h) const =0
 Comparator. 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 _GHomclone () const =0
 
virtual GDDD eval (const GDDD &) const =0
 The computation function responsible for evaluation over a node. More...
 
virtual void mark () const
 For garbage collection. Used in first phase of garbage collection. More...
 
virtual GDDD has_image (const GDDD &) const
 
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
 
virtual void print (std::ostream &os) const =0
 

Static Public Member Functions

static const _GHomget_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...
 

Friends

class GHom
 open access to container class GHom. More...
 
class Hom
 open access to container class Hom. More...
 

Detailed Description

The concrete data class for Homomorphisms.

Users should not use this (private) class directly, but may use it indirectly by deriving user homomorphisms from the StrongHom class.

Constructor & Destructor Documentation

◆ _GHom()

_GHom::_GHom ( int  ref = 0,
bool  im = false 
)
inline

Constructor.

Note this class is abstract, so this is only used in initialization list of derived classes constructors (hard coded operations and StrongShom).

References creation_counter.

◆ ~_GHom()

virtual _GHom::~_GHom ( )
inlinevirtual

Virtual Destructor. Default behavior.

Member Function Documentation

◆ clone()

virtual _GHom* _GHom::clone ( ) const
pure virtual

◆ compose()

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

Reimplemented in _VarCompVar, and _VarCompState.

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

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

◆ eval()

virtual GDDD _GHom::eval ( const GDDD ) const
pure virtual

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.

Implemented in MLHomAdapter, Fixpoint, Minus, RightConcat, LeftConcat, And, Compose, Monotonic, Add, NotCond, Inter, Mult, DomExtract, Apply2k, Constant, Identity, and StrongHom.

Referenced by eval_skip(), and GHom::operator()().

◆ eval_skip()

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

◆ get_concret()

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

◆ get_range()

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

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
virtual

◆ has_image_skip()

GDDD _GHom::has_image_skip ( const GDDD d) const

◆ hash()

virtual size_t _GHom::hash ( ) const
pure virtual

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.

◆ invert()

virtual GHom _GHom::invert ( const GDDD ) const
inlinevirtual

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, is_selector(), GDDD::null, and print().

Referenced by GHom::invert().

◆ is_selector()

virtual bool _GHom::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 in _VarCompVar, _VarCompState, Fixpoint, Minus, And, Compose, Monotonic, Add, NotCond, Inter, Mult, DomExtract, Constant, and Identity.

Referenced by invert(), and GHom::is_selector().

◆ mark()

virtual void _GHom::mark ( ) const
inlinevirtual

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

◆ negate()

GHom _GHom::negate ( ) const
virtual

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.

Referenced by GHom::negate().

◆ operator<()

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

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

References creation_counter.

◆ operator==()

virtual bool _GHom::operator== ( const _GHom h) const
pure virtual

Comparator.

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

Implemented in NotCond, DomExtract, MLHomAdapter, StrongHom, Fixpoint, Minus, RightConcat, LeftConcat, And, Compose, Monotonic, Add, Inter, Mult, Apply2k, Constant, and Identity.

◆ print()

virtual void _GHom::print ( std::ostream &  os) const
pure virtual

◆ skip_variable()

virtual bool _GHom::skip_variable ( int  ) const
inlinevirtual

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 eval_skip(), 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().

Friends And Related Function Documentation

◆ GHom

friend class GHom
friend

◆ Hom

friend class Hom
friend

open access to container class Hom.

Referenced by Fixpoint::eval().

Member Data Documentation

◆ creation_counter

size_t _GHom::creation_counter
private

Counter of objects created (see constructors).

This is used for the ordering between homomorphisms.

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

◆ immediat

bool _GHom::immediat
mutableprivate

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
mutableprivate

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
mutableprivate

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


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

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