#include <bdd.h>
Inheritance diagram for gbdd::Bdd:

Public Types | |
| typedef Space::Var | Var |
| typedef Space::VarMap | VarMap |
Public Member Functions | |
| Bdd () | |
| Create undefined BDD. | |
| Bdd (Space *space, bool v=false) | |
| Constructs a leaf BDD. | |
| ~Bdd () | |
| Destructor. | |
| Bdd (const Bdd &p) | |
| Copy constructor. | |
| Space * | get_space () const |
| Get space of BDD. | |
| Factory * | ptr_factory () const |
| BoolConstraint * | ptr_convert (const BoolConstraint::Factory &f) const |
| Bdd | operator! () const |
| Negates BDD. | |
| Bdd | operator| (const Bdd &p2) const |
| OR operator. | |
| Bdd | operator & (const Bdd &p2) const |
| AND operator. | |
| Bdd | operator- (const Bdd &p2) const |
| Set difference. | |
| Bdd & | operator= (const Bdd &p) |
| Assignment operator. | |
| Bdd & | operator|= (const Bdd &p) |
| Assignment OR. | |
| Bdd & | operator &= (const Bdd &p) |
| Assignment AND. | |
| Bdd & | operator-= (const Bdd &p) |
| Assignment Set minus. | |
| virtual bool | operator== (const StructureConstraint &b2) const |
| Equality. | |
| bool | bdd_is_leaf () const |
| Test if BDD is a leaf. | |
| bool | bdd_leaf_value () const |
| Get leaf value of BDD. | |
| Bdd | bdd_then () const |
| Get then-branch of BDD. | |
| Bdd | bdd_else () const |
| Get else-branch of BDD. | |
| Var | bdd_var () const |
| Get variable of this node. | |
| bool | value_member (const Domain &vs, unsigned int v) const |
| Membership of value. | |
| Bdd | value_follow (const Domain &vs, unsigned int v) const |
| Membership of value. | |
| template<class Product> Bdd | product (Product fn) const |
| Product. | |
| template<class VarPredicate, class Product> Bdd | project (VarPredicate fn_var, Product fn_prod) const |
| Projection. | |
| template<class VarPredicate> Bdd | project (VarPredicate fn_var) const |
| OR projection. | |
| template<class VarPredicate> Bdd | exists (VarPredicate fn_var) const |
| Synonym for OR projection. | |
| template<class VarPredicate> Bdd | forall (VarPredicate fn_var) const |
| Forall projection. | |
| Bdd | rename (const VarMap &map) const |
| Rename according to map. | |
| Bdd | rename (const Domain &vs1, const Domain &vs2) const |
| Renaming between variable sets. | |
| unsigned int | n_assignments (const Domain &vs) const |
| Get number of possible assignments. | |
| set< unsigned int > | assignments_value (const Domain &vs) const |
| Get all assignments interpreted as values. | |
| hash_set< Bdd > | with_geq_var (Var v) const |
| Get subtrees with variable over some threshold. | |
| Bdd | with_image_geq_var (Bdd im, Var v) const |
| Construct BDD representing the set of assignments leading to a subtree. | |
| hash_set< Bdd > | nodes () const |
| Return all reachable nodes in this BDD. | |
| Var | highest_var () const |
| Get highest variable. | |
| Var | lowest_var () const |
| Get lowest variable. | |
| Domain | vars () const |
| Get set of variables in BDD. | |
| bool | is_false () const |
| Test for false BDD. | |
| bool | is_true () const |
| Test for true BDD. | |
| unsigned long int | hash (void) const |
| Hash value of this BDD. | |
| ostream & | print_dot (ostream &os) const |
| Print a dot representation of the BDD. | |
| virtual Bdd * | ptr_rename (VarMap map) const |
| Rename variables. | |
| virtual Bdd * | ptr_project (Domain vs) const |
| Project variables. | |
| virtual Bdd * | ptr_constrain_value (Var v, bool value) const |
| Constrain variable. | |
| virtual Bdd * | ptr_product (const StructureConstraint &b2, bool(*fn)(bool v1, bool v2)) const |
| Product. | |
| virtual Bdd * | ptr_negate () const |
| Negation. | |
| virtual Bdd * | ptr_clone () const |
| Cloning. | |
Static Public Member Functions | |
| template<class Product> Bdd | var_product (Space *space, Var v1, Var v2, Product fn) |
| Product of two variables. | |
| Bdd | var_equal (Space *space, Var v1, Var v2) |
| Equality of two variables. | |
| Bdd | var_true (Space *space, Var v) |
| Construct BDD that tests for variable. | |
| Bdd | var_false (Space *space, Var v) |
| Construct BDD that tests for variable. | |
| Bdd | var_then_else (Space *space, Var v, Bdd p_then, Bdd p_else) |
| Construct BDD. | |
| unsigned int | n_vars_needed (unsigned int n_values) |
| Get number of variables needed for encoding of values. | |
| Bdd | value (Space *space, const Domain &vs, unsigned int v) |
| Encodes a value as a BDD using a binary representation. | |
| Bdd | value_range (Space *space, const Domain &vs, unsigned int from_v, unsigned int to_v) |
| Encodes a value range as a BDD. | |
| template<class Product> Bdd | vars_product (Space *space, const Domain &vs1, const Domain &vs2, Product fn) |
| Bdd | vars_equal (Space *space, const Domain &vs1, const Domain &vs2) |
| Construct BDD representing equality between variables. | |
| template<class Product> Bdd | bdd_product (const Bdd &p1, const Bdd &p2, Product fn) |
| Product. | |
| void | gc (Space *space) |
| Garbage collect BDD space. | |
Friends | |
| struct | hash< Bdd > |
| bool | operator== (const Bdd &p1, const Bdd &p2) |
| Equality. | |
| ostream & | operator<< (ostream &s, const Bdd &p) |
| Print a textual representation on a stream. | |
The following code illustrates the typical use of BDDs in gbdd. It creates a domain vs containing the variables 0, 1, 2 and 3. Using this set of variables, it encodes integer values using a binary encoding, creating two BDDs. The first BDD p represents the set {2,3} and the second BDD q represents the set {3,4}. The it tests whether p intersected with q gives the set {3}.
See also gbdd::Bdd::Vars, a simplified way to create BDDs.
Space *space = Space::create_default(); Domain vs(0,4); Bdd p = Bdd::value(space, vs, 2) | Bdd::value(space, vs, 3); Bdd q = Bdd::value(space, vs, 3) | Bdd::value(space, vs, 4); return (p & q) == Bdd::value(space, vs, 3);
|
|
Variable in a BDD Reimplemented from gbdd::StructureConstraint. |
|
|
Mapping from variables to variables Reimplemented from gbdd::StructureConstraint. |
|
|
Create undefined BDD.
|
|
||||||||||||
|
Constructs a leaf BDD.
|
|
|
Destructor.
|
|
|
Copy constructor.
|
|
|
Get all assignments interpreted as values.
Calculates assignments to variables in
|
|
|
Get else-branch of BDD.
|
|
|
Test if BDD is a leaf.
|
|
|
Get leaf value of BDD.
|
|
||||||||||||||||||||
|
Product.
|
|
|
Get then-branch of BDD.
|
|
|
Get variable of this node.
|
|
||||||||||
|
Synonym for OR projection.
|
|
||||||||||
|
Forall projection.
|
|
|
Garbage collect BDD space.
|
|
|
Get space of BDD.
|
|
|
Hash value of this BDD.
|
|
|
Get highest variable.
Implements gbdd::StructureConstraint. |
|
|
Test for false BDD.
|
|
|
Test for true BDD.
|
|
|
Get lowest variable.
Implements gbdd::StructureConstraint. |
|
|
Get number of possible assignments.
Calculates the number of assignments to variables in
|
|
|
Get number of variables needed for encoding of values.
|
|
|
Return all reachable nodes in this BDD.
|
|
|
AND operator.
|
|
|
Assignment AND.
|
|
|
Negates BDD.
|
|
|
Set difference.
|
|
|
Assignment Set minus.
|
|
|
Assignment operator.
|
|
|
Equality.
Implements gbdd::StructureConstraint. |
|
|
OR operator.
|
|
|
Assignment OR.
|
|
|
Print a dot representation of the BDD. Code inspired by the Cudd_DumpDot function in the CUDD package by Fabio Somenzi
|
|
||||||||||
|
Product.
|
|
||||||||||
|
OR projection.
|
|
||||||||||||||||
|
Projection.
|
|
|
Cloning.
Implements gbdd::StructureConstraint. |
|
||||||||||||
|
Constrain variable.
Implements gbdd::StructureConstraint. |
|
|
|
|
|
Implements gbdd::BoolConstraint. |
|
|
Negation.
Implements gbdd::StructureConstraint. |
|
||||||||||||
|
Product.
Implements gbdd::StructureConstraint. |
|
|
Project variables.
Implements gbdd::StructureConstraint. |
|
|
Rename variables.
Implements gbdd::StructureConstraint. |
|
||||||||||||
|
Renaming between variable sets.
|
|
|
Rename according to map.
|
|
||||||||||||||||
|
Encodes a value as a BDD using a binary representation.
|
|
||||||||||||
|
Membership of value. Follows a value encoded in the variables that must be lowest in the BDD (i.e. at the top)
|
|
||||||||||||
|
Membership of value. Tests the assignment of vs by encoding v is a valid assignment in the BDD
|
|
||||||||||||||||||||
|
Encodes a value range as a BDD.
|
|
||||||||||||||||
|
Equality of two variables.
|
|
||||||||||||
|
Construct BDD that tests for variable.
|
|
||||||||||||||||||||||||
|
Product of two variables.
|
|
||||||||||||||||||||
|
Construct BDD.
|
|
||||||||||||
|
Construct BDD that tests for variable.
|
|
|
Get set of variables in BDD.
|
|
||||||||||||||||
|
Construct BDD representing equality between variables.
|
|
||||||||||||||||||||||||
|
vars_product:
Returns: The BDD representing product between variables in vs1 and vs2. The i'th variable in vs1 if related with fn to the i'th variable in vs2. |
|
|
Get subtrees with variable over some threshold.
|
|
||||||||||||
|
Construct BDD representing the set of assignments leading to a subtree.
|
|
|
|
|
||||||||||||
|
Print a textual representation on a stream.
p on s |
|
||||||||||||
|
Equality.
|
1.3.6