cudd  3.0.0
The University of Colorado Decision Diagram Package
Functions
cuddBddIte.c File Reference

BDD ITE function and satellites. More...

#include "util.h"
#include "cuddInt.h"
Include dependency graph for cuddBddIte.c:

Functions

DdNodeCudd_bddIte (DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
 Implements ITE(f,g,h). More...
 
DdNodeCudd_bddIteLimit (DdManager *dd, DdNode *f, DdNode *g, DdNode *h, unsigned int limit)
 Implements ITE(f,g,h) unless too many nodes are required. More...
 
DdNodeCudd_bddIteConstant (DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
 Implements ITEconstant(f,g,h). More...
 
DdNodeCudd_bddIntersect (DdManager *dd, DdNode *f, DdNode *g)
 Returns a function included in the intersection of f and g. More...
 
DdNodeCudd_bddAnd (DdManager *dd, DdNode *f, DdNode *g)
 Computes the conjunction of two BDDs f and g. More...
 
DdNodeCudd_bddAndLimit (DdManager *dd, DdNode *f, DdNode *g, unsigned int limit)
 Computes the conjunction of two BDDs f and g unless too many nodes are required. More...
 
DdNodeCudd_bddOr (DdManager *dd, DdNode *f, DdNode *g)
 Computes the disjunction of two BDDs f and g. More...
 
DdNodeCudd_bddOrLimit (DdManager *dd, DdNode *f, DdNode *g, unsigned int limit)
 Computes the disjunction of two BDDs f and g unless too many nodes are required. More...
 
DdNodeCudd_bddNand (DdManager *dd, DdNode *f, DdNode *g)
 Computes the NAND of two BDDs f and g. More...
 
DdNodeCudd_bddNor (DdManager *dd, DdNode *f, DdNode *g)
 Computes the NOR of two BDDs f and g. More...
 
DdNodeCudd_bddXor (DdManager *dd, DdNode *f, DdNode *g)
 Computes the exclusive OR of two BDDs f and g. More...
 
DdNodeCudd_bddXnor (DdManager *dd, DdNode *f, DdNode *g)
 Computes the exclusive NOR of two BDDs f and g. More...
 
DdNodeCudd_bddXnorLimit (DdManager *dd, DdNode *f, DdNode *g, unsigned int limit)
 Computes the exclusive NOR of two BDDs f and g unless too many nodes are required. More...
 
int Cudd_bddLeq (DdManager *dd, DdNode *f, DdNode *g)
 Checks whether f is less than or equal to g. More...
 
DdNodecuddBddIteRecur (DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
 Implements the recursive step of Cudd_bddIte. More...
 
DdNodecuddBddIntersectRecur (DdManager *dd, DdNode *f, DdNode *g)
 Implements the recursive step of Cudd_bddIntersect. More...
 
DdNodecuddBddAndRecur (DdManager *manager, DdNode *f, DdNode *g)
 Implements the recursive step of Cudd_bddAnd. More...
 
DdNodecuddBddXorRecur (DdManager *manager, DdNode *f, DdNode *g)
 Implements the recursive step of Cudd_bddXor. More...
 
static void bddVarToConst (DdNode *f, DdNode **gp, DdNode **hp, DdNode *one)
 Replaces variables with constants if possible. More...
 
static int bddVarToCanonical (DdManager *dd, DdNode **fp, DdNode **gp, DdNode **hp, int *topfp, int *topgp, int *tophp)
 Picks unique member from equiv expressions. More...
 
static int bddVarToCanonicalSimple (DdManager *dd, DdNode **fp, DdNode **gp, DdNode **hp, int *topfp, int *topgp, int *tophp)
 Picks unique member from equiv expressions. More...
 

Detailed Description

BDD ITE function and satellites.

Author
Fabio Somenzi

Function Documentation

◆ bddVarToCanonical()

static int bddVarToCanonical ( DdManager dd,
DdNode **  fp,
DdNode **  gp,
DdNode **  hp,
int *  topfp,
int *  topgp,
int *  tophp 
)
static

Picks unique member from equiv expressions.

Reduces 2 variable expressions to canonical form.

Side effects None
See also
bddVarToConst bddVarToCanonicalSimple

◆ bddVarToCanonicalSimple()

static int bddVarToCanonicalSimple ( DdManager dd,
DdNode **  fp,
DdNode **  gp,
DdNode **  hp,
int *  topfp,
int *  topgp,
int *  tophp 
)
static

Picks unique member from equiv expressions.

Makes sure the first two pointers are regular. This mat require the complementation of the result, which is signaled by returning 1 instead of 0. This function is simpler than the general case because it assumes that no two arguments are the same or complementary, and no argument is constant.

Side effects None
See also
bddVarToConst bddVarToCanonical

◆ bddVarToConst()

static void bddVarToConst ( DdNode f,
DdNode **  gp,
DdNode **  hp,
DdNode one 
)
static

Replaces variables with constants if possible.

This function performs part of the transformation to standard form by replacing variables with constants if possible.

Side effects None
See also
bddVarToCanonical bddVarToCanonicalSimple

◆ Cudd_bddAnd()

DdNode* Cudd_bddAnd ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the conjunction of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAndAbstract Cudd_bddIntersect Cudd_bddOr Cudd_bddNand Cudd_bddNor Cudd_bddXor Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddAndLimit()

DdNode* Cudd_bddAndLimit ( DdManager dd,
DdNode f,
DdNode g,
unsigned int  limit 
)

Computes the conjunction of two BDDs f and g unless too many nodes are required.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required.
Side effects None
See also
Cudd_bddAnd
Parameters
ddmanager
ffirst operand
gsecond operand
limitmaximum number of new nodes

◆ Cudd_bddIntersect()

DdNode* Cudd_bddIntersect ( DdManager dd,
DdNode f,
DdNode g 
)

Returns a function included in the intersection of f and g.

The function computed (if not zero) is a witness that the intersection is not empty. Cudd_bddIntersect tries to build as few new nodes as possible. If the only result of interest is whether f and g intersect, Cudd_bddLeq should be used instead.

Side effects None
See also
Cudd_bddLeq Cudd_bddIteConstant
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddIte()

DdNode* Cudd_bddIte ( DdManager dd,
DdNode f,
DdNode g,
DdNode h 
)

Implements ITE(f,g,h).

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_addIte Cudd_bddIteConstant Cudd_bddIntersect
Parameters
ddmanager
ffirst operand
gsecond operand
hthird operand

◆ Cudd_bddIteConstant()

DdNode* Cudd_bddIteConstant ( DdManager dd,
DdNode f,
DdNode g,
DdNode h 
)

Implements ITEconstant(f,g,h).

Returns
a pointer to the resulting BDD (which may or may not be constant) or DD_NON_CONSTANT.

No new nodes are created.

Side effects None
See also
Cudd_bddIte Cudd_bddIntersect Cudd_bddLeq Cudd_addIteConstant
Parameters
ddmanager
ffirst operand
gsecond operand
hthord operand

◆ Cudd_bddIteLimit()

DdNode* Cudd_bddIteLimit ( DdManager dd,
DdNode f,
DdNode g,
DdNode h,
unsigned int  limit 
)

Implements ITE(f,g,h) unless too many nodes are required.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required.
Side effects None
See also
Cudd_bddIte
Parameters
ddmanager
ffirst operand
gsecond operand
hthird operand
limitmaximum number of new nodes

◆ Cudd_bddLeq()

int Cudd_bddLeq ( DdManager dd,
DdNode f,
DdNode g 
)

Checks whether f is less than or equal to g.

Returns
1 if f is less than or equal to g; 0 otherwise.

No new nodes are created.

Side effects None
See also
Cudd_bddIteConstant Cudd_addEvalConst
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddNand()

DdNode* Cudd_bddNand ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the NAND of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAnd Cudd_bddOr Cudd_bddNor Cudd_bddXor Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddNor()

DdNode* Cudd_bddNor ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the NOR of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAnd Cudd_bddOr Cudd_bddNand Cudd_bddXor Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddOr()

DdNode* Cudd_bddOr ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the disjunction of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAnd Cudd_bddNand Cudd_bddNor Cudd_bddXor Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddOrLimit()

DdNode* Cudd_bddOrLimit ( DdManager dd,
DdNode f,
DdNode g,
unsigned int  limit 
)

Computes the disjunction of two BDDs f and g unless too many nodes are required.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required.
Side effects None
See also
Cudd_bddOr
Parameters
ddmanager
ffirst operand
gsecond operand
limitmaximum number of new nodes

◆ Cudd_bddXnor()

DdNode* Cudd_bddXnor ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the exclusive NOR of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAnd Cudd_bddOr Cudd_bddNand Cudd_bddNor Cudd_bddXor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ Cudd_bddXnorLimit()

DdNode* Cudd_bddXnorLimit ( DdManager dd,
DdNode f,
DdNode g,
unsigned int  limit 
)

Computes the exclusive NOR of two BDDs f and g unless too many nodes are required.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up or more new nodes than limit are required.
Side effects None
See also
Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand
limitmaximum number of new nodes

◆ Cudd_bddXor()

DdNode* Cudd_bddXor ( DdManager dd,
DdNode f,
DdNode g 
)

Computes the exclusive OR of two BDDs f and g.

Returns
a pointer to the resulting BDD if successful; NULL if the intermediate result blows up.
Side effects None
See also
Cudd_bddIte Cudd_addApply Cudd_bddAnd Cudd_bddOr Cudd_bddNand Cudd_bddNor Cudd_bddXnor
Parameters
ddmanager
ffirst operand
gsecond operand

◆ cuddBddAndRecur()

DdNode* cuddBddAndRecur ( DdManager manager,
DdNode f,
DdNode g 
)

Implements the recursive step of Cudd_bddAnd.

Takes the conjunction of two BDDs.

Returns
a pointer to the result is successful; NULL otherwise.
Side effects None
See also
Cudd_bddAnd

◆ cuddBddIntersectRecur()

DdNode* cuddBddIntersectRecur ( DdManager dd,
DdNode f,
DdNode g 
)

Implements the recursive step of Cudd_bddIntersect.

Side effects None
See also
Cudd_bddIntersect

◆ cuddBddIteRecur()

DdNode* cuddBddIteRecur ( DdManager dd,
DdNode f,
DdNode g,
DdNode h 
)

Implements the recursive step of Cudd_bddIte.

Returns
a pointer to the resulting BDD. NULL if the intermediate result blows up or if reordering occurs.
Side effects None

◆ cuddBddXorRecur()

DdNode* cuddBddXorRecur ( DdManager manager,
DdNode f,
DdNode g 
)

Implements the recursive step of Cudd_bddXor.

Takes the exclusive OR of two BDDs.

Returns
a pointer to the result is successful; NULL otherwise.
Side effects None
See also
Cudd_bddXor