53 int k,
Counter = 0, Counter2 = 0;
56 printf(
"The counter example is NULL.\n" );
59 for ( k = 0; k < p->nBits; k++ )
62 if ( (k - p->nRegs) % p->nPis < nInputs )
81 int nBitsTotal = (pCex->iFrame + 1) * nInputs;
83 int nBitsDC = nBitsTotal - nBitsCare;
85 int nBitsOpt = nBitsCare - nBitsEss;
88 FILE * pTable = fopen(
"cex/stats.txt",
"a+" );
89 fprintf( pTable,
"%s ", p->
pName );
90 fprintf( pTable,
"%d ", nInputs );
92 fprintf( pTable,
"%d ", pCex->iFrame + 1 );
93 fprintf( pTable,
"%d ", nBitsTotal );
94 fprintf( pTable,
"%.2f ", 100.0 * nBitsDC / nBitsTotal );
95 fprintf( pTable,
"%.2f ", 100.0 * nBitsOpt / nBitsTotal );
96 fprintf( pTable,
"%.2f ", 100.0 * nBitsEss / nBitsTotal );
97 fprintf( pTable,
"%.2f ", 100.0 * nBitsMin / nBitsTotal );
98 fprintf( pTable,
"%.2f ", 1.0*clk/(CLOCKS_PER_SEC) );
99 fprintf( pTable,
"\n" );
117 FILE * pTable = fopen(
"cex/aig_stats.txt",
"a+" );
118 fprintf( pTable,
"%s ", p->
pName );
122 fprintf( pTable,
"%.2f ", 1.0*clk/(CLOCKS_PER_SEC) );
123 fprintf( pTable,
"\n" );
151 for ( i = 0; i <= pCex->iFrame; i++ )
179 printf(
"CE-induced network is written into file \"unroll.aig\".\n" );
199 int fCompl0, fCompl1;
200 int i, k, iBit = pCex->nRegs;
216 for ( i = 0; i <= pCex->iFrame; i++ )
237 pObj->
fMark0 = fCompl0 & fCompl1;
240 else if ( !fCompl0 && !fCompl1 )
252 else if ( !fCompl0 && !fCompl1 )
270 assert( iBit == pCex->nBits );
291 printf(
"CE-induced network is written into file \"unate.aig\".\n" );
309 int i, k, Count, iBit = pCex->nRegs;
314 for ( i = 0; i <= pCex->iFrame; i++ )
317 printf(
"%3d : ", i );
318 for ( k = 0; k < nInputs; k++ )
323 printf(
" %3d ", Count );
325 for ( ; k < pCex->nPis; k++ )
330 printf(
" %3d\n", Count );
332 assert( iBit == pCex->nBits );
350 assert( pCex->nRegs > 0 );
355 for ( i = 0; i <= pCex->iFrame; i++ )
359 if ( !
Abc_InfoHasBit( pCexCare->pData, pCexCare->nRegs + i * pCexCare->nPis + k ) )
361 else if (
Abc_InfoHasBit( pCex->pData, pCex->nRegs + i * pCex->nPis + k ) )
392 int fCompl0, fCompl1;
394 assert( pCex->nRegs > 0 );
397 pNew->iFrame = pCex->iFrame;
398 pNew->iPo = pCex->iPo;
401 pNew2->iFrame = pCex->iFrame;
402 pNew2->iPo = pCex->iPo;
415 for ( i = 0; i <= pCex->iFrame; i++ )
435 pObj->
fMark0 = fCompl0 & fCompl1;
438 else if ( !fCompl0 && !fCompl1 )
466 assert( iBit == pCex->nBits );
469 printf(
"Inner states: " );
471 printf(
"Implications: " );
493 int fCompl0, fCompl1;
506 assert( fCompl0 == 1 && fCompl1 == 1 );
512 assert( fCompl0 == 0 || fCompl1 == 0 );
521 int fCompl0, fCompl1;
534 assert( fCompl0 == 1 && fCompl1 == 1 );
540 assert( fCompl0 == 0 || fCompl1 == 0 );
554 int fCompl0, fCompl1;
556 assert( pCexState->nRegs == 0 );
559 pNew->iFrame = pCexState->iFrame;
560 pNew->iPo = pCexState->iPo;
566 for ( i = pCexState->iFrame; i >= 0; i-- )
569 iBit = pCexState->nPis * i;
583 pObj->
fMark0 = fCompl0 & fCompl1;
586 else if ( !fCompl0 && !fCompl1 )
597 if ( i == pCexState->iFrame )
621 if ( pCexImpl == NULL || !
Abc_InfoHasBit(pCexImpl->pData, pNew->nPis * i + k) )
626 printf(
"Minimized: " );
628 printf(
"Care bits: " );
648 int i, k, fCompl0, fCompl1;
649 assert( pCexState->nRegs == 0 );
650 assert( iBit < pCexState->nBits );
655 pNew->iFrame = pCexState->iFrame;
656 pNew->iPo = pCexState->iPo;
662 for ( i = iBit / pCexState->nPis; i <= pCexState->iFrame; i++ )
673 pObj->
fMark0 = fCompl0 & fCompl1;
676 else if ( !fCompl0 && !fCompl1 )
689 if ( i < pCexState->iFrame )
692 int fEqual = (pCexPrev != NULL);
693 int iBitShift = (i + 1) * pCexState->nPis +
Gia_ManPiNum(p);
696 if ( fEqual && pCexPrev && (
int)pObj->
fMark1 !=
Abc_InfoHasBit(pCexPrev->pData, iBitShift + k) )
704 if ( !fChanges || fEqual )
728 for ( b = 0; b < pCexState->nBits; b++ )
736 printf(
"Not essential\n" );
738 printf(
"Essential\n" );
757 Abc_Cex_t * pNew, * pTemp, * pPrev = NULL;
758 int b, fEqual = 0, fPrevStatus = 0;
760 assert( pCexState->nBits == pCexCare->nBits );
763 pNew->iFrame = pCexState->iFrame;
764 pNew->iPo = pCexState->iPo;
766 for ( b = 0; b < pCexState->nBits; b++ )
784 if ( fEqual && fPrevStatus )
799 printf(
"Essentials: " );
825 printf(
"Counter-example care-set verification has failed.\n" );
828 pCexMin =
Bmc_CexCareBits( p, pCexStates, pCexImpl, pCexEss, 0, fVerbose );
831 printf(
"Counter-example min-set verification has failed.\n" );
static void Gia_ObjTerSimCo(Gia_Obj_t *pObj)
static void Gia_ObjTerSimRo(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ObjTerSimSet0(Gia_Obj_t *pObj)
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachCo(p, pObj, i)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
static int Abc_InfoHasBit(unsigned *p, int i)
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)
static void Abc_InfoXorBit(unsigned *p, int i)
static int Gia_ManAppendCi(Gia_Man_t *p)
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
static abctime Abc_Clock()
void Abc_CexPrintStatsInputs(Abc_Cex_t *p, int nInputs)
#define Gia_ManForEachCi(p, pObj, i)
#define Gia_ManForEachRiRo(p, pObjRi, pObjRo, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Gia_ManAndNum(Gia_Man_t *p)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static void Vec_WrdWriteEntry(Vec_Wrd_t *p, int i, word Entry)
unsigned __int64 word
DECLARATIONS ///.
void Abc_CexFreeP(Abc_Cex_t **p)
#define ABC_NAMESPACE_IMPL_END
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
#define Gia_ManForEachAnd(p, pObj, i)
#define Gia_ManForEachPi(p, pObj, i)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Abc_Cex_t * Abc_CexAllocFull(int nRegs, int nRealPis, int nFrames)
#define ABC_NAMESPACE_IMPL_START
static void Abc_InfoSetBit(unsigned *p, int i)
static int Gia_ManCiNum(Gia_Man_t *p)
static int Gia_ObjTerSimGet1(Gia_Obj_t *pObj)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static void Gia_ObjTerSimSet1(Gia_Obj_t *pObj)
static word Vec_WrdEntry(Vec_Wrd_t *p, int i)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
#define Gia_ManForEachRo(p, pObj, i)
int Gia_ManLevelNum(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
#define Gia_ManForEachRi(p, pObj, i)
void Gia_ManHashAlloc(Gia_Man_t *p)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
void Abc_CexFree(Abc_Cex_t *p)
static int Gia_ManPiNum(Gia_Man_t *p)
void Gia_ManCleanMark01(Gia_Man_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
char * Abc_UtilStrsav(char *s)
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
static void Gia_ObjTerSimSetX(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_ManObjNum(Gia_Man_t *p)
static void Gia_ObjTerSimAnd(Gia_Obj_t *pObj)
void Gia_ManHashStop(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)