abc-master
|
Go to the source code of this file.
Data Structures | |
struct | Conjuncts |
struct | NodeStat |
Macros | |
#define | DEPTH 5 |
#define | THRESHOLD 10 |
#define | NONE 0 |
#define | PAIR_ST 1 |
#define | PAIR_CR 2 |
#define | G_ST 3 |
#define | G_CR 4 |
#define | H_ST 5 |
#define | H_CR 6 |
#define | BOTH_G 7 |
#define | BOTH_H 8 |
#define | FactorsNotStored(factors) ((int)((long)(factors) & 01)) |
#define | FactorsComplement(factors) ((Conjuncts *)((long)(factors) | 01)) |
#define | FactorsUncomplement(factors) ((Conjuncts *)((long)(factors) ^ 01)) |
Typedefs | |
typedef struct Conjuncts | Conjuncts |
typedef struct NodeStat | NodeStat |
Functions | |
static NodeStat * | CreateBotDist (DdNode *node, st__table *distanceTable) |
static double | CountMinterms (DdNode *node, double max, st__table *mintermTable, FILE *fp) |
static void | ConjunctsFree (DdManager *dd, Conjuncts *factors) |
static int | PairInTables (DdNode *g, DdNode *h, st__table *ghTable) |
static Conjuncts * | CheckTablesCacheAndReturn (DdNode *node, DdNode *g, DdNode *h, st__table *ghTable, st__table *cacheTable) |
static Conjuncts * | PickOnePair (DdNode *node, DdNode *g1, DdNode *h1, DdNode *g2, DdNode *h2, st__table *ghTable, st__table *cacheTable) |
static Conjuncts * | CheckInTables (DdNode *node, DdNode *g1, DdNode *h1, DdNode *g2, DdNode *h2, st__table *ghTable, st__table *cacheTable, int *outOfMem) |
static Conjuncts * | ZeroCase (DdManager *dd, DdNode *node, Conjuncts *factorsNv, st__table *ghTable, st__table *cacheTable, int switched) |
static Conjuncts * | BuildConjuncts (DdManager *dd, DdNode *node, st__table *distanceTable, st__table *cacheTable, int approxDistance, int maxLocalRef, st__table *ghTable, st__table *mintermTable) |
static int | cuddConjunctsAux (DdManager *dd, DdNode *f, DdNode **c1, DdNode **c2) |
int | Cudd_bddApproxConjDecomp (DdManager *dd, DdNode *f, DdNode ***conjuncts) |
int | Cudd_bddApproxDisjDecomp (DdManager *dd, DdNode *f, DdNode ***disjuncts) |
int | Cudd_bddIterConjDecomp (DdManager *dd, DdNode *f, DdNode ***conjuncts) |
int | Cudd_bddIterDisjDecomp (DdManager *dd, DdNode *f, DdNode ***disjuncts) |
int | Cudd_bddGenConjDecomp (DdManager *dd, DdNode *f, DdNode ***conjuncts) |
int | Cudd_bddGenDisjDecomp (DdManager *dd, DdNode *f, DdNode ***disjuncts) |
int | Cudd_bddVarConjDecomp (DdManager *dd, DdNode *f, DdNode ***conjuncts) |
int | Cudd_bddVarDisjDecomp (DdManager *dd, DdNode *f, DdNode ***disjuncts) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddDecomp.c,v 1.44 2004/08/13 18:04:47 fabio Exp $" |
static DdNode * | one |
static DdNode * | zero |
long | lastTimeG |
#define BOTH_G 7 |
Definition at line 83 of file cuddDecomp.c.
#define BOTH_H 8 |
Definition at line 84 of file cuddDecomp.c.
#define DEPTH 5 |
CFile***********************************************************************
FileName [cuddDecomp.c]
PackageName [cudd]
Synopsis [Functions for BDD decomposition.]
Description [External procedures included in this file:
Static procedures included in this module:
]
Author [Kavita Ravi, 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 74 of file cuddDecomp.c.
#define FactorsComplement | ( | factors | ) | ((Conjuncts *)((long)(factors) | 01)) |
Definition at line 122 of file cuddDecomp.c.
#define FactorsNotStored | ( | factors | ) | ((int)((long)(factors) & 01)) |
Definition at line 120 of file cuddDecomp.c.
#define FactorsUncomplement | ( | factors | ) | ((Conjuncts *)((long)(factors) ^ 01)) |
Definition at line 124 of file cuddDecomp.c.
#define G_CR 4 |
Definition at line 80 of file cuddDecomp.c.
#define G_ST 3 |
Definition at line 79 of file cuddDecomp.c.
#define H_CR 6 |
Definition at line 82 of file cuddDecomp.c.
#define H_ST 5 |
Definition at line 81 of file cuddDecomp.c.
#define NONE 0 |
Definition at line 76 of file cuddDecomp.c.
#define PAIR_CR 2 |
Definition at line 78 of file cuddDecomp.c.
#define PAIR_ST 1 |
Definition at line 77 of file cuddDecomp.c.
#define THRESHOLD 10 |
Definition at line 75 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [Builds the conjuncts recursively, bottom up.]
Description [Builds the conjuncts recursively, bottom up. Constants are returned as (f, f). The cache is checked for previously computed result. The decomposition points are determined by the local reference count of this node and the longest distance from the constant. At the decomposition point, the factors returned are (f, 1). Recur on the two children. The order is determined by the heavier branch. Combine the factors of the two children and pick the one that already occurs in the gh table. Occurence in g is indicated by value 1, occurence in h by 2, occurence in both 3.]
SideEffects []
SeeAlso [cuddConjunctsAux]
Definition at line 1685 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [Check if the two pairs exist in the table, If any of the conjuncts do exist, store in the cache and return the corresponding pair.]
Description [Check if the two pairs exist in the table. If any of the conjuncts do exist, store in the cache and return the corresponding pair.]
SideEffects []
SeeAlso [ZeroCase BuildConjuncts]
Definition at line 1217 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [Check the tables for the existence of pair and return one combination, cache the result.]
Description [Check the tables for the existence of pair and return one combination, cache the result. The assumption is that one of the conjuncts is already in the tables.]
SideEffects [g and h referenced for the cache]
SeeAlso [ZeroCase]
Definition at line 994 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Free factors structure]
Description []
SideEffects [None]
SeeAlso []
Definition at line 904 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [Count the number of minterms of each node ina a BDD and store it in a hash table.]
Description []
SideEffects [None]
SeeAlso []
Definition at line 841 of file cuddDecomp.c.
AutomaticStart
Function********************************************************************
Synopsis [Get longest distance of node from constant.]
Description [Get longest distance of node from constant. Returns the distance of the root from the constant if successful; CUDD_OUT_OF_MEM otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 772 of file cuddDecomp.c.
AutomaticEnd Function********************************************************************
Synopsis [Performs two-way conjunctive decomposition of a BDD.]
Description [Performs two-way conjunctive decomposition of a BDD. This procedure owes its name to the use of supersetting to obtain an initial factor of the given function. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The conjuncts produced by this procedure tend to be imbalanced.]
SideEffects [The factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddApproxDisjDecomp Cudd_bddIterConjDecomp Cudd_bddGenConjDecomp Cudd_bddVarConjDecomp Cudd_RemapOverApprox Cudd_bddSqueeze Cudd_bddLICompaction]
Definition at line 175 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way disjunctive decomposition of a BDD.]
Description [Performs two-way disjunctive decomposition of a BDD. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The disjuncts produced by this procedure tend to be imbalanced.]
SideEffects [The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddApproxConjDecomp Cudd_bddIterDisjDecomp Cudd_bddGenDisjDecomp Cudd_bddVarDisjDecomp]
Definition at line 273 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way conjunctive decomposition of a BDD.]
Description [Performs two-way conjunctive decomposition of a BDD. This procedure owes its name to the fact tht it generalizes the decomposition based on the cofactors with respect to one variable. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The conjuncts produced by this procedure tend to be balanced.]
SideEffects [The two factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddGenDisjDecomp Cudd_bddApproxConjDecomp Cudd_bddIterConjDecomp Cudd_bddVarConjDecomp]
Definition at line 496 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way disjunctive decomposition of a BDD.]
Description [Performs two-way disjunctive decomposition of a BDD. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The disjuncts produced by this procedure tend to be balanced.]
SideEffects [The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddGenConjDecomp Cudd_bddApproxDisjDecomp Cudd_bddIterDisjDecomp Cudd_bddVarDisjDecomp]
Definition at line 575 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way conjunctive decomposition of a BDD.]
Description [Performs two-way conjunctive decomposition of a BDD. This procedure owes its name to the iterated use of supersetting to obtain a factor of the given function. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The conjuncts produced by this procedure tend to be imbalanced.]
SideEffects [The factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddIterDisjDecomp Cudd_bddApproxConjDecomp Cudd_bddGenConjDecomp Cudd_bddVarConjDecomp Cudd_RemapOverApprox Cudd_bddSqueeze Cudd_bddLICompaction]
Definition at line 313 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way disjunctive decomposition of a BDD.]
Description [Performs two-way disjunctive decomposition of a BDD. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise. The disjuncts produced by this procedure tend to be imbalanced.]
SideEffects [The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddIterConjDecomp Cudd_bddApproxDisjDecomp Cudd_bddGenDisjDecomp Cudd_bddVarDisjDecomp]
Definition at line 456 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way conjunctive decomposition of a BDD.]
Description [Conjunctively decomposes one BDD according to a variable. If f
is the function of the BDD and x
is the variable, the decomposition is (f+x)(f+x')
. The variable is chosen so as to balance the sizes of the two conjuncts and to keep them small. Returns the number of conjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise.]
SideEffects [The two factors are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the conjuncts are already referenced. If the function returns 0, the array for the conjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddVarDisjDecomp Cudd_bddGenConjDecomp Cudd_bddApproxConjDecomp Cudd_bddIterConjDecomp]
Definition at line 615 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Performs two-way disjunctive decomposition of a BDD.]
Description [Performs two-way disjunctive decomposition of a BDD according to a variable. If f
is the function of the BDD and x
is the variable, the decomposition is f*x + f*x'
. The variable is chosen so as to balance the sizes of the two disjuncts and to keep them small. Returns the number of disjuncts produced, that is, 2 if successful; 1 if no meaningful decomposition was found; 0 otherwise.]
SideEffects [The two disjuncts are returned in an array as side effects. The array is allocated by this function. It is the caller's responsibility to free it. On successful completion, the disjuncts are already referenced. If the function returns 0, the array for the disjuncts is not allocated. If the function returns 1, the only factor equals the function to be decomposed.]
SeeAlso [Cudd_bddVarConjDecomp Cudd_bddApproxDisjDecomp Cudd_bddIterDisjDecomp Cudd_bddGenDisjDecomp]
Definition at line 733 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Procedure to compute two conjunctive factors of f and place in *c1 and *c2.]
Description [Procedure to compute two conjunctive factors of f and place in *c1 and *c2. Sets up the required data - table of distances from the constant and local reference count. Also minterm table. ]
SideEffects []
SeeAlso []
Definition at line 2005 of file cuddDecomp.c.
Function********************************************************************
Synopsis [Check whether the given pair is in the tables.]
Description [.Check whether the given pair is in the tables. gTable and hTable are combined. absence in both is indicated by 0, presence in gTable is indicated by 1, presence in hTable by 2 and presence in both by 3. The values returned by this function are PAIR_ST, PAIR_CR, G_ST, G_CR, H_ST, H_CR, BOTH_G, BOTH_H, NONE. PAIR_ST implies g in gTable and h in hTable PAIR_CR implies g in hTable and h in gTable G_ST implies g in gTable and h not in any table G_CR implies g in hTable and h not in any table H_ST implies h in hTable and g not in any table H_CR implies h in gTable and g not in any table BOTH_G implies both in gTable BOTH_H implies both in hTable NONE implies none in table; ]
SideEffects []
SeeAlso [CheckTablesCacheAndReturn CheckInTables]
Definition at line 944 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [Check the tables for the existence of pair and return one combination, store in cache.]
Description [Check the tables for the existence of pair and return one combination, store in cache. The pair that has more pointers to it is picked. An approximation of the number of local pointers is made by taking the reference count of the pairs sent. ]
SideEffects []
SeeAlso [ZeroCase BuildConjuncts]
Definition at line 1099 of file cuddDecomp.c.
|
static |
Function********************************************************************
Synopsis [If one child is zero, do explicitly what Restrict does or better]
Description [If one child is zero, do explicitly what Restrict does or better. First separate a variable and its child in the base case. In case of a cube times a function, separate the cube and function. As a last resort, look in tables.]
SideEffects [Frees the BDDs in factorsNv. factorsNv itself is not freed because it is freed above.]
SeeAlso [BuildConjuncts]
Definition at line 1447 of file cuddDecomp.c.
|
static |
Definition at line 109 of file cuddDecomp.c.
long lastTimeG |
Definition at line 113 of file cuddDecomp.c.
|
static |
Definition at line 112 of file cuddDecomp.c.
|
static |
Definition at line 112 of file cuddDecomp.c.