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

Functions that manipulate the reference counts. More...

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

Functions

void Cudd_Ref (DdNode *n)
 Increases the reference count of a node, if it is not saturated. More...
 
void Cudd_RecursiveDeref (DdManager *table, DdNode *n)
 Decreases the reference count of node n. More...
 
void Cudd_IterDerefBdd (DdManager *table, DdNode *n)
 Decreases the reference count of BDD node n. More...
 
void Cudd_DelayedDerefBdd (DdManager *table, DdNode *n)
 Decreases the reference count of BDD node n. More...
 
void Cudd_RecursiveDerefZdd (DdManager *table, DdNode *n)
 Decreases the reference count of ZDD node n. More...
 
void Cudd_Deref (DdNode *node)
 Decreases the reference count of node. More...
 
int Cudd_CheckZeroRef (DdManager *manager)
 Checks the unique table for nodes with non-zero reference counts. More...
 
void cuddReclaim (DdManager *table, DdNode *n)
 Brings children of a dead node back. More...
 
void cuddReclaimZdd (DdManager *table, DdNode *n)
 Brings children of a dead ZDD node back. More...
 
void cuddShrinkDeathRow (DdManager *table)
 Shrinks the death row. More...
 
void cuddClearDeathRow (DdManager *table)
 Clears the death row. More...
 
int cuddIsInDeathRow (DdManager *dd, DdNode *f)
 Checks whether a node is in the death row. More...
 
int cuddTimesInDeathRow (DdManager *dd, DdNode *f)
 Counts how many times a node is in the death row. More...
 

Detailed Description

Functions that manipulate the reference counts.

Author
Fabio Somenzi

Function Documentation

◆ Cudd_CheckZeroRef()

int Cudd_CheckZeroRef ( DdManager manager)

Checks the unique table for nodes with non-zero reference counts.

It is normally called before Cudd_Quit to make sure that there are no memory leaks due to missing Cudd_RecursiveDeref's. Takes into account that reference counts may saturate and that the basic constants and the projection functions are referenced by the manager.

Returns
the number of nodes with non-zero reference count. (Except for the cases mentioned above.)
Side effects None

◆ Cudd_DelayedDerefBdd()

void Cudd_DelayedDerefBdd ( DdManager table,
DdNode n 
)

Decreases the reference count of BDD node n.

Enqueues node n for later dereferencing. If the queue is full decreases the reference count of the oldest node N to make room for n. If N dies, recursively decreases the reference counts of its children. It is used to dispose of a BDD that is currently not needed, but may be useful again in the near future. The dereferencing proper is done as in Cudd_IterDerefBdd.

Side effects None
See also
Cudd_RecursiveDeref Cudd_IterDerefBdd

◆ Cudd_Deref()

void Cudd_Deref ( DdNode node)

Decreases the reference count of node.

It is primarily used in recursive procedures to decrease the ref count of a result node before returning it. This accomplishes the goal of removing the protection applied by a previous Cudd_Ref.

Side effects None
See also
Cudd_RecursiveDeref Cudd_RecursiveDerefZdd Cudd_Ref

◆ Cudd_IterDerefBdd()

void Cudd_IterDerefBdd ( DdManager table,
DdNode n 
)

Decreases the reference count of BDD node n.

If n dies, recursively decreases the reference counts of its children. It is used to dispose of a BDD that is no longer needed. It is more efficient than Cudd_RecursiveDeref, but it cannot be used on ADDs. The greater efficiency comes from being able to assume that no constant node will ever die as a result of a call to this procedure.

Side effects None
See also
Cudd_RecursiveDeref Cudd_DelayedDerefBdd

◆ Cudd_RecursiveDeref()

void Cudd_RecursiveDeref ( DdManager table,
DdNode n 
)

Decreases the reference count of node n.

If n dies, recursively decreases the reference counts of its children. It is used to dispose of a DD that is no longer needed.

Side effects None
See also
Cudd_Deref Cudd_Ref Cudd_RecursiveDerefZdd

◆ Cudd_RecursiveDerefZdd()

void Cudd_RecursiveDerefZdd ( DdManager table,
DdNode n 
)

Decreases the reference count of ZDD node n.

If n dies, recursively decreases the reference counts of its children. It is used to dispose of a ZDD that is no longer needed.

Side effects None
See also
Cudd_Deref Cudd_Ref Cudd_RecursiveDeref

◆ Cudd_Ref()

void Cudd_Ref ( DdNode n)

Increases the reference count of a node, if it is not saturated.

Side effects None
See also
Cudd_RecursiveDeref Cudd_Deref

◆ cuddClearDeathRow()

void cuddClearDeathRow ( DdManager table)

Clears the death row.

Side effects None
See also
Cudd_DelayedDerefBdd Cudd_IterDerefBdd Cudd_CheckZeroRef cuddGarbageCollect

◆ cuddIsInDeathRow()

int cuddIsInDeathRow ( DdManager dd,
DdNode f 
)

Checks whether a node is in the death row.

Returns
the position of the first occurrence if the node is present; -1 otherwise.
Side effects None
See also
Cudd_DelayedDerefBdd cuddClearDeathRow

◆ cuddReclaim()

void cuddReclaim ( DdManager table,
DdNode n 
)

Brings children of a dead node back.

Side effects None
See also
cuddReclaimZdd

◆ cuddReclaimZdd()

void cuddReclaimZdd ( DdManager table,
DdNode n 
)

Brings children of a dead ZDD node back.

Side effects None
See also
cuddReclaim

◆ cuddShrinkDeathRow()

void cuddShrinkDeathRow ( DdManager table)

Shrinks the death row.

Shrinks the death row by a factor of four.

Side effects None
See also
cuddClearDeathRow

◆ cuddTimesInDeathRow()

int cuddTimesInDeathRow ( DdManager dd,
DdNode f 
)

Counts how many times a node is in the death row.

Side effects None
See also
Cudd_DelayedDerefBdd cuddClearDeathRow cuddIsInDeathRow