83 #define DD_BIGGY 1000000
103 static char rcsid[]
DD_UNUSED =
"$Id: cuddSat.c,v 1.36 2009/03/08 02:49:02 fabio Exp $";
112 #define WEIGHT(weight, col) ((weight) == NULL ? 1 : weight[col])
169 if (inputs[ptr->
index] == 1) {
222 for (i = 0; i < manager->
size; i++) {
227 if (f ==
Cudd_Not(one) || f == zero) {
246 if (!
st__lookup(visited, (
const char *)F, (
char **)&rootPair))
return(NULL);
249 cost = rootPair->
neg;
251 cost = rootPair->
pos;
255 sol =
getPath(manager,visited,f,weight,cost);
299 if (f ==
Cudd_Not(one) || f == zero) {
318 if (!
st__lookup(visited, (
const char *)F, (
char **)&rootPair))
return(NULL);
321 cost = rootPair->
neg;
323 cost = rootPair->
pos;
327 sol =
getCube(manager,visited,f,cost);
370 if (f ==
Cudd_Not(one) || f == zero) {
422 unsigned int topf, level;
423 DdNode *F, *fv, *fvn, *res;
437 level = (unsigned) dd->
perm[i];
458 if (topf == (
unsigned) level) {
528 DdNode *tmp, *One, *Gr, *Dr;
529 DdNode *Fv, *Fvn, *Gv, *Gvn, *Dv, *Dvn;
531 unsigned int flevel, glevel, dlevel, top;
537 if (D == One || F == G)
return(1);
557 if (tmp != NULL)
return(tmp == One);
563 top =
ddMin(flevel,glevel);
566 top =
ddMin(top,dlevel);
628 DdNode *tmp, *One, *F, *G;
629 DdNode *Ft, *Fe, *Gt, *Ge, *Dt, *De;
631 unsigned int flevel, glevel, dlevel, top;
638 if (f == g || g == One || f ==
Cudd_Not(One) || D == One ||
639 D == f || D ==
Cudd_Not(g))
return(1);
728 if (tmp != NULL)
return(tmp == One);
735 top =
ddMin(flevel,glevel);
737 top =
ddMin(top,dlevel);
803 DdNode *fv, *fvn, *gv, *gvn, *r;
804 unsigned int topf, topg;
808 if (f == g)
return(1);
814 (void) fprintf(dd->
out,
"Offending nodes:\n");
815 (void) fprintf(dd->
out,
816 "f: address = %p\t value = %40.30f\n",
817 (
void *) f,
cuddV(f));
818 (void) fprintf(dd->
out,
819 "g: address = %p\t value = %40.30f\n",
820 (
void *) g,
cuddV(g));
837 if (topf <= topg) {fv =
cuddT(f); fvn =
cuddE(f);}
else {fv = fvn = f;}
838 if (topg <= topf) {gv =
cuddT(g); gvn =
cuddE(g);}
else {gv = gvn = g;}
916 if (expanded == NULL) {
929 }
else if (e == zero) {
1009 if (
st__lookup(visited, (
const char *)my_root, (
char **)&my_pair)) {
1011 res_pair.
pos = my_pair->
neg;
1012 res_pair.
neg = my_pair->
pos;
1014 res_pair.
pos = my_pair->
pos;
1015 res_pair.
neg = my_pair->
neg;
1026 if (my_root != zero) {
1044 if (support != NULL) {
1045 support[my_root->
index] = 1;
1050 if (my_pair == NULL) {
1052 int tmp = res_pair.
pos;
1053 res_pair.
pos = res_pair.
neg;
1058 my_pair->
pos = res_pair.
pos;
1059 my_pair->
neg = res_pair.
neg;
1061 st__insert(visited, (
char *)my_root, (
char *)my_pair);
1063 res_pair.
pos = my_pair->
neg;
1064 res_pair.
neg = my_pair->
pos;
1066 res_pair.
pos = my_pair->
pos;
1067 res_pair.
neg = my_pair->
neg;
1154 (void) fprintf(manager->
err,
"We shouldn't be here!!\n");
1195 if (
st__lookup(visited, (
const char *)my_root, (
char **)&my_pair)) {
1197 res_pair.
pos = my_pair->
neg;
1198 res_pair.
neg = my_pair->
pos;
1200 res_pair.
pos = my_pair->
pos;
1201 res_pair.
neg = my_pair->
neg;
1212 if (my_root != zero) {
1230 if (my_pair == NULL) {
1232 int tmp = res_pair.
pos;
1233 res_pair.
pos = res_pair.
neg;
1238 my_pair->
pos = res_pair.
pos;
1239 my_pair->
neg = res_pair.
neg;
1242 st__insert(visited, (
char *)my_root, (
char *)my_pair);
1244 res_pair.
pos = my_pair->
neg;
1245 res_pair.
neg = my_pair->
pos;
1247 res_pair.
pos = my_pair->
pos;
1248 res_pair.
neg = my_pair->
neg;
1334 (void) fprintf(manager->
err,
"We shouldn't be here!\n");
static char rcsid[] DD_UNUSED
void st__free_table(st__table *table)
DdNode * Cudd_LargestCube(DdManager *manager, DdNode *f, int *length)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
static DdNode * getPath(DdManager *manager, st__table *visited, DdNode *f, int *weight, int cost)
void cuddCacheInsert2(DdManager *table, DD_CTFP op, DdNode *f, DdNode *g, DdNode *data)
int st__insert(st__table *table, const char *key, char *value)
void Cudd_Deref(DdNode *node)
static enum st__retval freePathPair(char *key, char *value, char *arg)
int Cudd_EquivDC(DdManager *dd, DdNode *F, DdNode *G, DdNode *D)
#define Cudd_IsConstant(node)
#define Cudd_Regular(node)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
DdNode * Cudd_Eval(DdManager *dd, DdNode *f, int *inputs)
int Cudd_EqualSupNorm(DdManager *dd, DdNode *f, DdNode *g, CUDD_VALUE_TYPE tolerance, int pr)
void cuddCacheInsert(DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h, DdNode *data)
int st__ptrcmp(const char *, const char *)
DdNode *(* DD_CTFP)(DdManager *, DdNode *, DdNode *)
void cuddGetBranches(DdNode *g, DdNode **g1, DdNode **g0)
#define ABC_ALLOC(type, num)
pcover complement(pcube *T)
DdNode * Cudd_ShortestPath(DdManager *manager, DdNode *f, int *weight, int *support, int *length)
DdNode * cuddBddMakePrime(DdManager *dd, DdNode *cube, 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)
#define Cudd_IsComplement(node)
#define ABC_NAMESPACE_IMPL_END
#define cuddIsConstant(node)
DdNode * Cudd_Increasing(DdManager *dd, DdNode *f, int i)
int st__foreach(st__table *table, enum st__retval(*func)(char *, char *, char *), char *arg)
static DdNode * getCube(DdManager *manager, st__table *visited, DdNode *f, int cost)
int Cudd_ShortestLength(DdManager *manager, DdNode *f, int *weight)
#define WEIGHT(weight, col)
#define DD_BDD_LEQ_UNLESS_TAG
#define ddEqualVal(x, y, e)
#define ABC_NAMESPACE_IMPL_START
struct cuddPathPair cuddPathPair
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
int st__lookup(st__table *table, const char *key, char **value)
DdNode * Cudd_Decreasing(DdManager *dd, DdNode *f, int i)
DdNode * Cudd_bddMakePrime(DdManager *dd, DdNode *cube, DdNode *f)
#define Cudd_NotCond(node, c)
static cuddPathPair getLargest(DdNode *root, st__table *visited)
static cuddPathPair getShortest(DdNode *root, int *cost, int *support, st__table *visited)
DdNode * cuddBddAndRecur(DdManager *manager, DdNode *f, DdNode *g)
int Cudd_bddLeqUnless(DdManager *dd, DdNode *f, DdNode *g, DdNode *D)
int st__ptrhash(const char *, int)
DdNode * cuddCacheLookup(DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h)