118 static char rcsid[]
DD_UNUSED =
"$Id: cuddGenCof.c,v 1.38 2005/05/14 17:27:11 fabio Exp $";
217 DdNode *suppF, *suppC, *commonSupport;
227 if (f == c)
return(
DD_ONE(dd));
238 if (commonSupport ==
DD_ONE(dd)) {
268 if (sizeF <= sizeRes) {
381 if (decomp == NULL) {
385 for (i = 0; i < dd->
size; i++) {
391 for (i = 0; i < dd->
size; i++) {
392 if (decomp[i] != NULL) {
404 for (i = 0; i < dd->
size; i++) {
405 if (decomp[i] == NULL) {
437 DdNode *res, *commonSupport;
443 if (supp_f == NULL) {
448 if (supp_c == NULL) {
454 if (commonSupport == NULL) {
462 intersection = commonSupport !=
DD_ONE(dd);
472 if (sizeF <= sizeRes) {
528 for (i = 0; i < dd->
size; i++) {
532 for (j = 0; j < i; j++) {
608 int sizeRes, sizeL, sizeU;
614 if (res == NULL)
return(NULL);
620 if (sizeU <= sizeRes) {
627 if (sizeL <= sizeRes) {
662 if (f == c)
return(
DD_ONE(dd));
666 if (cplus == NULL)
return(NULL);
706 DdNode *res, *tmp1, *tmp2;
709 if (tmp1 == NULL)
return(NULL);
788 DdNode *Fv, *Fnv, *Cv, *Cnv, *t, *e, *r;
790 unsigned int topf, topc;
799 if (c == one)
return(f);
800 if (c == zero)
return(zero);
802 if (f == c)
return(one);
844 }
else if (Cv == one) {
864 }
else if (Cnv == one) {
918 unsigned int topf, topc;
927 if (c == one)
return(f);
928 if (c == zero)
return(zero);
930 if (f == c)
return(one);
964 if (d == NULL)
return(NULL);
994 if (t == NULL)
return(NULL);
995 }
else if (Cv == one) {
1002 if (r == NULL)
return(NULL);
1014 }
else if (Cnv == one) {
1067 DdNode *F, *ft, *fe, *G, *gt, *ge;
1069 unsigned int topf, topg, index;
1078 if (f == g)
return(one);
1082 if (g == one)
return(f);
1091 if (F->
ref != 1 || G->
ref != 1) {
1093 if (r != NULL)
return(r);
1115 if (d == NULL)
return(NULL);
1151 if (t == NULL)
return(NULL);
1183 if (F->
ref != 1 || G->
ref != 1)
1208 DdNode *Fv, *Fnv, *Cv, *Cnv, *t, *e, *r;
1210 unsigned int topf, topc;
1218 if (c == one)
return(f);
1219 if (c == zero)
return(zero);
1221 if (f == c)
return(one);
1251 }
else if (Cv == one) {
1271 }
else if (Cnv == one) {
1313 unsigned int topf, topc;
1321 if (c == one)
return(f);
1322 if (c == zero)
return(zero);
1324 if (f == c)
return(one);
1345 if (d == NULL)
return(NULL);
1370 if (t == NULL)
return(NULL);
1371 }
else if (Cv == one) {
1378 if (r == NULL)
return(NULL);
1390 }
else if (Cnv == one) {
1439 st__table *marktable, *markcache, *buildcache;
1443 if (c == zero)
return(zero);
1457 if (marktable == NULL) {
1461 if (markcache == NULL) {
1474 if (buildcache == NULL) {
1540 if (result == NULL) {
1589 if (topf > level)
return(x);
1598 if (topf == level) {
1599 if (fT == zero)
return(zero);
1600 if (fE == zero)
return(one);
1654 DdNode *Fv, *Fnv, *Cv, *Cnv;
1656 unsigned int topf, topc;
1658 int resT, resE, res, retval;
1683 key->
f = f; key->
c = c;
1727 *slot = (
char *) (
ptrint)((resT << 2) | resE);
1728 }
else if (retval == 1) {
1729 *slot = (
char *) (
ptrint)((int)((
ptrint) *slot) | (resT << 2) | resE);
1772 DdNode *Fv, *Fnv, *r, *t, *e;
1776 int markT, markE, markings;
1787 if (
st__lookup(cache, (
const char *)f, (
char **)&r)) {
1794 markT = markings >> 2;
1795 markE = markings & 3;
1884 val = (int) (
ptrint) entry->
f;
1885 val = val * 997 + (int) (
ptrint) entry->
c;
1887 return ((val < 0) ? -val : val) % modulus;
1916 return((entry1->
f != entry2->
f) || (entry1->
c != entry2->
c));
1977 unsigned int topu, topl;
1991 if (l == zero)
return(l);
1992 if (u == one)
return(u);
2041 }
else if ((le == zero ||
Cudd_bddLeq(dd,le,lt)) &&
void Cudd_IterDerefBdd(DdManager *table, DdNode *n)
DdNode * Cudd_addConstrain(DdManager *dd, DdNode *f, DdNode *c)
void st__free_table(st__table *table)
DdNode * cuddBddConstrainRecur(DdManager *dd, DdNode *f, DdNode *c)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
DdNode * Cudd_bddLICompaction(DdManager *dd, DdNode *f, DdNode *c)
void cuddCacheInsert2(DdManager *table, DD_CTFP op, DdNode *f, DdNode *g, DdNode *data)
DdNode * Cudd_addOr(DdManager *dd, DdNode **f, DdNode **g)
int st__insert(st__table *table, const char *key, char *value)
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
#define Cudd_IsConstant(node)
DdNode * Cudd_RemapOverApprox(DdManager *dd, DdNode *f, int numVars, int threshold, double quality)
#define Cudd_Regular(node)
DdNode * cuddAddApplyRecur(DdManager *dd, DD_AOP op, DdNode *f, DdNode *g)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
DdNode * Cudd_SubsetCompress(DdManager *dd, DdNode *f, int nvars, int threshold)
int st__ptrcmp(const char *, const char *)
#define ABC_ALLOC(type, num)
DdNode * Cudd_bddRestrict(DdManager *dd, DdNode *f, DdNode *c)
int st__lookup_int(st__table *table, char *key, int *value)
static DdNode * cuddBddCharToVect(DdManager *dd, DdNode *f, DdNode *x)
static enum st__retval MarkCacheCleanUp(char *key, char *value, char *arg)
static DdNode * cuddBddSqueeze(DdManager *dd, DdNode *l, DdNode *u)
DdNode * Cudd_bddSqueeze(DdManager *dd, DdNode *l, DdNode *u)
static int cuddBddConstrainDecomp(DdManager *dd, DdNode *f, DdNode **decomp)
DdNode ** Cudd_bddCharToVect(DdManager *dd, DdNode *f)
DdNode * cuddCacheLookup2(DdManager *table, DD_CTFP op, DdNode *f, DdNode *g)
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
DdNode * Cudd_bddLiteralSetIntersection(DdManager *dd, DdNode *f, DdNode *g)
static DdNode * cuddBddLICBuildResult(DdManager *dd, DdNode *f, st__table *cache, st__table *table)
#define Cudd_IsComplement(node)
int st__find_or_add(st__table *table, char *key, char ***slot)
DdNode * Cudd_SupersetCompress(DdManager *dd, DdNode *f, int nvars, int threshold)
DdNode * cuddBddLICompaction(DdManager *dd, DdNode *f, DdNode *c)
#define ABC_NAMESPACE_IMPL_END
DdNode * Cudd_RemapUnderApprox(DdManager *dd, DdNode *f, int numVars, int threshold, double quality)
static int MarkCacheHash(const char *ptr, int modulus)
int Cudd_ClassifySupport(DdManager *dd, DdNode *f, DdNode *g, DdNode **common, DdNode **onlyF, DdNode **onlyG)
DdNode * cuddAddConstrainRecur(DdManager *dd, DdNode *f, DdNode *c)
int st__foreach(st__table *table, enum st__retval(*func)(char *, char *, char *), char *arg)
static char s1[largest_string]
DdNode * cuddBddNPAndRecur(DdManager *manager, DdNode *f, DdNode *g)
#define ABC_NAMESPACE_IMPL_START
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
int st__lookup(st__table *table, const char *key, char **value)
DdNode ** Cudd_bddConstrainDecomp(DdManager *dd, DdNode *f)
DdNode * Cudd_bddConstrain(DdManager *dd, DdNode *f, DdNode *c)
DdNode * Cudd_addRestrict(DdManager *dd, DdNode *f, DdNode *c)
DdNode * Cudd_bddNPAnd(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Cudd_SubsetShortPaths(DdManager *dd, DdNode *f, int numVars, int threshold, int hardlimit)
#define Cudd_NotCond(node, c)
static int cuddBddLICMarkEdges(DdManager *dd, DdNode *f, DdNode *c, st__table *table, st__table *cache)
static char rcsid[] DD_UNUSED
DdNode * cuddAddRestrictRecur(DdManager *dd, DdNode *f, DdNode *c)
DdNode * cuddBddAndRecur(DdManager *manager, DdNode *f, DdNode *g)
int st__ptrhash(const char *, int)
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
DdNode * cuddBddRestrictRecur(DdManager *dd, DdNode *f, DdNode *c)
int Cudd_DagSize(DdNode *node)
struct MarkCacheKey MarkCacheKey
static int MarkCacheCompare(const char *ptr1, const char *ptr2)
DdNode * Cudd_bddMinimize(DdManager *dd, DdNode *f, DdNode *c)
DdNode * cuddBddIteRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)