TdZdd
1.1
A top-down/breadth-first decision diagram manipulation framework
|
Ordered n-ary decision diagram structure. More...
#include <DdStructure.hpp>
Classes | |
class | const_iterator |
Iterator on a set of integer vectors represented by a DD. More... | |
Public Member Functions | |
DdStructure () | |
Default constructor. | |
DdStructure (int n, bool useMP=false) | |
Universal ZDD constructor. More... | |
template<typename SPEC > | |
DdStructure (DdSpecBase< SPEC, ARITY > const &spec, bool useMP=false) | |
DD construction. More... | |
template<typename SPEC > | |
void | zddSubset (DdSpecBase< SPEC, ARITY > const &spec) |
ZDD subsetting. More... | |
bool | useMultiProcessors (bool flag=true) |
Enables or disables multiple processor algorithms. More... | |
NodeId & | root () |
Gets the root node. More... | |
NodeId | root () const |
Gets the root node. More... | |
NodeId | child (NodeId f, int b) const |
Gets a child node. More... | |
NodeTableHandler< ARITY > & | getDiagram () |
Gets the diagram. More... | |
NodeTableHandler< ARITY > const & | getDiagram () const |
Gets the diagram. More... | |
int | topLevel () const |
Gets the level of the root node. More... | |
size_t | size () const |
Gets the number of nonterminal nodes. More... | |
bool | empty () const |
Checks if DD is a 0-terminal only. More... | |
bool | operator== (DdStructure const &o) const |
Checks structural equivalence with another DD. More... | |
bool | operator!= (DdStructure const &o) const |
Checks structural inequivalence with another DD. More... | |
void | qddReduce () |
QDD reduction. More... | |
void | bddReduce () |
BDD reduction. More... | |
void | zddReduce () |
ZDD reduction. More... | |
template<bool BDD, bool ZDD> | |
void | reduce () |
BDD/ZDD reduction. More... | |
DdStructure | bdd2zdd (int numVars) const |
Transforms a BDD into a ZDD. More... | |
DdStructure | zdd2bdd (int numVars) const |
Transforms a ZDD into a BDD. More... | |
std::string | bddCardinality (int numVars) const |
Counts the number of minterms of the function represented by this BDD. More... | |
std::string | zddCardinality () const |
Counts the number of sets in the family of sets represented by this ZDD. More... | |
template<typename S , typename T , typename R > | |
R | evaluate (DdEval< S, T, R > const &evaluator) const |
Evaluates the DD from the bottom to the top. More... | |
const_iterator | begin () const |
Returns an iterator to the first instance, which is viewed as a collection of item numbers. More... | |
const_iterator | end () const |
Returns an iterator to the element following the last instance. More... | |
int | getRoot (NodeId &f) const |
Implements DdSpec. | |
int | getChild (NodeId &f, int level, int value) const |
Implements DdSpec. | |
size_t | hashCode (NodeId const &f) const |
Implements DdSpec. | |
void | dumpSapporo (std::ostream &os) const |
Dumps the node table in Sapporo ZDD format. More... | |
Public Member Functions inherited from tdzdd::DdSpecBase< DdStructure< ARITY >, AR > | |
std::vector< std::pair< int, int > > | findOneInstance () const |
Returns a random instance using simple depth-first search without caching. More... | |
void | dumpDot (std::ostream &os=std::cout, std::string title=typenameof< DdStructure< ARITY > >()) const |
Dumps the diagram in Graphviz (DOT) format. More... | |
std::string | dot (std::string title=typenameof< DdStructure< ARITY > >()) const |
Makes an input code for Graphviz. More... | |
Ordered n-ary decision diagram structure.
ARITY | arity of the nodes. |
Definition at line 56 of file DdStructure.hpp.
|
inline |
Universal ZDD constructor.
n | the number of variables. |
useMP | use algorithms for multiple processors. |
Definition at line 82 of file DdStructure.hpp.
|
inline |
DD construction.
spec | DD spec. |
useMP | use algorithms for multiple processors. |
Definition at line 105 of file DdStructure.hpp.
References tdzdd::DdBuilder< S >::construct(), tdzdd::DdBuilderMP< S >::construct(), tdzdd::DdBuilder< S >::initialize(), tdzdd::DdBuilderMP< S >::initialize(), and tdzdd::DdStructure< ARITY >::size().
|
inline |
Transforms a BDD into a ZDD.
numVars | the number of variables. |
Definition at line 416 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::DdStructure().
|
inline |
Counts the number of minterms of the function represented by this BDD.
numVars | the number of input variables of the function. |
Definition at line 437 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::evaluate().
|
inline |
BDD reduction.
The node of which two edges points to the identical node is deleted.
Definition at line 372 of file DdStructure.hpp.
|
inline |
Returns an iterator to the first instance, which is viewed as a collection of item numbers.
Supports binary ZDDs only.
Definition at line 661 of file DdStructure.hpp.
|
inline |
Gets a child node.
f | parent node ID. |
b | branch number. |
Definition at line 260 of file DdStructure.hpp.
Referenced by tdzdd::DdStructure< ARITY >::getChild().
|
inline |
Dumps the node table in Sapporo ZDD format.
Works only for binary DDs.
os | the output stream. |
Definition at line 704 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::size().
|
inline |
Checks if DD is a 0-terminal only.
Definition at line 300 of file DdStructure.hpp.
|
inline |
Returns an iterator to the element following the last instance.
Supports binary ZDDs only.
Definition at line 670 of file DdStructure.hpp.
|
inline |
Evaluates the DD from the bottom to the top.
evaluator | the driver class that implements DdEval interface. |
Definition at line 455 of file DdStructure.hpp.
Referenced by tdzdd::DdStructure< ARITY >::bddCardinality(), and tdzdd::DdStructure< ARITY >::zddCardinality().
|
inline |
|
inline |
|
inline |
Checks structural inequivalence with another DD.
Definition at line 356 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::operator==().
|
inline |
Checks structural equivalence with another DD.
Definition at line 308 of file DdStructure.hpp.
References tdzdd::MyHashMap< K, V, Hash, Equal >::getValue(), tdzdd::MyHashTable< MyHashMapEntry< K, V >, MyHashMapHashWrapper< K, V, Hash, Equal >, MyHashMapHashWrapper< K, V, Hash, Equal > >::initialize(), and tdzdd::DdStructure< ARITY >::size().
Referenced by tdzdd::DdStructure< ARITY >::operator!=().
|
inline |
|
inline |
BDD/ZDD reduction.
BDD | enable BDD reduction. |
ZDD | enable ZDD reduction. |
Definition at line 390 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::size().
|
inline |
|
inline |
|
inline |
Gets the number of nonterminal nodes.
Definition at line 292 of file DdStructure.hpp.
Referenced by tdzdd::DdStructure< ARITY >::DdStructure(), tdzdd::DdStructure< ARITY >::dumpSapporo(), tdzdd::DdStructure< ARITY >::operator==(), tdzdd::DdStructure< ARITY >::reduce(), and tdzdd::DdStructure< ARITY >::zddSubset().
|
inline |
Gets the level of the root node.
Definition at line 284 of file DdStructure.hpp.
|
inline |
Enables or disables multiple processor algorithms.
flag | true for using multiple processor algorithms. |
Definition at line 232 of file DdStructure.hpp.
|
inline |
Transforms a ZDD into a BDD.
numVars | the number of variables. |
Definition at line 426 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::DdStructure().
|
inline |
Counts the number of sets in the family of sets represented by this ZDD.
Definition at line 445 of file DdStructure.hpp.
References tdzdd::DdStructure< ARITY >::evaluate().
|
inline |
ZDD reduction.
The node of which 1-edge points to the 0-terminal is deleted.
Definition at line 380 of file DdStructure.hpp.
|
inline |
ZDD subsetting.
spec | ZDD spec. |
Definition at line 166 of file DdStructure.hpp.
References tdzdd::ZddSubsetter< S >::initialize(), tdzdd::ZddSubsetterMP< S >::initialize(), tdzdd::DdStructure< ARITY >::size(), tdzdd::ZddSubsetter< S >::subset(), and tdzdd::ZddSubsetterMP< S >::subset().