cudd/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.
void Cudd_RecursiveDeref (DdManager *table, DdNode *n)
 Decreases the reference count of node n.
void Cudd_IterDerefBdd (DdManager *table, DdNode *n)
 Decreases the reference count of BDD node n.
void Cudd_DelayedDerefBdd (DdManager *table, DdNode *n)
 Decreases the reference count of BDD node n.
void Cudd_RecursiveDerefZdd (DdManager *table, DdNode *n)
 Decreases the reference count of ZDD node n.
void Cudd_Deref (DdNode *node)
 Decreases the reference count of node.
int Cudd_CheckZeroRef (DdManager *manager)
 Checks the unique table for nodes with non-zero reference counts.
void cuddReclaim (DdManager *table, DdNode *n)
 Brings children of a dead node back.
void cuddReclaimZdd (DdManager *table, DdNode *n)
 Brings children of a dead ZDD node back.
void cuddShrinkDeathRow (DdManager *table)
 Shrinks the death row.
void cuddClearDeathRow (DdManager *table)
 Clears the death row.
int cuddIsInDeathRow (DdManager *dd, DdNode *f)
 Checks whether a node is in the death row.
int cuddTimesInDeathRow (DdManager *dd, DdNode *f)
 Counts how many times a node is in the death row.

Detailed Description

Functions that manipulate the reference counts.

Author:
Fabio Somenzi

Copyright (c) 1995-2015, Regents of the University of Colorado

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Function Documentation

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
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
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
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
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
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
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
void cuddClearDeathRow ( DdManager table  ) 

Clears the death row.

Side effects
None
See also:
Cudd_DelayedDerefBdd Cudd_IterDerefBdd Cudd_CheckZeroRef cuddGarbageCollect
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
void cuddReclaim ( DdManager table,
DdNode n 
)

Brings children of a dead node back.

Side effects
None
See also:
cuddReclaimZdd
void cuddReclaimZdd ( DdManager table,
DdNode n 
)

Brings children of a dead ZDD node back.

Side effects
None
See also:
cuddReclaim
void cuddShrinkDeathRow ( DdManager table  ) 

Shrinks the death row.

Shrinks the death row by a factor of four.

Side effects
None
See also:
cuddClearDeathRow
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
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1