110 static char rcsid[]
DD_UNUSED =
"$Id: cuddCompose.c,v 1.45 2004/08/13 18:04:47 fabio Exp $";
114 static int addPermuteRecurHits;
115 static int bddPermuteRecurHits;
116 static int bddVectorComposeHits;
117 static int addVectorComposeHits;
119 static int addGeneralVectorComposeHits;
176 if (v < 0 || v >= dd->
size)
return(NULL);
213 if (v < 0 || v >= dd->
size)
return(NULL);
253 if (table == NULL)
return(NULL);
295 if (permut == NULL) {
299 for (i = 0; i < dd->
size; i++) permut[i] = i;
300 for (i = 0; i < n; i++) {
343 if (table == NULL)
return(NULL);
379 if (manager->
map == NULL)
return(NULL);
424 if (manager->
map != NULL) {
428 if (manager->
map == NULL) {
435 for (i = 0; i < manager->
size; i++) {
439 for (i = 0; i < n; i++) {
476 if (permut == NULL) {
480 for (i = 0; i < dd->
size; i++) permut[i] = i;
481 for (i = 0; i < n; i++) {
523 if (permut == NULL) {
527 for (i = 0; i < dd->
size; i++) permut[i] = i;
528 for (i = 0; i < n-2; i += 3) {
577 if (table == NULL)
return(NULL);
580 for (deepest = dd->
size - 1; deepest >= 0; deepest--) {
636 if (table == NULL)
return(NULL);
639 for (deepest = dd->
size - 1; deepest >= 0; deepest--) {
705 for (i = (
int) dd->
size - 1; i >= 0; i--) {
751 for (lastsub = dd->
size - 1; lastsub >= 0; lastsub--) {
752 if (!
ddIsIthAddVar(dd,vector[lastsub],(
unsigned int)lastsub)) {
805 if (table == NULL)
return(NULL);
808 for (deepest = dd->
size - 1; deepest >= 0; deepest--) {
810 if (vector[i] != dd->
vars[i]) {
856 DdNode *F, *G, *f1, *f0, *g1, *g0, *r, *t, *e;
857 unsigned int v, topf, topg, topindex;
866 if (topf > v)
return(f);
884 if (r == NULL)
return(NULL);
911 if (t == NULL)
return(NULL);
958 DdNode *f1, *f0, *g1, *g0, *r, *t, *e;
959 unsigned int v, topf, topg, topindex;
966 if (topf > v)
return(f);
979 if (r == NULL)
return(NULL);
1001 if (t == NULL)
return(NULL);
1076 addPermuteRecurHits++;
1083 if (T == NULL)
return(NULL);
1096 index = permut[node->
index];
1098 if (var == NULL)
return(NULL);
1115 if (node->
ref != 1) {
1171 bddPermuteRecurHits++;
1178 if (T == NULL)
return(NULL);
1191 index = permut[N->
index];
1259 if (T == NULL)
return(NULL);
1325 addVectorComposeHits++;
1332 if (T == NULL)
return(NULL);
1401 addGeneralVectorComposeHits++;
1408 vectorOn,vectorOff,deepest);
1409 if (T == NULL)
return(NULL);
1412 vectorOn,vectorOff,deepest);
1488 DdNode *f1, *f0, *key1, *key0, *cube1, *
var;
1491 unsigned int top, topf, topk, topc;
1514 top =
ddMin(topf,topk);
1516 top =
ddMin(top,topc);
1527 cube1 =
cuddT(cube);
1558 if (vect1 == NULL) {
1564 if (vect0 == NULL) {
1574 for (i = 0; i < lastsub; i++) {
1577 vect1[i] = vect0[i] = NULL;
1578 }
else if (gi->
index == index) {
1579 vect1[i] =
cuddT(gi);
1580 vect0[i] =
cuddE(gi);
1582 vect1[i] = vect0[i] = gi;
1585 vect1[index] = vect0[index] = NULL;
1661 bddVectorComposeHits++;
1668 if (T == NULL)
return(NULL);
void Cudd_IterDerefBdd(DdManager *table, DdNode *n)
static DD_INLINE int ddIsIthAddVarPair(DdManager *dd, DdNode *f, DdNode *g, unsigned int i)
void cuddCacheFlush(DdManager *table)
DdNode * Cudd_addSwapVariables(DdManager *dd, DdNode *f, DdNode **x, DdNode **y, int n)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
DdNode * cuddBddComposeRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *proj)
#define DD_ADD_COMPOSE_RECUR_TAG
DdNode * Cudd_bddSwapVariables(DdManager *dd, DdNode *f, DdNode **x, DdNode **y, int n)
#define Cudd_Regular(node)
DdNode * cuddAddApplyRecur(DdManager *dd, DD_AOP op, DdNode *f, DdNode *g)
DdNode * Cudd_addNonSimCompose(DdManager *dd, DdNode *f, DdNode **vector)
void cuddCacheInsert(DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h, DdNode *data)
#define ABC_ALLOC(type, num)
DdNode * Cudd_addGeneralVectorCompose(DdManager *dd, DdNode *f, DdNode **vectorOn, DdNode **vectorOff)
DdNode * Cudd_addApply(DdManager *dd, DdNode *(*)(DdManager *, DdNode **, DdNode **), DdNode *f, DdNode *g)
DdNode * cuddAddExistAbstractRecur(DdManager *manager, DdNode *f, DdNode *cube)
static abctime Abc_Clock()
DdNode * cuddHashTableLookup1(DdHashTable *hash, DdNode *f)
static DD_INLINE int ddIsIthAddVar(DdManager *dd, DdNode *f, unsigned int i)
#define DD_ADD_NON_SIM_COMPOSE_TAG
#define Cudd_IsComplement(node)
DdNode * Cudd_addIthVar(DdManager *dd, int i)
DdNode * Cudd_addXnor(DdManager *dd, DdNode **f, DdNode **g)
static DdNode * cuddAddVectorComposeRecur(DdManager *dd, DdHashTable *table, DdNode *f, DdNode **vector, int deepest)
DdNode * cuddCacheLookup1(DdManager *table, DD_CTFP1 op, DdNode *f)
DdNode * Cudd_bddPermute(DdManager *manager, DdNode *node, int *permut)
DdNode * Cudd_addPlus(DdManager *dd, DdNode **f, DdNode **g)
#define ABC_NAMESPACE_IMPL_END
#define cuddIsConstant(node)
DdNode * cuddAddComposeRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *proj)
void cuddHashTableQuit(DdHashTable *hash)
#define ABC_NAMESPACE_IMPL_START
DdNode * Cudd_bddVarMap(DdManager *manager, DdNode *f)
DdNode * Cudd_addCompose(DdManager *dd, DdNode *f, DdNode *g, int v)
int cuddHashTableInsert1(DdHashTable *hash, DdNode *f, DdNode *value, ptrint count)
DdNode * Cudd_bddAdjPermuteX(DdManager *dd, DdNode *B, DdNode **x, int n)
#define Cudd_NotCond(node, c)
DdHashTable * cuddHashTableInit(DdManager *manager, unsigned int keySize, unsigned int initSize)
static ABC_NAMESPACE_IMPL_START char rcsid[] DD_UNUSED
static DdNode * cuddAddPermuteRecur(DdManager *manager, DdHashTable *table, DdNode *node, int *permut)
static DdNode * cuddBddVectorComposeRecur(DdManager *dd, DdHashTable *table, DdNode *f, DdNode **vector, int deepest)
DdNode * Cudd_bddCompose(DdManager *dd, DdNode *f, DdNode *g, int v)
DdNode * Cudd_addVectorCompose(DdManager *dd, DdNode *f, DdNode **vector)
static DdNode * cuddAddNonSimComposeRecur(DdManager *dd, DdNode *f, DdNode **vector, DdNode *key, DdNode *cube, int lastsub)
DdNode * cuddAddIteRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)
DdNode * Cudd_addTimes(DdManager *dd, DdNode **f, DdNode **g)
#define DD_BDD_COMPOSE_RECUR_TAG
static DdNode * cuddAddGeneralVectorComposeRecur(DdManager *dd, DdHashTable *table, DdNode *f, DdNode **vectorOn, DdNode **vectorOff, int deepest)
static DdNode * cuddBddPermuteRecur(DdManager *manager, DdHashTable *table, DdNode *node, int *permut)
int Cudd_SetVarMap(DdManager *manager, DdNode **x, DdNode **y, int n)
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
DdNode * cuddCacheLookup(DdManager *table, ptruint op, DdNode *f, DdNode *g, DdNode *h)
DdNode * Cudd_bddVectorCompose(DdManager *dd, DdNode *f, DdNode **vector)
void cuddCacheInsert1(DdManager *table, DD_CTFP1 op, DdNode *f, DdNode *data)
DdNode * Cudd_addPermute(DdManager *manager, DdNode *node, int *permut)
static DdNode * cuddBddVarMapRecur(DdManager *manager, DdNode *f)
DdNode * cuddBddIteRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)