68 #define Llb_MgrForEachVar( p, pVar, i ) \
69 for ( i = 0; (i < p->nVars) && (((pVar) = Llb_MgrVar(p, i)), 1); i++ ) if ( pVar == NULL ) {} else
71 #define Llb_MgrForEachPart( p, pPart, i ) \
72 for ( i = 0; (i < p->iPartFree) && (((pPart) = Llb_MgrPart(p, i)), 1); i++ ) if ( pPart == NULL ) {} else
75 #define Llb_PartForEachVar( p, pPart, pVar, i ) \
76 for ( i = 0; (i < Vec_IntSize(pPart->vVars)) && (((pVar) = Llb_MgrVar(p, Vec_IntEntry(pPart->vVars,i))), 1); i++ )
78 #define Llb_VarForEachPart( p, pVar, pPart, i ) \
79 for ( i = 0; (i < Vec_IntSize(pVar->vParts)) && (((pPart) = Llb_MgrPart(p, Vec_IntEntry(pVar->vParts,i))), 1); i++ )
103 p->
pVars[pVar->iVar] = NULL;
237 printf(
"Var %3d : ", i );
239 printf(
"%d ", pPart->
iPart );
244 printf(
"Part %3d : ", i );
246 printf(
"%d ", pVar->iVar );
268 int i, RetValue, nSizeNew;
276 printf(
"Subsetting %3d : ", pPart->
iPart );
302 if ( p->
pSupp[pVar->iVar] )
305 pVar->nScore -= pPart->
nSize - nSizeNew;
311 pVar->nScore -= pPart->
nSize;
319 pPart->
nSize = nSizeNew;
321 for ( i = 0; i < p->
nVars; i++ )
349 int i, RetValue, nSuppSize;
360 printf(
"Conjoining partitions %d and %d.\n", pPart1->
iPart, pPart2->
iPart );
398 pTemp->
bFunc = bFunc;
405 pVar->nScore -= pPart1->
nSize;
412 pVar->nScore -= pPart2->
nSize;
417 for ( i = 0; i < p->
nVars; i++ )
419 nSuppSize += p->
pSupp[i];
423 pVar->nScore += pTemp->
nSize;
438 printf(
"Adding partition %d because of var %d.\n",
452 printf(
"Adding partition %d because of var %d.\n",
466 printf(
"Updating partitiong %d with singlton vars.\n", pTemp->
iPart );
546 DdNode * bBdd0, * bBdd1, * bProd;
560 if ( pObj->
pData == NULL )
606 if ( p->
pVars[iVar] == NULL )
609 p->
pVars[iVar]->iVar = iVar;
610 p->
pVars[iVar]->nScore = 0;
640 for ( k = 0; k < p->
nVars; k++ )
642 nSuppSize += p->
pSupp[k];
667 if ( vRootBdds == NULL )
708 Llb_Prt_t * pPart, * pPart1Best = NULL, * pPart2Best = NULL;
713 if ( pVarBest == NULL || pVarBest->nScore > pVar->nScore )
715 if ( pVarBest == NULL )
720 if ( pPart1Best == NULL )
722 else if ( pPart2Best == NULL )
724 else if ( pPart1Best->
nSize > pPart->
nSize || pPart2Best->nSize > pPart->
nSize )
726 if ( pPart1Best->
nSize > pPart2Best->nSize )
732 *ppPart1 = pPart1Best;
733 *ppPart2 = pPart2Best;
788 pVar->nScore += pPart->
nSize;
814 nScore += pPart->
nSize;
815 assert( nScore == pVar->nScore );
885 DdManager * dd,
DdNode * bCurrent,
int fReorder,
int fVerbose,
int * pOrder )
890 int i, nReorders, timeInside;
1003 int i, nReorders, timeInside = 0;
1042 if ( bFunc == NULL )
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define CUDD_UNIQUE_SLOTS
DdManager * Llb_NonlinImageStart(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, int *pOrder, int fFirst, abctime TimeTarget)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
static Llb_Prt_t * Llb_MgrPart(Llb_Mgr_t *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
void Llb_NonlinImageQuit()
int Llb_NonlinQuantify2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
DdNode * Llb_NonlinCreateCube1(Llb_Mgr_t *p, Llb_Prt_t *pPart)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
void Cudd_Deref(DdNode *node)
int Cudd_ReadReorderings(DdManager *dd)
#define Cudd_IsConstant(node)
void Llb_NonlinAddPair(Llb_Mgr_t *p, DdNode *bFunc, int iPart, int iVar)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
void Llb_NonlinRecomputeScores(Llb_Mgr_t *p)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
void Llb_NonlinRemovePart(Llb_Mgr_t *p, Llb_Prt_t *pPart)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
DdNode * Llb_NonlinCreateCube2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
int Cudd_ReadSize(DdManager *dd)
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
static Llb_Var_t * Llb_MgrVar(Llb_Mgr_t *p, int i)
DdNode * Cudd_LargestCube(DdManager *manager, DdNode *f, int *length)
#define Llb_MgrForEachVar(p, pVar, i)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
void Llb_NonlinPrint(Llb_Mgr_t *p)
Llb_Mgr_t * Llb_NonlinAlloc(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, DdManager *dd)
typedefABC_NAMESPACE_IMPL_START struct Llb_Var_t_ Llb_Var_t
DECLARATIONS ///.
int Llb_NonlinHasSingletonVars(Llb_Mgr_t *p, Llb_Prt_t *pPart)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Cudd_ShuffleHeap(DdManager *table, int *permutation)
Vec_Ptr_t * Llb_NonlinBuildBdds(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper, DdManager *dd)
void Llb_NonlinCutNodes_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
void Llb_NonlinCheckVars(Llb_Mgr_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define Llb_MgrForEachPart(p, pPart, i)
#define ABC_NAMESPACE_IMPL_END
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
DdNode * Cudd_bddXnor(DdManager *dd, DdNode *f, DdNode *g)
#define Llb_VarForEachPart(p, pVar, pPart, i)
DdNode * Llb_NonlinImage(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, DdManager *dd, DdNode *bCurrent, int fReorder, int fVerbose, int *pOrder)
static void Abc_Print(int level, const char *format,...)
int Llb_NonlinNextPartitions(Llb_Mgr_t *p, Llb_Prt_t **ppPart1, Llb_Prt_t **ppPart2)
static int Vec_IntRemove(Vec_Int_t *p, int Entry)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
DdNode * Cudd_ReadOne(DdManager *dd)
static int Vec_IntSize(Vec_Int_t *p)
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
#define Llb_PartForEachVar(p, pPart, pVar, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Llb_NonlinFree(Llb_Mgr_t *p)
Vec_Ptr_t * Llb_NonlinCutNodes(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
#define ABC_CALLOC(type, num)
unsigned int Cudd_ReadKeys(DdManager *dd)
int Llb_NonlinQuantify1(Llb_Mgr_t *p, Llb_Prt_t *pPart, int fSubset)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static int Aig_ObjId(Aig_Obj_t *pObj)
int Llb_NonlinStart(Llb_Mgr_t *p)
void Llb_NonlinReorder(DdManager *dd, int fTwice, int fVerbose)
void Llb_NonlinAddPartition(Llb_Mgr_t *p, int i, DdNode *bFunc)
int Cudd_ReduceHeap(DdManager *table, Cudd_ReorderingType heuristic, int minsize)
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
unsigned int Cudd_ReadDead(DdManager *dd)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
void Llb_NonlinRemoveVar(Llb_Mgr_t *p, Llb_Var_t *pVar)
FUNCTION DEFINITIONS ///.
static void Vec_IntClear(Vec_Int_t *p)
int Cudd_SupportSize(DdManager *dd, DdNode *f)
DdNode * Llb_NonlinImageCompute(DdNode *bCurrent, int fReorder, int fDrop, int fVerbose, int *pOrder)
int Cudd_DagSize(DdNode *node)
static void Vec_PtrFree(Vec_Ptr_t *p)
void Llb_NonlinVerifyScores(Llb_Mgr_t *p)