56 if ( pValues && pValues[i] )
77 int RetValue, iOut, nOuts;
82 RetValue =
Fra_FraigCec( &pMiterCec, 10000000, fVerbose );
86 Abc_Print( 1,
"Networks are equivalent. " );
89 else if ( RetValue == 0 )
91 Abc_Print( 1,
"Networks are NOT EQUIVALENT. " );
93 if ( pMiterCec->pData == NULL )
94 Abc_Print( 1,
"Counter-example is not available.\n" );
99 Abc_Print( 1,
"Counter-example verification has failed.\n" );
104 Abc_Print( 1,
"Primary output %d has failed", iOut );
106 Abc_Print( 1,
", along with other %d incorrect outputs", nOuts-1 );
116 Abc_Print( 1,
"Networks are UNDECIDED. " );
149 Abc_Print( 1,
"Networks are NOT EQUIVALENT. Output %d trivially differs (different phase). ", i/2 );
161 Abc_Print( 1,
"Networks are NOT EQUIVALENT. Output %d trivially differs (different PIs). ", i/2 );
174 Abc_Print( 1,
"Networks are NOT EQUIVALENT. Output %d trivially differs (PI vs. constant). ", i/2 );
189 Abc_Print( 1,
"Networks are equivalent. " );
215 int nUnsats = 0, nSats = 0, nUndecs = 0, nTrivs = 0;
216 int i, iVar0, iVar1, pLits[2], status, RetValue;
219 for ( i = 0; i < nPairs; i++ )
221 if ( (i & 0xFF) == 0 )
233 printf(
"Timeout (%d sec) is reached.\n", pPars->
TimeLimit );
234 nUndecs = nPairs - nUnsats - nSats;
239 assert( iVar0 >= 0 && iVar1 >= 0 );
247 pLits[0] =
lit_neg( pLits[0] );
248 pLits[1] =
lit_neg( pLits[1] );
252 else if ( status ==
l_True )
254 printf(
"Output %d is SAT.\n", i );
267 pLits[0] =
lit_neg( pLits[0] );
268 pLits[1] =
lit_neg( pLits[1] );
272 else if ( status ==
l_True )
274 printf(
"Output %d is SAT.\n", i );
286 printf(
"UNSAT = %6d. SAT = %6d. UNDEC = %6d. Trivial = %6d. ", nUnsats, nSats, nUndecs, nTrivs );
310 int fDumpUndecided = 0;
321 if ( RetValue == 0 || RetValue == 1 )
354 Abc_Print( 1,
"Counter-example simulation has failed.\n" );
355 Abc_Print( 1,
"Networks are NOT EQUIVALENT. " );
367 Abc_Print( 1,
"Networks are UNDECIDED after the new CEC engine. " );
370 if ( fDumpUndecided )
375 Abc_Print( 1,
"The result is written into file \"%s\".\n",
"gia_cec_undecided.aig" );
384 Abc_Print( 1,
"Calling the old CEC engine.\n" );
389 Abc_Print( 1,
"Counter-example simulation has failed.\n" );
413 if ( pMiter == NULL )
Gia_Man_t * Cec_ManSatSweeping(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
static int Gia_ObjPhase(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManTransformMiter(Gia_Man_t *p)
int Gia_ManVerifyCex(Gia_Man_t *pAig, Abc_Cex_t *p, int fDualOut)
DECLARATIONS ///.
int Cec_ManVerify(Gia_Man_t *pInit, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
static int Gia_ManPoNum(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
int Cec_ManVerifyOld(Gia_Man_t *pMiter, int fVerbose, int *piOutFail, abctime clkTotal)
void Aig_ManStop(Aig_Man_t *p)
Aig_Man_t * Cec_SignalCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
static Gia_Obj_t * Gia_ManPo(Gia_Man_t *p, int v)
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)
void Gia_ManReprToAigRepr(Aig_Man_t *pAig, Gia_Man_t *pGia)
void sat_solver_delete(sat_solver *s)
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
static int Abc_Var2Lit(int Var, int fCompl)
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Aig_Man_t * Cec_FraigCombinational(Aig_Man_t *pAig, int nConfs, int fVerbose)
static abctime Abc_Clock()
static lit lit_neg(lit l)
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Gia_ManAndNum(Gia_Man_t *p)
int Cec_ManVerifyTwo(Gia_Man_t *p0, Gia_Man_t *p1, int fVerbose)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Aig_Man_t * Cec_LatchCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
#define ABC_NAMESPACE_IMPL_END
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
int Cec_ManLSCorrespondenceClasses(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
static void Abc_Print(int level, const char *format,...)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
int Ssw_SecCexResimulate(Aig_Man_t *p, int *pModel, int *pnOutputs)
int Cec_ManVerifyTwoAigs(Aig_Man_t *pAig0, Aig_Man_t *pAig1, int fVerbose)
#define ABC_NAMESPACE_IMPL_START
static void Abc_InfoSetBit(unsigned *p, int i)
static int Gia_ManCiNum(Gia_Man_t *p)
int Cec_ManVerifyNaive(Gia_Man_t *p, Cec_ParCec_t *pPars)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
ABC_NAMESPACE_IMPL_START void Cec_ManTransformPattern(Gia_Man_t *p, int iOut, int *pValues)
DECLARATIONS ///.
void Cnf_DataFree(Cnf_Dat_t *p)
void Cec_ManFraSetDefaultParams(Cec_ParFra_t *p)
int Fra_FraigCec(Aig_Man_t **ppAig, int nConfLimit, int fVerbose)
void Gia_ManSetPhase(Gia_Man_t *p)
Cnf_Dat_t * Mf_ManGenerateCnf(Gia_Man_t *pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
int Cec_ManHandleSpecialCases(Gia_Man_t *p, Cec_ParCec_t *pPars)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
#define Gia_ManForEachPo(p, pObj, i)
void Gia_ManEquivFixOutputPairs(Gia_Man_t *p)
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_ObjIsPi(Gia_Man_t *p, Gia_Obj_t *pObj)