DDD
1.9.0.20240826145154
|
This is the user interface class to manipulate homomorphisms. More...
#include <SHom.h>
Public Member Functions | |
Assignment operators. | |
Shom & | operator= (const GShom &) |
Overloaded behavior for assignment operator, maintains reference counting. More... | |
Shom & | operator= (const Shom &) |
Overloaded behavior for assignment operator, maintains reference counting. More... | |
Public Constructors. | |
static const Shom | null = GSDD::null |
Shom (const GShom &h=GShom::id) | |
Build an Shom from a GShom. More... | |
Shom (const Shom &h) | |
Copy constructor. Maintains reference count. More... | |
Shom (const GSDD &d) | |
Constructs a constant homomorphism. More... | |
Shom (int var, const DataSet &val, const GShom &h=GShom::id) | |
Left concatenation of a single arc SDD. More... | |
~Shom () | |
Destructor maintains reference counting. More... | |
Public Constructors | |
static const GShom | id |
Elementary SDD homomorphism identity. Applied to any SDD d, it returns d. More... | |
GShom | invert (const GSDD &pot) const |
returns the predescessor homomorphism, using pot to determine variable domains More... | |
GSDD | has_image (const GSDD &d) const |
returns true if and only if h(d) != SDD::null More... | |
GShom | compose (const GShom &) const |
Comparisons between GShom. | |
Comparisons between GShom for unicity table. Both equality comparison and total ordering provided to allow hash and map storage of GShom | |
static const range_t | full_range = GShom::range_t() |
The full_range : that targets everyone. More... | |
bool | operator== (const GShom &h) const |
bool | operator!= (const GShom &h) const |
bool | operator< (const GShom &h) const |
bool | is_selector () const |
This predicate is true if the homomorphism global behavior is only to prune some paths. More... | |
bool | skip_variable (int) const |
This predicate is true if the homomorphism "skips" this variable. More... | |
const range_t | get_range () const |
Returns the range for this homomorphism, i.e. the dual of skip_variable. More... | |
typedef d3::set< int >::type | range_t |
typedef range_t::const_iterator | range_it |
Evaluation mechanism for homomorphisms. | |
GSDD | operator() (const GSDD &d) const |
Applying a homomorphism to a node returns a node. More... | |
GSDD | eval (const GSDD &d) const |
The full evaluation, this is the computational procedure, that is called when the computation cache yields a miss. More... | |
int | refCounter () const |
For debug and development purposes. Gives the reference count of the concrete data. More... | |
static GShom | add (const d3::set< GShom >::type &s) |
Compute an n-ary sum between homomorphisms. More... | |
Memory Management routines. | |
void | mark () const |
Mark a concrete data as in use (forbids garbage collection of the data). More... | |
size_t | hash () const |
For storage in a hash table. More... | |
enum | fixpointStrategy { BFS , DFS } |
enum | saturationStrategy { ORDINARY , RECFIREANDSAT } |
static fixpointStrategy | fixpointStrategy_ = BFS |
static saturationStrategy | saturationStrategy_ = ORDINARY |
static unsigned int | statistics () |
Return the current size of the unicity table for GShom. More... | |
static size_t | cache_size () |
Return the current size of the cache for GShom. More... | |
static size_t | cache_peak () |
Return the peak size of the cache for GShom. More... | |
static void | pstats (bool reinit=true) |
Print some usage statistics on Shom. More... | |
static void | garbage () |
Collects and destroys unused homomorphisms. More... | |
static fixpointStrategy | getFixpointStrategy () |
static void | setFixpointStrategy (fixpointStrategy strat) |
static saturationStrategy | getSaturationStrategy () |
static void | setSaturationStrategy (saturationStrategy strat) |
Friendly hard coded composition operators. | |
Open full access for library implemented hard coded operations.
| |
typedef GSDD | NodeType |
const _GShom * | concret |
Pointer to the data instance in the unicity table. More... | |
This is the user interface class to manipulate homomorphisms.
The only difference with GShom is that it implements reference counting so that instances of Shom are not collected upon MemoryManager::garbage().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
References GShom::concret, and _GShom::ref().
Shom::Shom | ( | const Shom & | h | ) |
Copy constructor. Maintains reference count.
References GShom::concret, and _GShom::ref().
Shom::Shom | ( | const GSDD & | d | ) |
Constructs a constant homomorphism.
References GShom::concret, and _GShom::ref().
Left concatenation of a single arc SDD.
This is provided as a convenience and to avoid the inefficiency if we build a node pointing to GSDD::one and then concatenate something to it. Applied to a SDD d, this homomorphism will return var–val->h(d).
var | the variable labeling the node to left concat |
val | the set of values labeling the arc |
h | the homomorphism to apply on the argument d. This defaults to GSHom::id. |
References GShom::concret, and _GShom::ref().
Shom::~Shom | ( | ) |
Destructor maintains reference counting.
Note that the destructor does not truly reclaim memory, MemoryManager::garbage() does that.
References GShom::concret, _GShom::deref(), and _GShom::refCounter().
Compute an n-ary sum between homomorphisms.
This should be slightly more efficient in evaluation than a composition of binary sums constructed using the friend operator+.
|
staticinherited |
Return the peak size of the cache for GShom.
References sns::cache, and Cache< FuncType, ParamType, ResType, EvalFunc >::peak().
|
staticinherited |
Return the current size of the cache for GShom.
References sns::cache, and Cache< FuncType, ParamType, ResType, EvalFunc >::size().
Referenced by Statistic::load().
References _GShom::compose(), and GShom::concret.
The full evaluation, this is the computational procedure, that is called when the computation cache yields a miss.
Users should not use this function directly, but only through GSDD::operator().
References GShom::concret, and _GShom::eval_skip().
Referenced by GShom::operator()().
|
staticinherited |
Collects and destroys unused homomorphisms.
Do not call this directly but through MemoryManager::garbage() as order of calls (among GSDD::garbage(), GShom::garbage(), SDED::garbage()) is important.
References addCache, sns::cache, canonical, Cache< FuncType, ParamType, ResType, EvalFunc >::clear(), sns::imgcache, and _GShom::set_mark().
Referenced by MemoryManager::garbage().
|
inherited |
Returns the range for this homomorphism, i.e. the dual of skip_variable.
References GShom::concret, and _GShom::get_range().
Referenced by commutative(), sns::SNotCond::get_range(), sns::RecFireSat::get_range(), sns::Compose::get_range(), sns::Fixpoint::get_range(), and notInRange().
|
inlinestaticinherited |
References GShom::fixpointStrategy_.
Referenced by sns::Fixpoint::eval().
|
inlinestaticinherited |
References GShom::saturationStrategy_.
Referenced by sns::Fixpoint::eval().
returns true if and only if h(d) != SDD::null
References sns::imgcache, and GSDD::null.
Referenced by sns::RecFireSat::eval(), sns::Inter::has_image(), sns::SLocalApply::has_image(), sns::SNotCond::has_image(), sns::And::has_image(), sns::Compose::has_image(), sns::LeftConcat::has_image(), sns::RightConcat::has_image(), sns::Fixpoint::has_image(), and _GShom::has_image_skip().
|
inlineinherited |
For storage in a hash table.
References GShom::concret, and ddd::knuth32_hash().
Referenced by nsMLShom::GShomAdapter::hash(), nsMLShom::ConstantUp::hash(), sns::Mult::hash(), sns::Inter::hash(), sns::SLocalApply::hash(), sns::SNotCond::hash(), sns::RecFireSat::hash(), sns::Compose::hash(), sns::LeftConcat::hash(), sns::RightConcat::hash(), sns::Minus::hash(), sns::HomMinus::hash(), and sns::Fixpoint::hash().
returns the predescessor homomorphism, using pot to determine variable domains
References GShom::concret, and _GShom::invert().
Referenced by sns::Mult::invert(), sns::Inter::invert(), sns::SLocalApply::invert(), sns::RecFireSat::invert(), sns::Compose::invert(), sns::Minus::invert(), sns::HomMinus::invert(), and sns::Fixpoint::invert().
|
inherited |
This predicate is true if the homomorphism global behavior is only to prune some paths.
References GShom::concret, and _GShom::is_selector().
Referenced by commutative(), sns::Mult::is_selector(), sns::Inter::is_selector(), sns::SLocalApply::is_selector(), sns::RecFireSat::is_selector(), sns::Compose::is_selector(), sns::Minus::is_selector(), sns::HomMinus::is_selector(), sns::Fixpoint::is_selector(), ITE(), operator!(), and operator*().
|
inherited |
Mark a concrete data as in use (forbids garbage collection of the data).
References GShom::concret, and _GShom::set_mark().
Referenced by sns::Fixpoint::eval(), sns::Mult::mark(), sns::Inter::mark(), sns::SLocalApply::mark(), sns::SNotCond::mark(), sns::RecFireSat::mark(), sns::Compose::mark(), sns::LeftConcat::mark(), sns::RightConcat::mark(), sns::Minus::mark(), sns::HomMinus::mark(), and sns::Fixpoint::mark().
|
inlineinherited |
References GShom::concret.
Applying a homomorphism to a node returns a node.
This is the normal way for users of computing the application of a homomorphism.
References sns::cache, GShom::concret, GShom::eval(), _GShom::immediat(), and GSDD::null.
|
inlineinherited |
References GShom::concret.
Overloaded behavior for assignment operator, maintains reference counting.
References GShom::concret, _GShom::deref(), _GShom::ref(), and _GShom::refCounter().
Overloaded behavior for assignment operator, maintains reference counting.
References GShom::concret, _GShom::deref(), _GShom::ref(), and _GShom::refCounter().
|
inlineinherited |
References GShom::concret.
|
staticinherited |
Print some usage statistics on Shom.
Mostly used for development and debug.
References GShom::_GShom, sns::cache, and canonical.
Referenced by MemoryManager::pstats().
|
inherited |
For debug and development purposes. Gives the reference count of the concrete data.
References GShom::concret, and _GShom::refCounter().
|
inlinestaticinherited |
References GShom::fixpointStrategy_.
|
inlinestaticinherited |
References GShom::saturationStrategy_.
|
inherited |
This predicate is true if the homomorphism "skips" this variable.
References GShom::concret, and _GShom::skip_variable().
Referenced by sns::Mult::eval(), nsMLShom::GShomAdapter::skip_variable(), sns::SNotCond::skip_variable(), sns::RecFireSat::skip_variable(), sns::Compose::skip_variable(), and sns::Fixpoint::skip_variable().
|
staticinherited |
Return the current size of the unicity table for GShom.
References canonical.
Referenced by Statistic::load(), and MemoryManager::nbShom().
|
privateinherited |
Pointer to the data instance in the unicity table.
Referenced by GShom::compose(), GShom::eval(), _GShom::get_concret(), GShom::get_range(), GShom::GShom(), GShom::hash(), GShom::invert(), GShom::is_selector(), GShom::mark(), GShom::operator!=(), GShom::operator()(), GShom::operator<(), operator=(), GShom::operator==(), GShom::refCounter(), Shom(), GShom::skip_variable(), and ~Shom().
|
staticprivateinherited |
Referenced by GShom::getFixpointStrategy(), and GShom::setFixpointStrategy().
|
staticinherited |
The full_range : that targets everyone.
Referenced by _GShom::get_range().
|
staticinherited |
Elementary SDD homomorphism identity. Applied to any SDD d, it returns d.
Referenced by apply2k(), buildUnionParameters(), _GShom::compose(), StrongMLShom::eval(), nsMLShom::Identity::eval(), nsMLShom::GShomAdapter::eval(), sns::Mult::eval(), sns::And::eval(), sns::Fixpoint::eval(), _GShom::eval_skip(), sns::And::has_image(), sns::Fixpoint::has_image(), _GShom::has_image_skip(), sns::Mult::invert(), sns::And::invert(), sns::Minus::invert(), sns::HomMinus::invert(), sns::Fixpoint::invert(), operator!(), and operator*().
|
static |
Referenced by GShom::GShom(), _GShom::invert(), operator!(), and operator*().
|
staticprivateinherited |
Referenced by GShom::getSaturationStrategy(), and GShom::setSaturationStrategy().