122 for ( i = 0; i < nMin; i++ )
126 for ( ; i < nMax; i++ )
127 pPermute[ ddSource->
invperm[i] ] = -1;
150 DdNode * bSupp, * bTemp, * bRes;
161 for ( bTemp = bSupp; bTemp != dd->
one; bTemp =
cuddT(bTemp) )
200 bVars = dd->
vars[nVars];
230 printf(
"\nThe number of referenced nodes = %d\n\n", RetValue );
251 int nVars = dd->
size;
262 printf(
"Constant 0");
267 printf(
"Constant 1");
279 for ( i = 0; i < nVars; i++ )
281 printf(
"[%d]'", i );
283 else if ( Cube[i] == 1 )
324 while ( bSupp !=
b1 )
329 bSupp =
cuddT(bSupp);
348 for( ; bS !=
b1; bS =
cuddT(bS) )
408 if ( Result >= DiffMax )
424 if ( Result >= DiffMax )
454 while ( bSL !=
b1 || bSH !=
b1 )
459 if ( fHcontainsL == 0 )
468 if ( fLcontainsH == 0 )
480 if ( TopVar == bSL->
index && TopVar == bSH->
index )
487 else if ( TopVar == bSL->
index )
502 if ( !fHcontainsL && !fLcontainsH )
506 assert( !fHcontainsL || !fLcontainsH );
546 for (i = 0; i <
size; i++)
582 for ( i = 0; i <
size; i++ )
586 for ( i = 0; i < n; i++ )
588 for ( i = 0; i < n; i++ )
617 for ( v = 0; v < dd->
size; v++ )
618 if ( s_Temp[v] == 0 )
624 else if ( s_Temp[v] == 1 )
647 DdNode * bFuncR, * bFunc0, * bFunc1;
648 DdNode * bRes0, * bRes1, * bRes;
662 bFunc0 =
cuddE(bFuncR);
663 bFunc1 =
cuddT(bFuncR);
703 assert( iStart <= iStop );
705 assert( iStop >= 0 && iStop <= dd->size );
707 for ( i = iStart; i < iStop; i++ )
733 DdNode * bTemp, * bVar, * bVarBdd, * bResult;
736 for ( z = 0; z < CodeWidth; z++ )
738 bVarBdd = (pbVars)? pbVars[z]: dd->
vars[z];
740 bVar =
Cudd_NotCond( bVarBdd, (Code & (1 << (CodeWidth-1-z)))==0 );
774 if ( support == NULL )
779 for ( i = 0; i <
size; i++ )
794 for ( j = size - 1; j >= 0; j-- )
797 if ( support[i] == 1 )
863 for ( i = 0; i < nVars; i++ )
888 for ( i = 0; i < nVars; i++ )
913 for ( i = 0; i < nVars; i++ )
940 printf(
"\nReordering in Extra_zddPrimes()\n");
971 for ( i = 0; i < nNodes; i++ )
974 if ( bNodesOut[i] == NULL )
977 for ( k = 0; k < i; k++ )
1008 for ( i = 0; i < nVars; i++ )
1058 DdNode * bCube0, * bCube1;
1098 if (table == NULL)
return NULL;
1166 if ( bRes0 == NULL )
1171 if ( bRes1 == NULL )
1224 if ( (zC->
index & 1) == 0 )
1232 *zC2 =
cuddE( Temp );
1233 *zC0 =
cuddT( Temp );
1274 if ( table == NULL )
1286 while (
st__gen( gen, (
const char ** ) &key, (
char ** ) &value ) )
1300 if ( table != NULL )
1348 if (
st__lookup( table, (
char * ) f, (
char ** ) &res ) )
1358 index = Permute[f->
index];
1432 support[f->
index] = 1;
1495 if ( zTemp == NULL )
1545 DdNode *bF01, *zP0, *zP1;
1547 DdNode *zResE, *zResP, *zResN;
1556 if ( bF01 == NULL )
return NULL;
1589 if ( zResP == NULL )
1599 else if ( bF01 == bF1 )
1610 if ( zResN == NULL )
1624 if ( zResE == NULL )
1636 if ( zResN == NULL )
1648 if ( zResP == NULL )
1660 if ( zRes == NULL )
return NULL;
1730 index = permut[N->
index];
1792 if ( LevelV < LevelF )
1812 if ( LevelF == LevelV )
1813 bVarsNext =
cuddT(bVars);
1818 if ( bRes0 == NULL )
1823 if ( bRes1 == NULL )
1830 if ( LevelF == LevelV )
1841 if ( bRes0 == bRes1 )
1892 DdNode * bF0, * bF1, * bG0, * bG1, * bRes0, * bRes1, * bRes, * bVar;
1893 int LevF, LevG, Lev;
1902 if ( bG == ddG->
one )
1932 if ( bRes0 == NULL )
1937 if ( bRes1 == NULL )
1984 DdNode * bG2, * bRes1, * bRes2;
2007 printf(
"Recursive calls = %d\n", Counter );
2008 printf(
"|F| =%6d |G| =%6d |H| =%6d |F|*|G| =%9d ",
2012 if ( bRes1 == bRes2 )
2013 printf(
"Result verified.\n\n" );
2015 printf(
"Result is incorrect.\n\n" );
void Cudd_IterDerefBdd(DdManager *table, DdNode *n)
void st__free_table(st__table *table)
void Cudd_RecursiveDerefZdd(DdManager *table, DdNode *n)
#define CUDD_UNIQUE_SLOTS
#define cuddIZ(dd, index)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
DdNode * cuddZddGetNode(DdManager *zdd, int id, DdNode *T, DdNode *E)
void cuddCacheInsert2(DdManager *table, DD_CTFP op, DdNode *f, DdNode *g, DdNode *data)
int Cudd_bddPickOneCube(DdManager *ddm, DdNode *node, char *string)
void st__free_gen(st__generator *gen)
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
#define Cudd_ForeachCube(manager, f, gen, cube, value)
void Cudd_Deref(DdNode *node)
#define Cudd_IsConstant(node)
DdNode * Cudd_ReadLogicZero(DdManager *dd)
#define Cudd_Regular(node)
int st__ptrcmp(const char *, const char *)
#define ABC_ALLOC(type, num)
static abctime Abc_Clock()
DdNode * cuddHashTableLookup1(DdHashTable *hash, 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)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Abc_MinInt(int a, int b)
#define Cudd_IsComplement(node)
DdNode * cuddZddDiff(DdManager *zdd, DdNode *P, DdNode *Q)
int Cudd_ShuffleHeap(DdManager *table, int *permutation)
DdNode * Cudd_bddPermute(DdManager *manager, DdNode *node, int *permut)
#define ABC_NAMESPACE_IMPL_END
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
#define cuddIsConstant(node)
void cuddHashTableQuit(DdHashTable *hash)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
st__generator * st__init_gen(st__table *table)
int cuddHashTableInsert2(DdHashTable *hash, DdNode *f, DdNode *g, DdNode *value, ptrint count)
#define ABC_NAMESPACE_IMPL_START
int Cudd_CheckZeroRef(DdManager *manager)
void Cudd_AutodynDisable(DdManager *unique)
DdNode * Cudd_ReadOne(DdManager *dd)
int st__lookup(st__table *table, const char *key, char **value)
int cuddHashTableInsert1(DdHashTable *hash, DdNode *f, DdNode *value, ptrint count)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
DdNode * cuddHashTableLookup2(DdHashTable *hash, DdNode *f, DdNode *g)
DdNode * Cudd_bddXor(DdManager *dd, DdNode *f, DdNode *g)
int st__add_direct(st__table *table, char *key, char *value)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
DdHashTable * cuddHashTableInit(DdManager *manager, unsigned int keySize, unsigned int initSize)
void Cudd_Quit(DdManager *unique)
int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize)
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
DdNode * cuddBddAndRecur(DdManager *manager, DdNode *f, DdNode *g)
int st__ptrhash(const char *, int)
DdNode * cuddUniqueInter(DdManager *unique, int index, DdNode *T, DdNode *E)
int st__gen(st__generator *gen, const char **key_p, char **value_p)
DdNode * cuddCacheLookup1Zdd(DdManager *table, DD_CTFP1 op, DdNode *f)
void cuddCacheInsert1(DdManager *table, DD_CTFP1 op, DdNode *f, DdNode *data)
int Cudd_DagSize(DdNode *node)
DdNode * cuddBddIteRecur(DdManager *dd, DdNode *f, DdNode *g, DdNode *h)