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

Public Types

typedef std::vector< GHomparam_t
 
typedef param_t::const_iterator param_it
 
typedef std::pair< GHom, std::set< GHom > > partition
 
typedef std::map< int, partitionpartition_cache_type
 

Public Member Functions

 Add (const std::set< GHom > &param, int ref=0)
 
bool get_have_id () const
 
GHom negate () const
 returns a negation of a selector homomorphism h, such that h.negate() (d) = d - h(d) More...
 
GDDD has_image (const GDDD &d) const
 
param_tget_parameters ()
 
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...
 
partition get_partition (int var) const
 
GHom invert (const GDDD &pot) const
 returns the predescessor homomorphism, using pot to determine variable domains More...
 
bool operator== (const _GHom &h) const
 Comparator. More...
 
size_t hash () const
 Hash key computation. 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...
 
_GHomclone () const
 
bool skip_variable (int var) const
 The skip_variable predicate indicates which variables are "don't care" with respect to this SHom. More...
 
GDDD eval (const GDDD &d) const
 The computation function responsible for evaluation over a node. 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
 
bool operator< (const _GHom &h) const
 Ordering between _GHom. It is the chronological ordering of creation. More...
 
virtual GHom compose (const GHom &r) const
 

Static Public Member Functions

static const _GHomget_concret (const GHom &ghom)
 

Public Attributes

param_t parameters
 
partition_cache_type partition_cache
 
bool have_id
 

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

Member Typedef Documentation

◆ param_it

typedef param_t::const_iterator Add::param_it

◆ param_t

typedef std::vector<GHom> Add::param_t

◆ partition

typedef std::pair< GHom , std::set<GHom> > Add::partition

◆ partition_cache_type

typedef std::map<int,partition> Add::partition_cache_type

Constructor & Destructor Documentation

◆ Add()

Add::Add ( const std::set< GHom > &  param,
int  ref = 0 
)
inline

References _GHom::get_concret(), and parameters.

Referenced by clone().

Member Function Documentation

◆ clone()

_GHom* Add::clone ( ) const
inlinevirtual

Implements _GHom.

References Add().

◆ 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 Add::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 DED::add(), GDDD::null, GDDD::one, parameters, partition_cache, skip_variable(), GDDD::top, and GDDD::variable().

◆ eval_skip()

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

◆ get_concret()

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

◆ get_have_id()

bool Add::get_have_id ( ) const
inline

References GHom::id, and parameters.

◆ get_parameters()

param_t& Add::get_parameters ( )
inline

References parameters.

◆ get_partition()

partition Add::get_partition ( int  var) const
inline

References partition_cache, and skip_variable().

◆ get_range()

const GHom::range_t Add::get_range ( ) const
inlinevirtual

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

Reimplemented from _GHom.

References parameters.

◆ has_image()

GDDD Add::has_image ( const GDDD d) const
inlinevirtual

◆ has_image_skip()

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

◆ hash()

size_t Add::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 parameters.

◆ invert()

GHom Add::invert ( const GDDD ) const
inlinevirtual

returns the predescessor homomorphism, using pot to determine variable domains

Reimplemented from _GHom.

References GHom::add(), and parameters.

◆ is_selector()

bool Add::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 parameters.

◆ mark()

void Add::mark ( ) const
inlinevirtual

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

Reimplemented from _GHom.

References parameters, and partition_cache.

◆ negate()

GHom Add::negate ( ) const
inlinevirtual

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

Reimplemented from _GHom.

References GHom::ccompose(), and parameters.

◆ 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 Add::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 parameters.

◆ print()

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

Implements _GHom.

References parameters.

◆ skip_variable()

bool Add::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 from _GHom.

References GHom::add(), _GHom::get_concret(), parameters, partition_cache, and _GHom::skip_variable().

Referenced by eval(), get_partition(), and has_image().

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

◆ have_id

bool Add::have_id

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

◆ parameters

param_t Add::parameters

◆ partition_cache

partition_cache_type Add::partition_cache
mutable

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


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 Mon Aug 26 2024 14:54:00 for DDD by doxygen 1.9.1