162 static inline unsigned Ivy_ObjRandomSim() {
return (rand() << 24) ^ (rand() << 12) ^ rand(); }
165 #define Ivy_FraigForEachEquivClass( pList, pEnt ) \
166 for ( pEnt = pList; \
168 pEnt = Ivy_ObjEquivListNext(pEnt) )
169 #define Ivy_FraigForEachEquivClassSafe( pList, pEnt, pEnt2 ) \
170 for ( pEnt = pList, \
171 pEnt2 = pEnt? Ivy_ObjEquivListNext(pEnt): NULL; \
174 pEnt2 = pEnt? Ivy_ObjEquivListNext(pEnt): NULL )
176 #define Ivy_FraigForEachClassNode( pClass, pEnt ) \
177 for ( pEnt = pClass; \
179 pEnt = Ivy_ObjClassNodeNext(pEnt) )
181 #define Ivy_FraigForEachBinNode( pBin, pEnt ) \
184 pEnt = Ivy_ObjNodeHashNext(pEnt) )
262 ABC_INT64_T nSatConfs = 0, nSatInspects = 0;
272 printf(
"RESOURCE LIMITS: Iterations = %d. Rewriting = %s. Fraiging = %s.\n",
274 printf(
"Miter = %d (%3.1f). Rwr = %d (%3.1f). Fraig = %d (%3.1f). Last = %d.\n",
309 for ( nIter = 0; nIter < pParams->
nItersMax; nIter++ )
313 printf(
"ITERATION %2d : Confs = %6d. FraigBTL = %3d. \n", nIter+1,
358 printf(
"Reached global limit on conflicts/inspects. Quitting.\n" );
394 if ( RetValue == 0 && pManAig->pData == NULL )
425 p->nBTLimitGlobal = nBTLimitGlobal;
426 p->nInsLimitGlobal = nInsLimitGlobal;
430 pManAigNew = p->pManFraig;
433 *pnSatConfs = p->pSat? p->pSat->stats.conflicts : 0;
435 *pnSatInspects = p->pSat? p->pSat->stats.inspects : 0;
463 pManAigNew = p->pManFraig;
510 pManAigNew = p->pManFraig;
536 p->pParams = pParams;
537 p->pManAig = pManAig;
567 p->pParams = pParams;
568 p->pManAig = pManAig;
573 EntrySize =
sizeof(
Ivy_FraigSim_t) +
sizeof(
unsigned) * p->nSimWords;
575 memset( p->pSimWords, 0, EntrySize );
583 if ( p->pSimStart == NULL )
584 p->pSimStart = pSims;
586 ((
Ivy_FraigSim_t *)(p->pSimWords + EntrySize * (k-2)))->pNext = pSims;
602 p->pPatWords =
ABC_ALLOC(
unsigned, p->nPatWords );
603 p->pPatScores =
ABC_ALLOC(
int, 32 * p->nSimWords );
623 if ( p->pParams->fVerbose )
647 nMemory = (double)
Ivy_ManObjNum(p->pManAig)*p->nSimWords*
sizeof(unsigned)/(1<<20);
648 printf(
"SimWords = %d. Rounds = %d. Mem = %0.2f MB. ", p->nSimWords, p->nSimRounds, nMemory );
649 printf(
"Classes: Beg = %d. End = %d.\n", p->nClassesBeg, p->nClassesEnd );
651 printf(
"Proof = %d. Counter-example = %d. Fail = %d. FailReal = %d. Zero = %d.\n",
652 p->nSatProof, p->nSatCallsSat, p->nSatFails, p->nSatFailsReal, p->nClassesZero );
653 printf(
"Final = %d. Miter = %d. Total = %d. Mux = %d. (Exor = %d.) SatVars = %d.\n",
656 ABC_PRT(
"AIG simulation ", p->timeSim );
657 ABC_PRT(
"AIG traversal ", p->timeTrav );
658 ABC_PRT(
"SAT solving ", p->timeSat );
659 ABC_PRT(
" Unsat ", p->timeSatUnsat );
660 ABC_PRT(
" Sat ", p->timeSatSat );
661 ABC_PRT(
" Fail ", p->timeSatFail );
662 ABC_PRT(
"Class refining ", p->timeRef );
663 ABC_PRT(
"TOTAL RUNTIME ", p->timeTotal );
664 if ( p->time1 ) {
ABC_PRT(
"time1 ", p->time1 ); }
686 for ( i = 0; i < p->nSimWords; i++ )
707 for ( i = 0; i < p->nSimWords; i++ )
708 pSims->
pData[i] = fConst1? ~(
unsigned)0 : 0;
753 for ( i = 0; i < Limit; i++ )
773 for ( i = 0; i < p->nSimWords; i++ )
774 if ( pSims->
pData[i] )
795 for ( i = 0; i < p->nSimWords; i++ )
816 for ( i = 0; i < p->nSimWords; i++ )
835 unsigned * pData, * pData0, * pData1;
837 pData = pSims->
pData;
840 switch( pSims->
Type )
843 for ( i = 0; i < p->nSimWords; i++ )
844 pData[i] = (pData0[i] & pData1[i]);
847 for ( i = 0; i < p->nSimWords; i++ )
848 pData[i] = ~(pData0[i] & pData1[i]);
851 for ( i = 0; i < p->nSimWords; i++ )
852 pData[i] = (pData0[i] & ~pData1[i]);
855 for ( i = 0; i < p->nSimWords; i++ )
856 pData[i] = (~pData0[i] | pData1[i]);
859 for ( i = 0; i < p->nSimWords; i++ )
860 pData[i] = (~pData0[i] & pData1[i]);
863 for ( i = 0; i < p->nSimWords; i++ )
864 pData[i] = (pData0[i] | ~pData1[i]);
867 for ( i = 0; i < p->nSimWords; i++ )
868 pData[i] = ~(pData0[i] | pData1[i]);
871 for ( i = 0; i < p->nSimWords; i++ )
872 pData[i] = (pData0[i] | pData1[i]);
891 int fCompl, fCompl0, fCompl1, i;
902 if ( fCompl0 && fCompl1 )
905 for ( i = 0; i < p->nSimWords; i++ )
908 for ( i = 0; i < p->nSimWords; i++ )
911 else if ( fCompl0 && !fCompl1 )
914 for ( i = 0; i < p->nSimWords; i++ )
917 for ( i = 0; i < p->nSimWords; i++ )
920 else if ( !fCompl0 && fCompl1 )
923 for ( i = 0; i < p->nSimWords; i++ )
926 for ( i = 0; i < p->nSimWords; i++ )
932 for ( i = 0; i < p->nSimWords; i++ )
935 for ( i = 0; i < p->nSimWords; i++ )
953 static int s_FPrimes[128] = {
954 1009, 1049, 1093, 1151, 1201, 1249, 1297, 1361, 1427, 1459,
955 1499, 1559, 1607, 1657, 1709, 1759, 1823, 1877, 1933, 1997,
956 2039, 2089, 2141, 2213, 2269, 2311, 2371, 2411, 2467, 2543,
957 2609, 2663, 2699, 2741, 2797, 2851, 2909, 2969, 3037, 3089,
958 3169, 3221, 3299, 3331, 3389, 3461, 3517, 3557, 3613, 3671,
959 3719, 3779, 3847, 3907, 3943, 4013, 4073, 4129, 4201, 4243,
960 4289, 4363, 4441, 4493, 4549, 4621, 4663, 4729, 4793, 4871,
961 4933, 4973, 5021, 5087, 5153, 5227, 5281, 5351, 5417, 5471,
962 5519, 5573, 5651, 5693, 5749, 5821, 5861, 5923, 6011, 6073,
963 6131, 6199, 6257, 6301, 6353, 6397, 6481, 6563, 6619, 6689,
964 6737, 6803, 6863, 6917, 6977, 7027, 7109, 7187, 7237, 7309,
965 7393, 7477, 7523, 7561, 7607, 7681, 7727, 7817, 7877, 7933,
966 8011, 8039, 8059, 8081, 8093, 8111, 8123, 8147
971 assert( p->nSimWords <= 128 );
974 for ( i = 0; i < p->nSimWords; i++ )
975 uHash ^= pSims->
pData[i] * s_FPrimes[i];
1028 for ( pSims = p->pSimStart; pSims; pSims = pSims->
pNext )
1069 if ( pList->
pHead == NULL )
1071 pList->
pHead = pClass;
1072 pList->
pTail = pClass;
1081 pList->
pTail = pClass;
1104 if ( pList->
pTail == pBase )
1105 pList->
pTail = pClass;
1122 if ( pList->
pHead == pClass )
1124 if ( pList->
pTail == pClass )
1150 int nPairs = 0, nNodes;
1158 nPairs += nNodes * (nNodes - 1) / 2;
1177 Ivy_Obj_t * pObj, * pConst1, * pBin, * pEntry;
1197 pBin = pTable[Hash % nTableSize];
1208 pTable[Hash % nTableSize] = pObj;
1211 assert( p->lClasses.pHead == NULL );
1246 Ivy_Obj_t * pClassNew, * pListOld, * pListNew, * pNode;
1254 if ( p->pParams->fPatScores )
1258 pListOld = pClassNew;
1260 if ( pClassNew == NULL )
1265 pListNew = pClassNew;
1293 return RetValue + 1;
1310 int i, k, BestPat, * pModel;
1313 for ( i = 0; i < p->nSimWords; i++ )
1314 if ( pSims->
pData[i] )
1316 assert( i < p->nSimWords );
1318 for ( k = 0; k < 32; k++ )
1319 if ( pSims->
pData[i] & (1 << k) )
1323 BestPat = i * 32 + k;
1333 assert( p->pManFraig->pData == NULL );
1334 p->pManFraig->pData = pModel;
1394 if ( p->pParams->fProve )
1396 if ( p->pManFraig->pData )
1405 Counter += ( RetValue > 0 );
1429 printf(
"Class {" );
1431 printf(
" %d(%d)%c", pObj->
Id, pObj->
Level, pObj->
fPhase?
'+' :
'-' );
1490 memset( p->pPatWords, 0,
sizeof(
unsigned) * p->nPatWords );
1506 memset( p->pPatWords, 0xff,
sizeof(
unsigned) * p->nPatWords );
1547 memset( p->pPatWords, 0,
sizeof(
unsigned) * p->nPatWords );
1571 memset( p->pPatWords, 0,
sizeof(
unsigned) * p->nPatWords );
1595 for ( i = 0; i < p->nPatWords; i++ )
1617 int nChanges, nClasses;
1628 if ( p->pManFraig->pData )
1635 if ( p->pManFraig->pData )
1642 nClasses = p->lClasses.nItems;
1644 if ( p->pManFraig->pData )
1647 }
while ( (
double)nChanges / nClasses > p->pParams->dSimSatur );
1666 int i, nLimit = p->nSimWords * 32;
1667 for ( i = 0; i < nLimit; i++ )
1668 p->pPatScores[i] = 0;
1691 for ( w = 0; w < p->nSimWords; w++ )
1696 for ( i = 0; i < 32; i++ )
1697 if ( uDiff & ( 1 << i ) )
1698 p->pPatScores[w*32+i]++;
1717 int i, nLimit = p->nSimWords * 32, MaxScore = 0, BestPat = -1;
1718 for ( i = 1; i < nLimit; i++ )
1720 if ( MaxScore < p->pPatScores[i] )
1722 MaxScore = p->pPatScores[i];
1726 if ( MaxScore == 0 )
1731 memset( p->pPatWords, 0,
sizeof(
unsigned) * p->nPatWords );
1757 if ( p->pParams->fPatScores )
1760 if ( p->pManFraig->pData )
1763 printf(
"Error: A counter-example did not refine classes!\n" );
1766 if ( !p->pParams->fPatScores )
1776 if ( p->pManFraig->pData )
1779 if ( nChanges == 0 )
1818 int i, CountConst0 = 0, CountNonConst0 = 0, CountUndecided = 0;
1825 if ( pObjNew == pMan->pConst1 )
1831 if ( pObjNew ==
Ivy_Not(pMan->pConst1) )
1862 if ( CountNonConst0 )
1864 if ( CountUndecided )
1888 if ( i && fVerbose )
1894 if ( pObjNew == p->pManFraig->pConst1 )
1897 printf(
"Output %2d (out of %2d) is constant 1. ", i,
Ivy_ManPoNum(p->pManAig) );
1904 if ( pObjNew ==
Ivy_Not(p->pManFraig->pConst1) )
1907 printf(
"Output %2d (out of %2d) is already constant 0. ", i,
Ivy_ManPoNum(p->pManAig) );
1914 printf(
"Output %2d (out of %2d) cannot be constant 0. ", i,
Ivy_ManPoNum(p->pManAig) );
1930 if ( RetValue == 1 )
1933 printf(
"Output %2d (out of %2d) was proved constant 0. ", i,
Ivy_ManPoNum(p->pManAig) );
1938 if ( RetValue == -1 )
1941 printf(
"Output %2d (out of %2d) has timed out at %d backtracks. ", i,
Ivy_ManPoNum(p->pManAig), p->pParams->nBTLimitMiter );
1946 printf(
"Output %2d (out of %2d) was proved NOT a constant 0. ", i,
Ivy_ManPoNum(p->pManAig) );
1973 p->nClassesBeg = p->lClasses.nItems;
1980 if ( p->pManFraig->pData )
1989 p->nClassesEnd = p->lClasses.nItems;
1993 if ( p->pParams->fProve && p->pManFraig->pData == NULL )
2029 Ivy_Obj_t * pObjNew, * pFanin0New, * pFanin1New, * pObjReprNew;
2035 pObjNew =
Ivy_And( p->pManFraig, pFanin0New, pFanin1New );
2055 if ( RetValue == 1 )
2062 if ( RetValue == -1 )
2083 for ( i = 0; i < p->nSatVars; i++ )
2084 printf(
"%d %d ", i, p->pSat->activity[i] );
2101 int pLits[4], RetValue, RetValue1, nBTLimit;
2112 nBTLimit = p->pParams->nBTLimitNode;
2118 if ( nBTLimit <= 10 )
2120 nBTLimit = (int)pow(nBTLimit, 0.7);
2125 if ( p->pSat == NULL )
2129 p->pSat->factors =
ABC_CALLOC(
double, p->pSat->cap );
2149 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0,
2150 p->nBTLimitGlobal, p->nInsLimitGlobal );
2155 pLits[0] =
lit_neg( pLits[0] );
2156 pLits[1] =
lit_neg( pLits[1] );
2160 p->nSatCallsUnsat++;
2162 else if ( RetValue1 ==
l_True )
2181 if ( pOld != p->pManFraig->pConst1 )
2189 if ( pOld == p->pManFraig->pConst1 )
2201 (ABC_INT64_T)nBTLimit, (ABC_INT64_T)0,
2202 p->nBTLimitGlobal, p->nInsLimitGlobal );
2207 pLits[0] =
lit_neg( pLits[0] );
2208 pLits[1] =
lit_neg( pLits[1] );
2211 p->nSatCallsUnsat++;
2213 else if ( RetValue1 ==
l_True )
2268 int pLits[2], RetValue1;
2274 assert( pNew != p->pManFraig->pConst1 );
2278 if ( p->pSat == NULL )
2282 p->pSat->factors =
ABC_CALLOC(
double, p->pSat->cap );
2299 (ABC_INT64_T)p->pParams->nBTLimitMiter, (ABC_INT64_T)0,
2300 p->nBTLimitGlobal, p->nInsLimitGlobal );
2305 pLits[0] =
lit_neg( pLits[0] );
2309 p->nSatCallsUnsat++;
2311 else if ( RetValue1 ==
l_True )
2355 int pLits[4], RetValue, VarF, VarI, VarT, VarE, fCompT, fCompE;
2438 int * pLits, nLits, RetValue, i;
2549 int i, k, fUseMuxes = 1;
2616 p->pSat->factors[
Ivy_ObjSatNum(pObj)] = p->pParams->dActConeBumpMax * (pObj->
Level - LevelMin)/(LevelMax - LevelMin);
2638 int LevelMin, LevelMax;
2647 assert( p->pParams->dActConeRatio > 0 && p->pParams->dActConeRatio < 1 );
2649 LevelMin = (int)(LevelMax * (1.0 - p->pParams->dActConeRatio));
2689 if ( (
int)pObj->
Level != Level )
2698 if ( pFanin->
fMarkB == 0 )
2706 if ( pFanin->
fMarkB == 0 )
2718 if ( (
int)pObj->
Level != Level )
2743 for ( i = 0; i < dd->
size; i++ )
2750 vTemp->nCap = vTemp->nSize = 0;
2751 vTemp->pArray = NULL;
2775 int i, RetValue, Iter, Level;
2787 for ( Iter = 0; ; Iter++ )
2792 if ( Level < (
int)pObj->
Level )
2793 Level = (int)pObj->
Level;
2799 {printf(
"%d", Iter );
break;}
2801 {printf(
"b" );
break;}
2802 if ( dd->
size > 120 )
2803 {printf(
"s" );
break;}
2805 {printf(
"i" );
break;}
2809 else if ( Level == 0 )
2926 extern int Fra_FraigSat(
Aig_Man_t * pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit,
int nLearnedStart,
int nLearnedDelta,
int nLearnedPerce,
int fFlipBits,
int fAndOuts,
int fNewSolver,
int fVerbose );
2933 RetValue =
Fra_FraigSat( pMan, nConfLimit, 0, 0, 0, 0, 0, 0, 0, 1 );
2934 if ( RetValue == 0 )
2937 memset( pGlo->pPatWords, 0,
sizeof(
unsigned) * pGlo->nPatWords );
2939 if ( ((
int *)pMan->pData)[i] )
2950 if ( RetValue == 1 )
2951 printf(
"UNSAT\n" );
2952 else if ( RetValue == 0 )
2954 else if ( RetValue == -1 )
2955 printf(
"UNDEC\n" );
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
void Ivy_FraigObjAddToFrontier(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj, Vec_Ptr_t *vFrontier)
static int Ivy_IsComplement(Ivy_Obj_t *p)
static void Ivy_ObjSetEquivListPrev(Ivy_Obj_t *pObj, Ivy_Obj_t *pPrev)
static int Ivy_BitWordNum(int nBits)
static void Ivy_ObjSetClassNodeLast(Ivy_Obj_t *pObj, Ivy_Obj_t *pLast)
#define Ivy_FraigForEachEquivClassSafe(pList, pEnt, pEnt2)
static void Ivy_ObjSetNodeHashNext(Ivy_Obj_t *pObj, Ivy_Obj_t *pNext)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Ivy_NodeComplementSim(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
int Ivy_FraigRefineClass_rec(Ivy_FraigMan_t *p, Ivy_Obj_t *pClass)
ABC_INT64_T nInsLimitGlobal
static int Ivy_InfoHasBit(unsigned *p, int i)
#define CUDD_UNIQUE_SLOTS
Ivy_FraigSim_t * pSimStart
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
static ABC_INT64_T s_nInsLimitGlobal
static Ivy_Obj_t * Ivy_ManPi(Ivy_Man_t *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int Ivy_FraigRefineClasses(Ivy_FraigMan_t *p)
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Ivy_ManForEachPi(p, pObj, i)
ITERATORS ///.
void Aig_ManStop(Aig_Man_t *p)
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
int Ivy_FraigCheckOutputSims(Ivy_FraigMan_t *p)
#define Ivy_FraigForEachBinNode(pBin, pEnt)
float nMiteringLimitMulti
void Cudd_Deref(DdNode *node)
int Ivy_ObjIsMuxType(Ivy_Obj_t *pObj)
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static int Ivy_FraigNodeIsConst(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
static int Ivy_FraigCheckCone(Ivy_FraigMan_t *pGlo, Ivy_Man_t *p, Ivy_Obj_t *pObj1, Ivy_Obj_t *pObj2, int nConfLimit)
DdNode * Cudd_ReadLogicZero(DdManager *dd)
static void veci_push(veci *v, int e)
static int Ivy_ObjIsPi(Ivy_Obj_t *pObj)
void sat_solver_delete(sat_solver *s)
void Ivy_NodeSimulateSim(Ivy_FraigMan_t *p, Ivy_FraigSim_t *pSims)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
#define Ivy_ManForEachPo(p, pObj, i)
static void Ivy_FraigMiterProve(Ivy_FraigMan_t *p)
void Ivy_NodeAssignRandom(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
void Ivy_FraigPrintActivity(Ivy_FraigMan_t *p)
static int Aig_IsComplement(Aig_Obj_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
int Ivy_FraigProve(Ivy_Man_t **ppManAig, void *pPars)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static void Ivy_FraigPrint(Ivy_FraigMan_t *p)
static int Ivy_ManLatchNum(Ivy_Man_t *p)
static void Ivy_ObjSetSatNum(Ivy_Obj_t *pObj, int Num)
#define ABC_ALLOC(type, num)
Ivy_Man_t * Ivy_ManDup(Ivy_Man_t *p)
unsigned Ivy_NodeHash(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
#define Ivy_ManForEachNode(p, pObj, i)
static int Ivy_ObjSatNum(Ivy_Obj_t *pObj)
static int Ivy_ManPoNum(Ivy_Man_t *p)
static void veci_resize(veci *v, int k)
void Ivy_NodeAssignConst(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj, int fConst1)
static abctime Abc_Clock()
void Ivy_FraigSavePattern0(Ivy_FraigMan_t *p)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Ivy_NodeHasZeroSim(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
void Ivy_ManStop(Ivy_Man_t *p)
void Ivy_FraigCreateClasses(Ivy_FraigMan_t *p)
static int Ivy_FraigNodesAreEquiv(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1)
Ivy_Obj_t * Ivy_ObjRecognizeMux(Ivy_Obj_t *pObj, Ivy_Obj_t **ppObjT, Ivy_Obj_t **ppObjE)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
static int sat_solver_var_value(sat_solver *s, int v)
static Ivy_Obj_t * Ivy_ObjChild1Equiv(Ivy_Obj_t *pObj)
static Ivy_FraigMan_t * Ivy_FraigStart(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static int Ivy_FraigSetActivityFactors(Ivy_FraigMan_t *p, Ivy_Obj_t *pOld, Ivy_Obj_t *pNew)
DdNode * Cudd_bddVectorCompose(DdManager *dd, DdNode *f, DdNode **vector)
static void Ivy_FraigNodeAddToSolver(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1)
static ABC_INT64_T s_nBTLimitGlobal
#define IVY_MIN(a, b)
MACRO DEFINITIONS ///.
static lit lit_neg(lit l)
static Vec_Ptr_t * Ivy_ObjFaninVec(Ivy_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Ivy_FraigMan_t_ Ivy_FraigMan_t
DECLARATIONS ///.
void Ivy_FraigSimulateOne(Ivy_FraigMan_t *p)
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
ABC_INT64_T nTotalInspectsMade
int Ivy_FraigSelectBestPat(Ivy_FraigMan_t *p)
int Ivy_ManLevels(Ivy_Man_t *p)
void Ivy_FraigRemoveClass(Ivy_FraigList_t *pList, Ivy_Obj_t *pClass)
void Ivy_FraigAddClass(Ivy_FraigList_t *pList, Ivy_Obj_t *pClass)
ABC_INT64_T nTotalBacktracksMade
static unsigned Ivy_ObjRandomSim()
static void Ivy_ObjSetEquivListNext(Ivy_Obj_t *pObj, Ivy_Obj_t *pNext)
int Ivy_FraigCountClassNodes(Ivy_Obj_t *pClass)
Ivy_Obj_t * Ivy_ObjCreatePo(Ivy_Man_t *p, Ivy_Obj_t *pDriver)
void Ivy_FraigPrintClass(Ivy_Obj_t *pClass)
void Ivy_ManIncrementTravId(Ivy_Man_t *p)
DECLARATIONS ///.
void Ivy_FraigAddClausesMux(Ivy_FraigMan_t *p, Ivy_Obj_t *pNode)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Ivy_FraigStop(Ivy_FraigMan_t *p)
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Ivy_Man_t * Ivy_FraigMiter(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
void Ivy_FraigCollectSuper_rec(Ivy_Obj_t *pObj, Vec_Ptr_t *vSuper, int fFirst, int fUseMuxes)
void Ivy_NodeAddToClass(Ivy_Obj_t *pClass, Ivy_Obj_t *pObj)
void Ivy_FraigSavePattern3(Ivy_FraigMan_t *p)
static void Ivy_ObjSetFraig(Ivy_Obj_t *pObj, Ivy_Obj_t *pNode)
static int Ivy_ObjFaninC1(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjChild0Equiv(Ivy_Obj_t *pObj)
void Ivy_FraigSavePattern1(Ivy_FraigMan_t *p)
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START void Ivy_FraigExtractCone_rec(Ivy_Man_t *p, Ivy_Obj_t *pNode, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
static lit toLitCond(int v, int c)
void sat_solver_setnvars(sat_solver *s, int n)
void Ivy_FraigSavePattern2(Ivy_FraigMan_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
static void Ivy_FraigAddToPatScores(Ivy_FraigMan_t *p, Ivy_Obj_t *pClass, Ivy_Obj_t *pClassNew)
void Ivy_FraigCheckOutputSimsSavePattern(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
static int Ivy_FraigMiterStatus(Ivy_Man_t *pMan)
ABC_INT64_T nTotalInspectLimit
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
static Ivy_Obj_t * Ivy_ObjClassNodeRepr(Ivy_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Ivy_FraigResimulate(Ivy_FraigMan_t *p)
static void Ivy_ObjSetSim(Ivy_Obj_t *pObj, Ivy_FraigSim_t *pSim)
static void Ivy_ObjSetClassNodeNext(Ivy_Obj_t *pObj, Ivy_Obj_t *pNext)
static int Ivy_ObjIsTravIdCurrent(Ivy_Man_t *p, Ivy_Obj_t *pObj)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
#define Ivy_FraigForEachEquivClass(pList, pEnt)
static Ivy_Obj_t * Ivy_ObjChild0(Ivy_Obj_t *pObj)
static Ivy_FraigSim_t * Ivy_ObjSim(Ivy_Obj_t *pObj)
static int Ivy_FraigNodesAreEquivBdd(Ivy_Obj_t *pObj1, Ivy_Obj_t *pObj2)
int Ivy_FraigCountPairsClasses(Ivy_FraigMan_t *p)
static Ivy_Obj_t * Ivy_ObjEquivListNext(Ivy_Obj_t *pObj)
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START DdNode * Ivy_FraigNodesAreEquivBdd_int(DdManager *dd, DdNode *bFunc, Vec_Ptr_t *vFront, int Level)
static void Ivy_InfoSetBit(unsigned *p, int i)
float nRewritingLimitMulti
static int * Ivy_FraigCreateModel(Ivy_FraigMan_t *p)
static Ivy_Obj_t * Ivy_ObjEquivListPrev(Ivy_Obj_t *pObj)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
void Ivy_FraigInsertClass(Ivy_FraigList_t *pList, Ivy_Obj_t *pBase, Ivy_Obj_t *pClass)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
static int Ivy_ManPiNum(Ivy_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static Ivy_Obj_t * Ivy_ObjClassNodeLast(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjNodeHashNext(Ivy_Obj_t *pObj)
ABC_INT64_T nTotalBacktrackLimit
static Ivy_Obj_t * Ivy_ObjClassNodeNext(Ivy_Obj_t *pObj)
int sat_solver_simplify(sat_solver *s)
static int Ivy_ObjIsAnd(Ivy_Obj_t *pObj)
void Ivy_FraigSavePattern(Ivy_FraigMan_t *p)
sat_solver * sat_solver_new(void)
int Ivy_FraigSetActivityFactors_rec(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj, int LevelMin, int LevelMax)
static int Ivy_ObjIsConst1(Ivy_Obj_t *pObj)
static Ivy_Man_t * Ivy_FraigPerform_int(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams, ABC_INT64_T nBTLimitGlobal, ABC_INT64_T nInsLimitGlobal, ABC_INT64_T *pnSatConfs, ABC_INT64_T *pnSatInspects)
static void Ivy_InfoXorBit(unsigned *p, int i)
#define Ivy_FraigForEachClassNode(pClass, pEnt)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Ivy_Man_t * Ivy_ManStartFrom(Ivy_Man_t *p)
static Ivy_FraigMan_t * Ivy_FraigStartSimple(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
void Ivy_FraigPrintSimClasses(Ivy_FraigMan_t *p)
static void Ivy_ObjSetClassNodeRepr(Ivy_Obj_t *pObj, Ivy_Obj_t *pRepr)
ABC_INT64_T nBTLimitGlobal
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
static Ivy_Obj_t * Ivy_NotCond(Ivy_Obj_t *p, int c)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
#define Ivy_ManForEachNodeVec(p, vIds, pObj, i)
DdNode * Cudd_bddXor(DdManager *dd, DdNode *f, DdNode *g)
static void Ivy_ObjSetFaninVec(Ivy_Obj_t *pObj, Vec_Ptr_t *vFanins)
static int Ivy_ManObjNum(Ivy_Man_t *p)
Ivy_Man_t * Ivy_FraigPerform(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
float nFraigingLimitMulti
#define ABC_CALLOC(type, num)
void Ivy_FraigSimulateOneSim(Ivy_FraigMan_t *p)
static Ivy_Obj_t * Ivy_ObjChild1(Ivy_Obj_t *pObj)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static Ivy_Obj_t * Ivy_FraigAnd(Ivy_FraigMan_t *p, Ivy_Obj_t *pObjOld)
static int Ivy_ObjFaninPhase(Ivy_Obj_t *pObj)
struct Ivy_FraigSim_t_ Ivy_FraigSim_t
static int Ivy_ManNodeNum(Ivy_Man_t *p)
int Ivy_NodeCompareSims(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj0, Ivy_Obj_t *pObj1)
static void Ivy_FraigSimulate(Ivy_FraigMan_t *p)
void Sat_SolverPrintStats(FILE *pFile, sat_solver *p)
#define Ivy_ManForEachObj(p, pObj, i)
static void Ivy_FraigMiterPrint(Ivy_Man_t *pNtk, char *pString, abctime clk, int fVerbose)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
Vec_Ptr_t * Ivy_FraigCollectSuper(Ivy_Obj_t *pObj, int fUseMuxes)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
void Ivy_NodeSimulate(Ivy_FraigMan_t *p, Ivy_Obj_t *pObj)
void Ivy_FraigAddClausesSuper(Ivy_FraigMan_t *p, Ivy_Obj_t *pNode, Vec_Ptr_t *vSuper)
void Ivy_FraigAssignRandom(Ivy_FraigMan_t *p)
Aig_Man_t * Ivy_FraigExtractCone(Ivy_Man_t *p, Ivy_Obj_t *pObj1, Ivy_Obj_t *pObj2, Vec_Int_t *vLeaves)
void Ivy_FraigCleanPatScores(Ivy_FraigMan_t *p)
Ivy_FraigParams_t * pParams
static void Ivy_FraigSweep(Ivy_FraigMan_t *p)
int Aig_ManCleanup(Aig_Man_t *p)
static int Ivy_ObjFaninC0(Ivy_Obj_t *pObj)
void Ivy_FraigAssignDist1(Ivy_FraigMan_t *p, unsigned *pPat)
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
int Ivy_ManCleanup(Ivy_Man_t *p)
int Fra_FraigSat(Aig_Man_t *pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fFlipBits, int fAndOuts, int fNewSolver, int fVerbose)
ITERATORS ///.
static void Ivy_ObjSetTravIdCurrent(Ivy_Man_t *p, Ivy_Obj_t *pObj)
int Cudd_DagSize(DdNode *node)
static Ivy_Obj_t * Ivy_ObjFraig(Ivy_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)