96 int i, Entry, iInput, iFrame;
104 Abc_InfoSetBit( pCare->pData, pCare->nRegs + pCare->nPis * iFrame + iInput );
140 assert( !fPhase0 || !fPhase1 );
141 if ( !fPhase0 && fPhase1 )
143 else if ( fPhase0 && !fPhase1 )
149 if ( iPrio0 <= iPrio1 )
171 Vec_Int_t * vPrios, * vPi2Prio, * vReasons;
184 pObj->
fPhase =
Abc_InfoHasBit( p->pCex->pData, p->pCex->nRegs + p->pCex->nPis * iFrame + iInput );
201 pObj->
fPhase = fPhase0 && fPhase1;
202 if ( fPhase0 && fPhase1 )
204 else if ( !fPhase0 && fPhase1 )
206 else if ( fPhase0 && !fPhase1 )
286 for ( f = pCex->iFrame; f >= 0; f-- )
305 for ( f = 0; f <= pCex->iFrame; f++ )
321 int iBit = pCex->nRegs + f * pCex->nPis +
Aig_ObjCioId(pObj);
332 if ( f == pCex->iFrame )
369 p->nInputs = nInputs;
370 p->fVerbose = fVerbose;
407 int i, iFrame, iInput;
413 pObj->
fPhase =
Abc_InfoHasBit( p->pCex->pData, p->pCex->nRegs + p->pCex->nPis * iFrame + iInput );
415 if ( pCare && !
Abc_InfoHasBit( pCare->pData, p->pCex->nRegs + p->pCex->nPis * iFrame + iInput ) )
442 int i, Entry, iInput, iFrame;
476 int i, Entry, iInput, iFrame;
478 pCare =
Abc_CexDup( p->pCex, p->pCex->nRegs );
486 Abc_InfoSetBit( pCare->pData, pCare->nRegs + pCare->nPis * iFrame + iInput );
504 int nConfLimit = 1000000;
511 int i, k, Entry, RetValue;
512 int nCoreLits, * pCoreLits;
513 clock_t clk = clock();
521 printf(
"Constructed frames are incorrect.\n" );
535 if ( p->nInputs > 0 )
538 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
541 printf(
"The problem is trivially UNSAT. The CEX is real.\n" );
543 pCare =
Abc_CexDup( p->pCex, p->pCex->nRegs );
580 printf(
"Total PIs = %d. Essential PIs = %d.\n",
587 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
592 printf(
"Internal Error!!! The resulting problem is SAT.\n" );
594 printf(
"Internal Error!!! SAT solver timed out.\n" );
607 printf(
"AnalizeFinal selected %d assumptions (out of %d). Conflicts = %d.\n",
612 for ( i = 0; i < nCoreLits; i++ )
630 printf(
"Total PIs = %d. Essential PIs = %d.\n",
687 printf(
"Reduced CEX verification has failed.\n" );
690 printf(
"Reduced CEX verification has failed.\n" );
708 int nConfLimit = 1000000;
713 Vec_Int_t * vReasons, * vAssumps, * vVisited, * vVar2PiId;
714 int i, k, f, Entry, RetValue,
Counter;
742 RetValue =
Abc_InfoHasBit( p->pCex->pData, p->pCex->nRegs + p->pCex->nPis * iFrame + iInput );
751 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
752 printf(
"Assumpts = %2d. Intermediate instance is %5s. Conflicts = %2d.\n",
803 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
804 printf(
"Assumpts = %2d. Intermediate instance is %5s. Conflicts = %2d.\n",
825 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
826 printf(
"Assumpts = %2d. Intermediate instance is %5s. Conflicts = %2d.\n",
871 clock_t clk = clock();
883 printf(
"Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
886 ABC_PRT(
"Time", clock() - clk );
892 Vec_IntFree( vReasons );
893 vReasons = Saig_RefManRefineWithSat( p, vRes );
897 vRes = Saig_RefManReason2Inputs( p, vReasons );
898 printf( "Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
899 Aig_ManCiNum(p->pFrames), Vec_IntSize(vReasons),
900 Saig_ManPiNum(p->pAig) - p->nInputs, Vec_IntSize(vRes) );
903 ABC_PRT( "Time", clock() - clk );
937 printf(
"Saig_ManExtendCounterExampleTest3(): The PI count of AIG (%d) does not match that of cex (%d).\n",
950 printf(
"Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
953 ABC_PRT(
"Time", clock() - clk );
958 Vec_IntFree( vReasons );
959 vReasons = Saig_RefManRefineWithSat( p, vRes );
964 vRes = Saig_RefManReason2Inputs( p, vReasons );
967 printf( "Frame PIs = %4d (essential = %4d) AIG PIs = %4d (essential = %4d) ",
968 Aig_ManCiNum(p->pFrames), Vec_IntSize(vReasons),
969 Saig_ManPiNum(p->pAig) - p->nInputs, Vec_IntSize(vRes) );
970 ABC_PRT( "Time", clock() - clk );
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 ///.
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Aig_Man_t * Saig_ManUnrollWithCex(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, Vec_Int_t **pvMapPiF2A)
static void Vec_VecSort(Vec_Vec_t *p, int fReverse)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Saig_ManPoNum(Aig_Man_t *p)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Abc_Cex_t * Saig_RefManReason2Cex(Saig_RefMan_t *p, Vec_Int_t *vReasons)
static int Abc_InfoHasBit(unsigned *p, int i)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
Vec_Int_t * Saig_RefManFindReason(Saig_RefMan_t *p)
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)
Abc_Cex_t * Saig_ManFindCexCareBits(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fNewOrder, int fVerbose)
static int lit_var(lit l)
Vec_Int_t * Saig_RefManRefineWithSat(Saig_RefMan_t *p, Vec_Int_t *vAigPis)
Abc_Cex_t * Saig_RefManRunSat(Saig_RefMan_t *p, int fNewOrder)
void sat_solver_delete(sat_solver *s)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Vec_Vec_t * Saig_RefManOrderLiterals(Saig_RefMan_t *p, Vec_Int_t *vVar2PiId, Vec_Int_t *vAssumps)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
void Aig_ManPrintStats(Aig_Man_t *p)
int Saig_RefManSetPhases(Saig_RefMan_t *p, Abc_Cex_t *pCare, int fValue1)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
void Cnf_DataTranformPolarity(Cnf_Dat_t *pCnf, int fTransformPos)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
#define Aig_ManForEachCo(p, pObj, i)
void Aig_ManStopP(Aig_Man_t **p)
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
static int Abc_MaxInt(int a, int b)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static void Vec_VecFree(Vec_Vec_t *p)
#define Vec_VecForEachEntryInt(vGlob, Entry, i, k)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
void Saig_ManUnrollCollect_rec(Aig_Man_t *pAig, Aig_Obj_t *pObj, Vec_Int_t *vObjs, Vec_Int_t *vRoots)
static int sat_solver_final(sat_solver *s, int **ppArray)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
int Saig_ManSimDataInit(Aig_Man_t *p, Abc_Cex_t *pCex, Vec_Ptr_t *vSimInfo, Vec_Int_t *vRes)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Abc_MinInt(int a, int b)
static Vec_Int_t * Vec_IntStart(int nSize)
Abc_Cex_t * Saig_RefManCreateCex(Saig_RefMan_t *p, Vec_Int_t *vVar2PiId, Vec_Int_t *vAssumps)
#define Aig_ManForEachNode(p, pObj, i)
static void Vec_VecPushInt(Vec_Vec_t *p, int Level, int Entry)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
static lit toLitCond(int v, int c)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
void Abc_CexPrintStats(Abc_Cex_t *p)
static Aig_Obj_t * Saig_ObjLiToLo(Aig_Man_t *p, Aig_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
void Saig_RefManFindReason_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Int_t *vPrios, Vec_Int_t *vReasons)
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
static Vec_Vec_t * Vec_VecStart(int nSize)
static void Vec_IntFreeP(Vec_Int_t **p)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
static Vec_Int_t * Vec_VecEntryInt(Vec_Vec_t *p, int i)
#define ABC_NAMESPACE_IMPL_START
Saig_RefMan_t * Saig_RefManStart(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
static void Abc_InfoSetBit(unsigned *p, int i)
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Abc_Cex_t * Abc_CexDup(Abc_Cex_t *p, int nRegsNew)
Vec_Int_t * Saig_RefManReason2Inputs(Saig_RefMan_t *p, Vec_Int_t *vReasons)
FUNCTION DEFINITIONS ///.
#define ABC_CALLOC(type, num)
static int Vec_VecSize(Vec_Vec_t *p)
void Saig_RefManStop(Saig_RefMan_t *p)
void Cnf_DataFree(Cnf_Dat_t *p)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
static int Abc_BitWordNum(int nBits)
static void Vec_VecFreeP(Vec_Vec_t **p)
static int Aig_ObjId(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
static Vec_Ptr_t * Vec_VecEntry(Vec_Vec_t *p, int i)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
static void Vec_IntFree(Vec_Int_t *p)
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
static void Vec_IntClear(Vec_Int_t *p)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Vec_Int_t * Saig_ManExtendCounterExampleTest3(Aig_Man_t *pAig, int iFirstFlopPi, Abc_Cex_t *pCex, int fVerbose)
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Saig_RefMan_t_ Saig_RefMan_t
DECLARATIONS ///.
int Aig_ManCleanup(Aig_Man_t *p)
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
static int Aig_ObjCioId(Aig_Obj_t *pObj)