abc-master
|
Go to the source code of this file.
Data Structures | |
struct | NodeData |
struct | ApproxInfo |
struct | GlobalQueueItem |
struct | LocalQueueItem |
Macros | |
#define | DBL_MAX_EXP 1024 |
#define | NOTHING 0 |
#define | REPLACE_T 1 |
#define | REPLACE_E 2 |
#define | REPLACE_N 3 |
#define | REPLACE_TT 4 |
#define | REPLACE_TE 5 |
#define | DONT_CARE 0 |
#define | CARE 1 |
#define | TOTAL_CARE 2 |
#define | CARE_ERROR 3 |
Typedefs | |
typedef struct NodeData | NodeData |
typedef struct ApproxInfo | ApproxInfo |
typedef struct GlobalQueueItem | GlobalQueueItem |
typedef struct LocalQueueItem | LocalQueueItem |
Functions | |
static void | updateParity (DdNode *node, ApproxInfo *info, int newparity) |
static NodeData * | gatherInfoAux (DdNode *node, ApproxInfo *info, int parity) |
static ApproxInfo * | gatherInfo (DdManager *dd, DdNode *node, int numVars, int parity) |
static int | computeSavings (DdManager *dd, DdNode *f, DdNode *skip, ApproxInfo *info, DdLevelQueue *queue) |
static int | updateRefs (DdManager *dd, DdNode *f, DdNode *skip, ApproxInfo *info, DdLevelQueue *queue) |
static int | UAmarkNodes (DdManager *dd, DdNode *f, ApproxInfo *info, int threshold, int safe, double quality) |
static DdNode * | UAbuildSubset (DdManager *dd, DdNode *node, ApproxInfo *info) |
static int | RAmarkNodes (DdManager *dd, DdNode *f, ApproxInfo *info, int threshold, double quality) |
static int | BAmarkNodes (DdManager *dd, DdNode *f, ApproxInfo *info, int threshold, double quality1, double quality0) |
static DdNode * | RAbuildSubset (DdManager *dd, DdNode *node, ApproxInfo *info) |
static int | BAapplyBias (DdManager *dd, DdNode *f, DdNode *b, ApproxInfo *info, DdHashTable *cache) |
DdNode * | Cudd_UnderApprox (DdManager *dd, DdNode *f, int numVars, int threshold, int safe, double quality) |
DdNode * | Cudd_OverApprox (DdManager *dd, DdNode *f, int numVars, int threshold, int safe, double quality) |
DdNode * | Cudd_RemapUnderApprox (DdManager *dd, DdNode *f, int numVars, int threshold, double quality) |
DdNode * | Cudd_RemapOverApprox (DdManager *dd, DdNode *f, int numVars, int threshold, double quality) |
DdNode * | Cudd_BiasedUnderApprox (DdManager *dd, DdNode *f, DdNode *b, int numVars, int threshold, double quality1, double quality0) |
DdNode * | Cudd_BiasedOverApprox (DdManager *dd, DdNode *f, DdNode *b, int numVars, int threshold, double quality1, double quality0) |
DdNode * | cuddUnderApprox (DdManager *dd, DdNode *f, int numVars, int threshold, int safe, double quality) |
DdNode * | cuddRemapUnderApprox (DdManager *dd, DdNode *f, int numVars, int threshold, double quality) |
DdNode * | cuddBiasedUnderApprox (DdManager *dd, DdNode *f, DdNode *b, int numVars, int threshold, double quality1, double quality0) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddApprox.c,v 1.27 2009/02/19 16:16:51 fabio Exp $" |
#define CARE 1 |
Definition at line 100 of file cuddApprox.c.
#define CARE_ERROR 3 |
Definition at line 102 of file cuddApprox.c.
#define DBL_MAX_EXP 1024 |
CFile***********************************************************************
FileName [cuddApprox.c]
PackageName [cudd]
Synopsis [Procedures to approximate a given BDD.]
Description [External procedures provided by this module:
Internal procedures included in this module:
Static procedures included in this module:
]
SeeAlso [cuddSubsetHB.c cuddSubsetSP.c cuddGenCof.c]
Author [Fabio Somenzi]
Copyright [Copyright (c) 1995-2004, 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.]
Definition at line 79 of file cuddApprox.c.
#define DONT_CARE 0 |
Definition at line 99 of file cuddApprox.c.
#define NOTHING 0 |
Definition at line 92 of file cuddApprox.c.
#define REPLACE_E 2 |
Definition at line 94 of file cuddApprox.c.
#define REPLACE_N 3 |
Definition at line 95 of file cuddApprox.c.
#define REPLACE_T 1 |
Definition at line 93 of file cuddApprox.c.
#define REPLACE_TE 5 |
Definition at line 97 of file cuddApprox.c.
#define REPLACE_TT 4 |
Definition at line 96 of file cuddApprox.c.
#define TOTAL_CARE 2 |
Definition at line 101 of file cuddApprox.c.
typedef struct ApproxInfo ApproxInfo |
typedef struct GlobalQueueItem GlobalQueueItem |
typedef struct LocalQueueItem LocalQueueItem |
|
static |
Function********************************************************************
Synopsis [Finds don't care nodes.]
Description [Finds don't care nodes by traversing f and b in parallel. Returns the care status of the visited f node if successful; CARE_ERROR otherwise.]
SideEffects [None]
SeeAlso [cuddBiasedUnderApprox]
Definition at line 2138 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Marks nodes for remapping.]
Description [Marks nodes for remapping. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddRemapUnderApprox]
Definition at line 1673 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Counts the nodes that would be eliminated if a given node were replaced by zero.]
Description [Counts the nodes that would be eliminated if a given node were replaced by zero. This procedure uses a queue passed by the caller for efficiency: since the queue is left empty at the endof the search, it can be reused as is by the next search. Returns the count (always striclty positive) if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddUnderApprox]
Definition at line 1001 of file cuddApprox.c.
DdNode* Cudd_BiasedOverApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
DdNode * | b, | ||
int | numVars, | ||
int | threshold, | ||
double | quality1, | ||
double | quality0 | ||
) |
Function********************************************************************
Synopsis [Extracts a dense superset from a BDD with the biased underapproximation method.]
Description [Extracts a dense superset from a BDD. The procedure is identical to the underapproximation procedure except for the fact that it works on the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SupersetHeavyBranch Cudd_SupersetShortPaths Cudd_RemapOverApprox Cudd_BiasedUnderApprox Cudd_ReadSize]
Definition at line 463 of file cuddApprox.c.
DdNode* Cudd_BiasedUnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
DdNode * | b, | ||
int | numVars, | ||
int | threshold, | ||
double | quality1, | ||
double | quality0 | ||
) |
Function********************************************************************
Synopsis [Extracts a dense subset from a BDD with the biased underapproximation method.]
Description [Extracts a dense subset from a BDD. This procedure uses a biased remapping technique and density as the cost function. The bias is a function. This procedure tries to approximate where the bias is 0 and preserve the given function where the bias is 1. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will cause overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SubsetShortPaths Cudd_SubsetHeavyBranch Cudd_UnderApprox Cudd_RemapUnderApprox Cudd_ReadSize]
Definition at line 413 of file cuddApprox.c.
DdNode* Cudd_OverApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
int | safe, | ||
double | quality | ||
) |
Function********************************************************************
Synopsis [Extracts a dense superset from a BDD with Shiple's underapproximation method.]
Description [Extracts a dense superset from a BDD. The procedure is identical to the underapproximation procedure except for the fact that it works on the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SupersetHeavyBranch Cudd_SupersetShortPaths Cudd_ReadSize]
Definition at line 275 of file cuddApprox.c.
DdNode* Cudd_RemapOverApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
double | quality | ||
) |
Function********************************************************************
Synopsis [Extracts a dense superset from a BDD with the remapping underapproximation method.]
Description [Extracts a dense superset from a BDD. The procedure is identical to the underapproximation procedure except for the fact that it works on the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. Returns a pointer to the BDD of the superset if successful. NULL if intermediate result causes the procedure to run out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SupersetHeavyBranch Cudd_SupersetShortPaths Cudd_ReadSize]
Definition at line 366 of file cuddApprox.c.
DdNode* Cudd_RemapUnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
double | quality | ||
) |
Function********************************************************************
Synopsis [Extracts a dense subset from a BDD with the remapping underapproximation method.]
Description [Extracts a dense subset from a BDD. This procedure uses a remapping technique and density as the cost function. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will cause overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SubsetShortPaths Cudd_SubsetHeavyBranch Cudd_UnderApprox Cudd_ReadSize]
Definition at line 320 of file cuddApprox.c.
DdNode* Cudd_UnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
int | safe, | ||
double | quality | ||
) |
AutomaticEnd Function********************************************************************
Synopsis [Extracts a dense subset from a BDD with Shiple's underapproximation method.]
Description [Extracts a dense subset from a BDD. This procedure uses a variant of Tom Shiple's underapproximation method. The main difference from the original method is that density is used as cost function. Returns a pointer to the BDD of the subset if successful. NULL if the procedure runs out of memory. The parameter numVars is the maximum number of variables to be used in minterm calculation. The optimal number should be as close as possible to the size of the support of f. However, it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023. If numVars is larger than 1023, it will cause overflow. If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more.]
SideEffects [None]
SeeAlso [Cudd_SubsetShortPaths Cudd_SubsetHeavyBranch Cudd_ReadSize]
Definition at line 228 of file cuddApprox.c.
DdNode* cuddBiasedUnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
DdNode * | b, | ||
int | numVars, | ||
int | threshold, | ||
double | quality1, | ||
double | quality0 | ||
) |
Function********************************************************************
Synopsis [Applies the biased remapping underappoximation algorithm.]
Description [Applies the biased remapping underappoximation algorithm. Proceeds in three phases:
Returns the approximated BDD if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [Cudd_BiasedUnderApprox]
Definition at line 691 of file cuddApprox.c.
DdNode* cuddRemapUnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
double | quality | ||
) |
Function********************************************************************
Synopsis [Applies the remapping underappoximation algorithm.]
Description [Applies the remapping underappoximation algorithm. Proceeds in three phases:
Returns the approximated BDD if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [Cudd_RemapUnderApprox]
Definition at line 601 of file cuddApprox.c.
DdNode* cuddUnderApprox | ( | DdManager * | dd, |
DdNode * | f, | ||
int | numVars, | ||
int | threshold, | ||
int | safe, | ||
double | quality | ||
) |
Function********************************************************************
Synopsis [Applies Tom Shiple's underappoximation algorithm.]
Description [Applies Tom Shiple's underappoximation algorithm. Proceeds in three phases:
Returns the approximated BDD if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [Cudd_UnderApprox]
Definition at line 511 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Gathers information about each node.]
Description [Counts minterms and computes reference counts of each node in the BDD . The minterm count is separately computed for the node and its complement. This is to avoid cancellation errors. Returns a pointer to the data structure holding the information gathered if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddUnderApprox gatherInfoAux]
Definition at line 907 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Recursively counts minterms and computes reference counts of each node in the BDD.]
Description [Recursively counts minterms and computes reference counts of each node in the BDD. Similar to the cuddCountMintermAux which recursively counts the number of minterms for the dag rooted at each node in terms of the total number of variables (max). It assumes that the node pointer passed to it is regular and it maintains the invariant.]
SideEffects [None]
SeeAlso [gatherInfo]
Definition at line 837 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Builds the subset BDD for cuddRemapUnderApprox.]
Description [Builds the subset BDDfor cuddRemapUnderApprox. Based on the info table, performs remapping or replacement at selected nodes. Returns a pointer to the result if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddRemapUnderApprox]
Definition at line 1990 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Marks nodes for remapping.]
Description [Marks nodes for remapping. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddRemapUnderApprox]
Definition at line 1371 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Builds the subset BDD.]
Description [Builds the subset BDD. Based on the info table, replaces selected nodes by zero. Returns a pointer to the result if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [cuddUnderApprox]
Definition at line 1276 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Marks nodes for replacement by zero.]
Description [Marks nodes for replacement by zero. Returns 1 if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [cuddUnderApprox]
Definition at line 1152 of file cuddApprox.c.
|
static |
AutomaticStart
Function********************************************************************
Synopsis [Recursively update the parity of the paths reaching a node.]
Description [Recursively update the parity of the paths reaching a node. Assumes that node is regular and propagates the invariant.]
SideEffects [None]
SeeAlso [gatherInfoAux]
Definition at line 795 of file cuddApprox.c.
|
static |
Function********************************************************************
Synopsis [Update function reference counts.]
Description [Update function reference counts to account for replacement. Returns the number of nodes saved if successful; 0 otherwise.]
SideEffects [None]
SeeAlso [UAmarkNodes RAmarkNodes]
Definition at line 1073 of file cuddApprox.c.
|
static |
Definition at line 171 of file cuddApprox.c.