52 p->nCallsRecycle = 100;
69 Vec_IntFreeP( &
p->vFront );
70 Vec_IntFreeP( &
p->vFanins );
71 Vec_IntFreeP( &
p->vPattern );
72 Vec_IntFreeP( &
p->vDisPairs );
73 Vec_IntFreeP( &
p->vPivot );
74 Vec_IntFreeP( &
p->vId2Var );
75 Vec_IntFreeP( &
p->vVar2Id );
88 assert( Vec_IntSize(&
p->pFraig->vHTable) == 0 );
92 if (
p->pSat == NULL )
94 printf(
"Constraints are UNSAT after propagation.\n" );
101 if (
p->vPivot == (
Vec_Int_t *)(ABC_PTRINT_T)1 )
103 printf(
"Constraints are UNSAT.\n" );
107 if (
p->vPivot == NULL )
109 printf(
"Conflict limit is reached while trying to find one SAT assignment.\n" );
113 sat_solver_bookmark(
p->pSat );
119 printf(
"Computed reference pattern violates %d constraints (this is a bug!).\n",
Gia_ManCheckCoPhase(
p->pCare) );
124 p->vDisPairs = Vec_IntAlloc( 100 );
125 p->vPattern = Vec_IntAlloc( 100 );
126 p->vFanins = Vec_IntAlloc( 100 );
127 p->vFront = Vec_IntAlloc( 100 );
134 Abc_Print( 1,
"Parameters: SimWords = %d. SatConfs = %d. SatVarMax = %d. CallsRec = %d. Verbose = %d.\n",
135 p->pPars->nWords,
p->pPars->nBTLimit,
p->pPars->nSatVarMax,
p->pPars->nCallsRecycle,
p->pPars->fVerbose );
136 Abc_Print( 1,
"SAT calls : Total = %d. Proof = %d. Cex = %d. Undec = %d.\n",
137 p->nSatCalls,
p->nSatCallsUnsat,
p->nSatCallsSat,
p->nSatCallsUndec );
138 Abc_Print( 1,
"SAT solver: Vars = %d. Clauses = %d. Recycles = %d. Sim rounds = %d.\n",
141 p->timeOther =
p->timeTotal -
p->timeSimInit -
p->timeSimSat -
p->timeCnfGen -
p->timeSatSat -
p->timeSatUnsat -
p->timeSatUndec;
142 ABC_PRTP(
"Initialization ",
p->timeSimInit,
p->timeTotal );
143 ABC_PRTP(
"SAT simulation ",
p->timeSimSat,
p->timeTotal );
144 ABC_PRTP(
"CNF generation ",
p->timeSimSat,
p->timeTotal );
145 ABC_PRTP(
"SAT solving ",
p->timeSat-
p->timeCnfGen,
p->timeTotal );
146 ABC_PRTP(
" unsat ",
p->timeSatUnsat,
p->timeTotal );
147 ABC_PRTP(
" sat ",
p->timeSatSat,
p->timeTotal );
148 ABC_PRTP(
" undecided ",
p->timeSatUndec,
p->timeTotal );
149 ABC_PRTP(
"Other ",
p->timeOther,
p->timeTotal );
150 ABC_PRTP(
"TOTAL ",
p->timeTotal,
p->timeTotal );
168 if ( Ssc_ObjSatVar(
p, iFraigObj) )
169 return sat_solver_var_value(
p->pSat, Ssc_ObjSatVar(
p, iFraigObj) );
170 pObj = Gia_ManObj(
p->pFraig, iFraigObj );
171 assert( Gia_ObjIsAnd(pObj) );
174 pObj->
fMark0 = (Res0 ^ Gia_ObjFaninC0(pObj)) & (Res1 ^ Gia_ObjFaninC1(pObj));
180 if ( Gia_ObjIsTravIdCurrent(
p->pAig, pObj) )
182 Gia_ObjSetTravIdCurrent(
p->pAig, pObj);
192 pObj->
fMark0 = (Res0 ^ Gia_ObjFaninC0(pObj)) & (Res1 ^ Gia_ObjFaninC1(pObj));
199 assert( iRepr == Gia_ObjRepr(
p->pAig, iObj) );
200 assert( Gia_ObjIsHead(
p->pAig, iRepr ) );
208 assert( iRepr != Gia_ObjRepr(
p->pAig, iObj) );
244 printf(
"Verification succeeded.\n" );
245 else if ( Status == 0 )
246 printf(
"Verification failed.\n" );
247 else if ( Status == -1 )
248 printf(
"Verification undecided.\n" );
269 abctime clk, clkTotal = Abc_Clock();
270 int i, fCompl, nRefined, status;
272 assert( Gia_ManRegNum(pCare) == 0 );
273 assert( Gia_ManCiNum(pAig) == Gia_ManCiNum(pCare) );
284 if (
p->pPars->fVerbose )
298 if ( pPars->fVerbose )
300 if ( nRefined <= Gia_ManCandNum(pAig) / 100 )
303p->timeSimInit += Abc_Clock() - clk;
307 Gia_ManConst0(pAig)->Value = 0;
309 pObj->
Value = Gia_Obj2Lit(
p->pFraig, Gia_ManCi(
p->pFraig, i) );
318 if ( pAig->
iPatsPi == 64 * pPars->nWords )
323 if ( pPars->fVerbose )
326 Vec_IntClear(
p->vDisPairs );
330p->timeSimSat += Abc_Clock() - clk;
333 if ( Gia_ObjIsAnd(pObj) )
335 if ( !Gia_ObjHasRepr(pAig, i) )
337 pRepr = Gia_ObjReprObj(pAig, i);
340 Gia_ObjSetProved( pAig, i );
354 Gia_ObjSetProved( pAig, i );
356 else if ( status ==
l_True )
360 Vec_IntPush(
p->vDisPairs, Gia_ObjRepr(
p->pAig, i) );
361 Vec_IntPush(
p->vDisPairs, i );
364 if ( Gia_ObjRepr(
p->pAig, i) > 0 )
370p->timeSat += Abc_Clock() - clk;
375 while ( pAig->
iPatsPi < 64 * pPars->nWords )
379 if ( pPars->fVerbose )
382 Vec_IntClear(
p->vDisPairs );
383p->timeSimSat += Abc_Clock() - clk;
390 if ( pResult == NULL )
392 printf(
"There is no equivalences.\n" );
399 p->timeTotal = Abc_Clock() - clkTotal;
400 if ( pPars->fVerbose )
404 if ( pPars->fVerbose )
406 Abc_Print( 1,
"Reduction in AIG nodes:%8d ->%8d (%6.2f %%). ",
407 Gia_ManAndNum(pAig), Gia_ManAndNum(pResult),
408 100.0 - 100.0 * Gia_ManAndNum(pResult) / Gia_ManAndNum(pAig) );
409 Abc_PrintTime( 1,
"Time", Abc_Clock() - clkTotal );
416 if ( pPars->fVerify )
424 if ( pPars->fVerbose )
425 Abc_Print( 0,
"SAT sweeping AIG with %d constraints.\n",
p->nConstrs );
426 if (
p->nConstrs == 0 )
430 pCare->
pName = Abc_UtilStrsav(
"care" );
431 for ( i = 0; i < Gia_ManCiNum(
p); i++ )
432 Gia_ManAppendCi( pCare );
433 Gia_ManAppendCo( pCare, 0 );
437 Vec_Int_t * vOuts = Vec_IntStartNatural( Gia_ManPoNum(
p) );
439 pCare =
Gia_ManDupCones(
p, Vec_IntArray(vOuts) + Gia_ManPoNum(
p) -
p->nConstrs,
p->nConstrs, 0 );
440 Vec_IntFree( vOuts );
442 if ( pPars->fVerbose )
444 printf(
"User AIG: " );
446 printf(
"Care AIG: " );
453 if ( pPars->fAppend )
456 pResult->
nConstrs = Gia_ManPoNum(pCare);
#define ABC_PRTP(a, t, T)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
struct Cec_ParCec_t_ Cec_ParCec_t
int Cec_ManVerify(Gia_Man_t *p, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
void Gia_ManHashStart(Gia_Man_t *p)
int Gia_ManHasDangling(Gia_Man_t *p)
void Gia_ManSetPhasePattern(Gia_Man_t *p, Vec_Int_t *vCiValues)
int Gia_ManIsNormalized(Gia_Man_t *p)
Gia_Man_t * Gia_ManEquivReduce(Gia_Man_t *p, int fUseAll, int fDualOut, int fSkipPhase, int fVerbose)
#define Gia_ManForEachCand(p, pObj, i)
Gia_Man_t * Gia_ManDupZero(Gia_Man_t *p)
void Gia_ManStopP(Gia_Man_t **p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
struct Gia_Obj_t_ Gia_Obj_t
void Gia_ManEquivPrintClasses(Gia_Man_t *p, int fVerbose, float Mem)
void Gia_ManInvertPos(Gia_Man_t *pAig)
#define Gia_ClassForEachObj(p, i, iObj)
void Gia_ManFillValue(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
int Gia_ManCheckCoPhase(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupCones(Gia_Man_t *p, int *pPos, int nPos, int fTrimPis)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupDfs(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupAndOr(Gia_Man_t *p, int nOuts, int fUseOr, int fCompl)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Gia_Man_t * Gia_ManDupLevelized(Gia_Man_t *p)
void Gia_ManIncrementTravId(Gia_Man_t *p)
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
#define Gia_ManForEachCi(p, pObj, i)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
void Gia_ManDupAppendShare(Gia_Man_t *p, Gia_Man_t *pTwo)
int sat_solver_nclauses(sat_solver *s)
int sat_solver_nvars(sat_solver *s)
void sat_solver_delete(sat_solver *s)
void Ssc_GiaClassesCheckPairs(Gia_Man_t *p, Vec_Int_t *vDisPairs)
void Ssc_GiaClassesInit(Gia_Man_t *p)
FUNCTION DECLARATIONS ///.
int Ssc_GiaSimClassRefineOneBit(Gia_Man_t *p, int i)
int Ssc_GiaClassesRefine(Gia_Man_t *p)
int Ssc_GiaResimulateOneClass(Ssc_Man_t *p, int iRepr, int iObj)
Gia_Man_t * Ssc_PerformSweeping(Gia_Man_t *pAig, Gia_Man_t *pCare, Ssc_Pars_t *pPars)
Gia_Man_t * Ssc_PerformSweepingConstr(Gia_Man_t *p, Ssc_Pars_t *pPars)
int Ssc_PerformVerification(Gia_Man_t *p0, Gia_Man_t *p1, Gia_Man_t *pC)
Gia_Man_t * Ssc_PerformSweepingInt(Gia_Man_t *pAig, Gia_Man_t *pCare, Ssc_Pars_t *pPars)
ABC_NAMESPACE_IMPL_START void Ssc_ManSetDefaultParams(Ssc_Pars_t *p)
DECLARATIONS ///.
int Ssc_GiaSimulatePattern_rec(Ssc_Man_t *p, Gia_Obj_t *pObj)
int Ssc_GiaSimulatePatternFraig_rec(Ssc_Man_t *p, int iFraigObj)
void Ssc_ManStop(Ssc_Man_t *p)
void Ssc_ManPrintStats(Ssc_Man_t *p)
Ssc_Man_t * Ssc_ManStart(Gia_Man_t *pAig, Gia_Man_t *pCare, Ssc_Pars_t *pPars)
void Ssc_ManStartSolver(Ssc_Man_t *p)
Vec_Int_t * Ssc_ManFindPivotSat(Ssc_Man_t *p)
int Ssc_GiaTransferPiPattern(Gia_Man_t *pAig, Gia_Man_t *pCare, Vec_Int_t *vPivot)
int Ssc_ManCheckEquivalence(Ssc_Man_t *p, int iRepr, int iObj, int fCompl)
void Ssc_GiaSimRound(Gia_Man_t *p)
void Ssc_GiaRandomPiPattern(Gia_Man_t *p, int nWords, Vec_Int_t *vPivot)
void Ssc_GiaSavePiPattern(Gia_Man_t *p, Vec_Int_t *vPat)
int Ssc_GiaEstimateCare(Gia_Man_t *p, int nWords)
void Ssc_GiaResetPiPattern(Gia_Man_t *p, int nWords)
typedefABC_NAMESPACE_HEADER_START struct Ssc_Man_t_ Ssc_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Ssc_Pars_t_ Ssc_Pars_t
INCLUDES ///.