50 for ( k = p->
nWordsPref; k < p->nWordsTotal; k++ )
90 unsigned * pSimL, * pSimR;
94 for ( k = p->
nWordsPref; k < p->nWordsTotal; k++ )
95 if ( pSimL[k] & ~pSimR[k] )
113 unsigned * pSimL, * pSimR;
117 for ( k = p->
nWordsPref; k < p->nWordsTotal; k++ )
135 unsigned * pSimL, * pSimR;
139 for ( k = p->
nWordsPref; k < p->nWordsTotal; k++ )
140 pResult[k] |= pSimL[k] & ~pSimR[k];
158 int i, nNodes,
nTotal, nBits, * pnNodes, * pnBits, * pMemory;
166 memset( pnNodes, 0,
sizeof(
int) * (nBits + 1) );
169 if ( i == 0 )
continue;
184 assert( pnBits[i] <= nBits );
185 pnNodes[pnBits[i]]++;
189 pMemory =
ABC_ALLOC(
int, nNodes + nBits + 1 );
193 for ( i = 1; i <= nBits; i++ )
195 pMemory += pnNodes[i-1] + 1;
199 memset( pnNodes, 0,
sizeof(
int) * (nBits + 1) );
202 if ( i == 0 )
continue;
218 pMemory[ pnNodes[pnBits[i]]++ ] = i;
224 pMemory[ pnNodes[i]++ ] = 0;
225 nTotal += pnNodes[i];
227 assert( nTotal == nNodes + nBits + 1 );
247 int * pCostCount, nImpCount, Imp, i, c;
250 pCostCount =
ABC_ALLOC(
int, nCostMax + 1 );
251 memset( pCostCount, 0,
sizeof(
int) * (nCostMax + 1) );
254 assert( pCosts[i] <= nCostMax );
255 pCostCount[ pCosts[i] ]++;
257 assert( pCostCount[0] == 0 );
260 for ( c = nCostMax; c > 0; c-- )
262 nImpCount += pCostCount[c];
263 if ( nImpCount >= nImpLimit )
327 int * pImpCosts, * pNodesI, * pNodesK;
328 int nImpsTotal = 0, nImpsTried = 0, nImpsNonSeq = 0, nImpsComb = 0, nImpsCollected = 0;
330 int i, k, Imp, CostRange;
333 assert( nImpMaxLimit > 0 && nImpUseLimit > 0 && nImpUseLimit <= nImpMaxLimit );
340 for ( k = nSimWords * 32; k > 0; k-- )
341 for ( i = k - 1; i > 0; i-- )
342 for ( pNodesI = (
int *)
Vec_PtrEntry( vNodes, i ); *pNodesI; pNodesI++ )
343 for ( pNodesK = (
int *)
Vec_PtrEntry( vNodes, k ); *pNodesK; pNodesK++ )
347 pImpCosts =
ABC_ALLOC(
int, nImpMaxLimit );
350 for ( i = k - 1; i > 0; i-- )
354 for ( pNodesI = (
int *)
Vec_PtrEntry( vNodes, i ); *pNodesI; pNodesI++ )
355 for ( pNodesK = (
int *)
Vec_PtrEntry( vNodes, k ); *pNodesK; pNodesK++ )
386 vImps =
Fra_SmlSelectMaxCost( vTemp = vImps, pImpCosts, nSimWords * 32, nImpUseLimit, &CostRange );
400 if ( p->
pPars->fVerbose )
402 printf(
"Implications: All = %d. Try = %d. NonSeq = %d. Comb = %d. Res = %d.\n",
403 nImpsTotal, nImpsTried, nImpsNonSeq, nImpsComb, nImpsCollected );
404 printf(
"Implication weight: Min = %d. Pivot = %d. Max = %d. ",
405 CostMin, CostRange, CostMax );
433 int pLits[2], Imp, Left, Right, i, f, status;
434 int fComplL, fComplR;
441 for ( f = 0; f < p->
pPars->nFramesK; f++ )
452 if ( f < p->pPars->nFramesK )
455 for ( f = 0; f < p->
pPars->nFramesK; f++ )
463 assert( Left > 0 && Left < p->nSatVars );
464 assert( Right > 0 && Right < p->nSatVars );
470 pLits[0] = 2 * Left + !fComplL;
471 pLits[1] = 2 * Right + fComplR;
507 int i, Imp, Left, Right, Max, RetValue;
508 int fComplL, fComplR;
517 if ( Max > pNode->
Id )
531 if ( fComplL == fComplR )
533 assert( fComplL != fComplR );
557 printf(
"Fra_ImpCheckForNode(): Implication is not refined!\n" );
578 int Imp, i, RetValue = 0;
634 int Left, Right, Imp, i;
641 assert( pResult[0] == 0 );
671 int Left, Right, Imp, i,
Counter;
688 Counter += pfFails[i];
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
static int * Vec_IntArray(Vec_Int_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Vec_Int_t * Fra_ImpDerive(Fra_Man_t *p, int nImpMaxLimit, int nImpUseLimit, int fLatchCorr)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int * Fra_SmlCountOnes(Fra_Sml_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 ///.
Fra_Sml_t * Fra_SmlSimulateSeq(Aig_Man_t *pAig, int nPref, int nFrames, int nWords, int fCheckMiter)
int Fra_ImpCheckForNode(Fra_Man_t *p, Vec_Int_t *vImps, Aig_Obj_t *pNode, int Pos)
void sat_solver_delete(sat_solver *s)
static int Aig_IsComplement(Aig_Obj_t *p)
static void Sml_NodeSaveNotImpPatterns(Fra_Sml_t *p, int Left, int Right, unsigned *pResult)
static ABC_NAMESPACE_IMPL_START int Fra_SmlCountOnesOne(Fra_Sml_t *p, int Node)
DECLARATIONS ///.
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
void Fra_ImpAddToSolver(Fra_Man_t *p, Vec_Int_t *vImps, int *pSatVarNums)
void Fra_ImpRecordInManager(Fra_Man_t *p, Aig_Man_t *pNew)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
int Sml_CompareMaxId(unsigned short *pImp1, unsigned short *pImp2)
static int Sml_NodeNotImpWeight(Fra_Sml_t *p, int Left, int Right)
static unsigned * Fra_ObjSim(Fra_Sml_t *p, int Id)
MACRO DEFINITIONS ///.
Vec_Ptr_t * Fra_SmlSortUsingOnes(Fra_Sml_t *p, int fLatchCorr)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Aig_ManCoNum(Aig_Man_t *p)
static int Abc_MinInt(int a, int b)
static int Aig_WordCountOnes(unsigned uWord)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Aig_Obj_t * Fra_ObjFraig(Aig_Obj_t *pObj, int i)
Fra_Sml_t * Fra_SmlSimulateComb(Aig_Man_t *pAig, int nWords, int fCheckMiter)
static int Aig_ObjIsNone(Aig_Obj_t *pObj)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Vec_Int_t * Fra_SmlSelectMaxCost(Vec_Int_t *vImps, int *pCosts, int nCostMax, int nImpLimit, int *pCostRange)
static int Aig_ManObjNumMax(Aig_Man_t *p)
int Fra_ImpRefineUsingCex(Fra_Man_t *p, Vec_Int_t *vImps)
#define ABC_NAMESPACE_IMPL_START
int Fra_ImpVerifyUsingSimulation(Fra_Man_t *p)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
int sat_solver_simplify(sat_solver *s)
void Fra_SmlResimulate(Fra_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
#define Aig_ManForEachObj(p, pObj, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
static int Fra_ImpRight(int Imp)
static int Fra_ImpCreate(int Left, int Right)
static int Fra_ImpLeft(int Imp)
double Fra_ImpComputeStateSpaceRatio(Fra_Man_t *p)
int Fra_NodesAreImp(Fra_Man_t *p, Aig_Obj_t *pOld, Aig_Obj_t *pNew, int fComplL, int fComplR)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
void Fra_ImpCompactArray(Vec_Int_t *vImps)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int nTotal
DECLARATIONS ///.
static int Sml_NodeCheckImp(Fra_Sml_t *p, int Left, int Right)
void Fra_SmlStop(Fra_Sml_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)