abc-master
|
Go to the source code of this file.
Data Structures | |
struct | NodeData |
Macros | |
#define | DBL_MAX_EXP 1024 |
#define | DEFAULT_PAGE_SIZE 2048 |
#define | DEFAULT_NODE_DATA_PAGE_SIZE 1024 |
#define | INITIAL_PAGES 128 |
Typedefs | |
typedef struct NodeData | NodeData_t |
Functions | |
static void | ResizeNodeDataPages (void) |
static void | ResizeCountMintermPages (void) |
static void | ResizeCountNodePages (void) |
static double | SubsetCountMintermAux (DdNode *node, double max, st__table *table) |
static st__table * | SubsetCountMinterm (DdNode *node, int nvars) |
static int | SubsetCountNodesAux (DdNode *node, st__table *table, double max) |
static int | SubsetCountNodes (DdNode *node, st__table *table, int nvars) |
static void | StoreNodes (st__table *storeTable, DdManager *dd, DdNode *node) |
static DdNode * | BuildSubsetBdd (DdManager *dd, DdNode *node, int *size, st__table *visitedTable, int threshold, st__table *storeTable, st__table *approxTable) |
DdNode * | Cudd_SubsetHeavyBranch (DdManager *dd, DdNode *f, int numVars, int threshold) |
DdNode * | Cudd_SupersetHeavyBranch (DdManager *dd, DdNode *f, int numVars, int threshold) |
DdNode * | cuddSubsetHeavyBranch (DdManager *dd, DdNode *f, int numVars, int threshold) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddSubsetHB.c,v 1.37 2009/02/20 02:14:58 fabio Exp $" |
static int | memOut |
static DdNode * | zero |
static DdNode * | one |
static double ** | mintermPages |
static int ** | nodePages |
static int ** | lightNodePages |
static double * | currentMintermPage |
static double | max |
static int * | currentNodePage |
static int * | currentLightNodePage |
static int | pageIndex |
static int | page |
static int | pageSize = DEFAULT_PAGE_SIZE |
static int | maxPages |
static NodeData_t * | currentNodeDataPage |
static int | nodeDataPage |
static int | nodeDataPageIndex |
static NodeData_t ** | nodeDataPages |
static int | nodeDataPageSize = DEFAULT_NODE_DATA_PAGE_SIZE |
static int | maxNodeDataPages |
#define DBL_MAX_EXP 1024 |
CFile***********************************************************************
FileName [cuddSubsetHB.c]
PackageName [cudd]
Synopsis [Procedure to subset the given BDD by choosing the heavier branches.]
Description [External procedures provided by this module:
Internal procedures included in this module:
Static procedures included in this module:
]
SeeAlso [cuddSubsetSP.c]
Author [Kavita Ravi]
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 74 of file cuddSubsetHB.c.
#define DEFAULT_NODE_DATA_PAGE_SIZE 1024 |
Definition at line 88 of file cuddSubsetHB.c.
#define DEFAULT_PAGE_SIZE 2048 |
Definition at line 87 of file cuddSubsetHB.c.
#define INITIAL_PAGES 128 |
Definition at line 89 of file cuddSubsetHB.c.
typedef struct NodeData NodeData_t |
Definition at line 113 of file cuddSubsetHB.c.
|
static |
Function********************************************************************
Synopsis [Builds the subset BDD using the heavy branch method.]
Description [The procedure carries out the building of the subset BDD starting at the root. Using the three different counts labelling each node, the procedure chooses the heavier branch starting from the root and keeps track of the number of nodes it discards at each step, thus keeping count of the size of the subset BDD dynamically. Once the threshold is satisfied, the procedure then calls ITE to build the BDD.]
SideEffects [None]
SeeAlso []
Definition at line 1158 of file cuddSubsetHB.c.
AutomaticEnd Function********************************************************************
Synopsis [Extracts a dense subset from a BDD with the heavy branch heuristic.]
Description [Extracts a dense subset from a BDD. This procedure builds a subset by throwing away one of the children of each node, starting from the root, until the result is small enough. The child that is eliminated from the result is the one that contributes the fewer minterms. 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 and node count 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_SubsetShortPaths Cudd_SupersetHeavyBranch Cudd_ReadSize]
Definition at line 209 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Extracts a dense superset from a BDD with the heavy branch heuristic.]
Description [Extracts a dense superset from a BDD. The procedure is identical to the subset procedure except for the fact that it receives the complement of the given function. Extracting the subset of the complement function is equivalent to extracting the superset of the function. This procedure builds a superset by throwing away one of the children of each node starting from the root of the complement function, until the result is small enough. The child that is eliminated from the result is the one that contributes the fewer minterms. 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 and node count 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_SubsetHeavyBranch Cudd_SupersetShortPaths Cudd_ReadSize]
Definition at line 259 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [The main procedure that returns a subset by choosing the heavier branch in the BDD.]
Description [Here a subset BDD is built by throwing away one of the children. Starting at root, annotate each node with the number of minterms (in terms of the total number of variables specified - numVars), number of nodes taken by the DAG rooted at this node and number of additional nodes taken by the child that has the lesser minterms. The child with the lower number of minterms is thrown away and a dyanmic count of the nodes of the subset is kept. Once the threshold is reached the subset is returned to the calling procedure.]
SideEffects [None]
SeeAlso [Cudd_SubsetHeavyBranch]
Definition at line 305 of file cuddSubsetHB.c.
|
static |
Function********************************************************************
Synopsis [Resize the number of pages allocated to store the minterm counts. ]
Description [Resize the number of pages allocated to store the minterm counts. The procedure moves the counter to the next page when the end of the page is reached and allocates new pages when necessary.]
SideEffects [Changes the size of minterm pages, page, page index, maximum number of pages freeing stuff in case of memory out. ]
SeeAlso []
Definition at line 533 of file cuddSubsetHB.c.
|
static |
Function********************************************************************
Synopsis [Resize the number of pages allocated to store the node counts.]
Description [Resize the number of pages allocated to store the node counts. The procedure moves the counter to the next page when the end of the page is reached and allocates new pages when necessary.]
SideEffects [Changes the size of pages, page, page index, maximum number of pages freeing stuff in case of memory out.]
SeeAlso []
Definition at line 590 of file cuddSubsetHB.c.
|
static |
AutomaticStart
Function********************************************************************
Synopsis [Resize the number of pages allocated to store the node data.]
Description [Resize the number of pages allocated to store the node data The procedure moves the counter to the next page when the end of the page is reached and allocates new pages when necessary.]
SideEffects [Changes the size of pages, page, page index, maximum number of pages freeing stuff in case of memory out. ]
SeeAlso []
Definition at line 474 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Procedure to recursively store nodes that are retained in the subset.]
Description [rocedure to recursively store nodes that are retained in the subset.]
SideEffects [None]
SeeAlso [StoreNodes]
Definition at line 1113 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Counts minterms of each node in the DAG]
Description [Counts minterms of each node in the DAG. Similar to the Cudd_CountMinterm procedure except this returns the minterm count for all the nodes in the bdd in an st__table.]
SideEffects [none]
SeeAlso [SubsetCountMintermAux]
Definition at line 791 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Recursively counts minterms of each node in the DAG.]
Description [Recursively counts minterms of each node in the DAG. 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). This procedure creates the node data structure and stores the minterm count as part of the node data structure. ]
SideEffects [Creates structures of type node quality and fills the st__table]
SeeAlso [SubsetCountMinterm]
Definition at line 680 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Counts the nodes under the current node and its lighter child]
Description [Counts the nodes under the current node and its lighter child. Calls a recursive procedure to count the number of nodes of a DAG rooted at a particular node and the number of nodes taken by its lighter child.]
SideEffects [None]
SeeAlso [SubsetCountNodesAux]
Definition at line 1036 of file cuddSubsetHB.c.
Function********************************************************************
Synopsis [Recursively counts the number of nodes under the dag. Also counts the number of nodes under the lighter child of this node.]
Description [Recursively counts the number of nodes under the dag. Also counts the number of nodes under the lighter child of this node. . Note that the same dag may be the lighter child of two different nodes and have different counts. As with the minterm counts, the node counts are stored in pages to be space efficient and the address for these node counts are stored in an st__table associated to each node. ]
SideEffects [Updates the node data table with node counts]
SeeAlso [SubsetCountNodes]
Definition at line 872 of file cuddSubsetHB.c.
|
static |
Definition at line 139 of file cuddSubsetHB.c.
|
static |
Definition at line 132 of file cuddSubsetHB.c.
|
static |
Definition at line 146 of file cuddSubsetHB.c.
|
static |
Definition at line 137 of file cuddSubsetHB.c.
|
static |
Definition at line 120 of file cuddSubsetHB.c.
|
static |
Definition at line 131 of file cuddSubsetHB.c.
|
static |
Definition at line 134 of file cuddSubsetHB.c.
|
static |
Definition at line 153 of file cuddSubsetHB.c.
|
static |
Definition at line 144 of file cuddSubsetHB.c.
|
static |
Definition at line 123 of file cuddSubsetHB.c.
|
static |
Definition at line 129 of file cuddSubsetHB.c.
|
static |
Definition at line 148 of file cuddSubsetHB.c.
|
static |
Definition at line 149 of file cuddSubsetHB.c.
|
static |
Definition at line 150 of file cuddSubsetHB.c.
|
static |
Definition at line 151 of file cuddSubsetHB.c.
|
static |
Definition at line 130 of file cuddSubsetHB.c.
|
static |
Definition at line 128 of file cuddSubsetHB.c.
|
static |
Definition at line 142 of file cuddSubsetHB.c.
|
static |
Definition at line 141 of file cuddSubsetHB.c.
|
static |
Definition at line 143 of file cuddSubsetHB.c.
|
static |
Definition at line 128 of file cuddSubsetHB.c.