91 int i, iVar, iVarBest = -1, iValue, iValueBest =
ABC_INFINITY, Size0Best = -1;
92 int Size, Size0, Size1;
102 printf(
"Var =%3d : ", iVar );
110 printf(
"Size0 =%6d ", Size0 );
118 printf(
"Size1 =%6d ", Size1 );
123 printf(
"D =%6d ", Size0 + Size1 - Size );
127 printf(
"S =%6d\n", iValue );
128 if ( Size0 > 1 && Size1 > 1 && iValueBest > iValue )
135 printf(
"BestVar = %4d/%4d. Value =%6d. Orig =%6d. Size0 =%6d. ",
156 printf(
"Original = %6d. SuppSize = %3d. ",
159 printf(
"Result = %6d. SuppSize = %3d.\n",
178 int i, iVarLi, iVarLo;
217 DdNode * bRes, * bVar, * bTemp;
251 DdNode * bState = NULL, * bImage, * bOneCube, * bTemp, * bRing;
252 int i, v, RetValue, nPiOffset;
257 p->ddR->TimeStop = 0;
305 bImage =
Llb_NonlinImage( p->pAig, p->vLeaves, p->vRoots, p->pVars2Q, p->dd, bState,
306 p->pPars->fReorder, p->pPars->fVeryVerbose, NULL );
334 assert( pValues[i] == 0 );
346 pCex->iPo = RetValue;
385 printf(
"%d=%d ", i, dd->
perm[i] );
405 int i, Sum = 0, Entry;
406 for ( i = 0; i < dd->
size; i++ )
409 if ( pSubt->
keys == pSubt->
dead + 1 )
432 int nIters, nBddSize0, nBddSize = -1, NumCmp;
437 p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC +
Abc_Clock(): 0;
440 p->dd->TimeStop = p->pPars->TimeTarget;
441 p->ddG->TimeStop = p->pPars->TimeTarget;
442 p->ddR->TimeStop = p->pPars->TimeTarget;
445 assert( p->dd->bFunc == NULL );
451 if ( p->ddR->bFunc == NULL )
453 if ( !p->pPars->fSilent )
454 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
455 p->pPars->iFrame = -1;
461 p->dd =
Llb_NonlinImageStart( p->pAig, p->vLeaves, p->vRoots, p->pVars2Q, p->pOrderL, 1, p->pPars->TimeTarget );
464 if ( !p->pPars->fSilent )
465 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
466 p->pPars->iFrame = -1;
472 for ( nIters = 0; nIters < p->pPars->nIterMax; nIters++ )
476 if ( p->pPars->TimeLimit && Abc_Clock() > p->pPars->TimeTarget )
478 if ( !p->pPars->fSilent )
479 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
480 p->pPars->iFrame = nIters - 1;
489 if ( !p->pPars->fSilent )
490 printf(
"Reached timeout (%d seconds) during ring transfer.\n", p->pPars->TimeLimit );
491 p->pPars->iFrame = nIters - 1;
501 assert( p->pInit->pSeqModel == NULL );
502 if ( !p->pPars->fBackward )
504 if ( !p->pPars->fSilent )
506 if ( !p->pPars->fBackward )
507 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. ", p->pInit->pSeqModel->iPo, nIters );
509 Abc_Print( 1,
"Output ??? was asserted in frame %d (counter-example is not produced). ", nIters );
512 p->pPars->iFrame = nIters - 1;
525 if ( !p->pPars->fSilent )
526 printf(
"Reached timeout (%d seconds) during image computation in quantification.\n", p->pPars->TimeLimit );
527 p->pPars->iFrame = nIters - 1;
541 if ( p->ddG->bFunc2 == NULL )
543 if ( !p->pPars->fSilent )
544 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
545 p->pPars->iFrame = nIters - 1;
557 memcpy( p->pOrderL2, p->dd->perm,
sizeof(
int) * p->dd->size );
563 p->dd =
Llb_NonlinImageStart( p->pAig, p->vLeaves, p->vRoots, p->pVars2Q, p->pOrderL, 0, p->pPars->TimeTarget );
566 if ( !p->pPars->fSilent )
567 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
568 p->pPars->iFrame = nIters - 1;
576 if ( p->ddG->bFunc2 == NULL )
578 if ( !p->pPars->fSilent )
579 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
580 p->pPars->iFrame = nIters - 1;
593 p->ddG->bFunc =
Cudd_bddOr( p->ddG, bTemp = p->ddG->bFunc, p->ddG->bFunc2 );
594 if ( p->ddG->bFunc == NULL )
596 if ( !p->pPars->fSilent )
597 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
598 p->pPars->iFrame = nIters - 1;
615 if ( p->dd->bFunc == NULL )
617 if ( !p->pPars->fSilent )
618 printf(
"Reached timeout (%d seconds) during image computation in transfer 2.\n", p->pPars->TimeLimit );
619 p->pPars->iFrame = nIters - 1;
627 if ( p->pPars->fVerbose )
629 printf(
"I =%3d : ", nIters );
630 printf(
"Fr =%7d ", nBddSize0 );
631 printf(
"Im =%7d ", nBddSize );
632 printf(
"(%4d %4d) ", p->ddLocReos, p->ddLocGrbs );
636 printf(
"cL =%5d ", NumCmp );
639 memcpy( p->pOrderG, p->ddG->perm,
sizeof(
int) * p->ddG->size );
650 if ( nIters == p->pPars->nIterMax - 1 )
652 if ( !p->pPars->fSilent )
653 printf(
"Reached limit on the number of timeframes (%d).\n", p->pPars->nIterMax );
654 p->pPars->iFrame = nIters;
662 if ( p->pPars->fVerbose )
665 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
666 printf(
"Reachability analysis is stopped after %d frames.\n", nIters );
668 printf(
"Reachability analysis completed after %d frames.\n", nIters );
669 printf(
"Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0,
Saig_ManRegNum(p->pAig)) );
672 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
674 if ( !p->pPars->fSilent )
675 printf(
"Verified only for states reachable in %d frames. ", nIters );
676 p->pPars->iFrame = p->pPars->nIterMax;
680 if ( !p->pPars->fSilent )
681 printf(
"The miter is proved unreachable after %d iterations. ", nIters );
682 p->pPars->iFrame = nIters - 1;
730 p->pOrderL[i] = p->pOrderL2[i] = p->pOrderG[i] = i;
750 if ( p->pPars->fVerbose )
752 p->timeOther = p->timeTotal - p->timeImage - p->timeTran1 - p->timeTran2 - p->timeGloba;
754 ABC_PRTP(
"Image ", p->timeImage, p->timeTotal );
758 ABC_PRTP(
"Transfer1", p->timeTran1, p->timeTotal );
759 ABC_PRTP(
"Transfer2", p->timeTran2, p->timeTotal );
760 ABC_PRTP(
"Global ", p->timeGloba, p->timeTotal );
761 ABC_PRTP(
"Other ", p->timeOther, p->timeTotal );
762 ABC_PRTP(
"TOTAL ", p->timeTotal, p->timeTotal );
763 ABC_PRTP(
" reo ", p->timeReo, p->timeTotal );
764 ABC_PRTP(
" reoG ", p->timeReoG, p->timeTotal );
773 if ( p->ddG->bFunc2 )
848 if ( pPars->fVerbose )
850 if ( pPars->fVerbose )
853 if ( !pPars->fSkipReach )
DdNode * Cudd_SubsetHeavyBranch(DdManager *dd, DdNode *f, int numVars, int threshold)
static int * Vec_IntArray(Vec_Int_t *p)
int Llb_NonlinCoreReach(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define CUDD_UNIQUE_SLOTS
void Llb_NonlinExperiment(Aig_Man_t *pAig, int Num)
void Llb_MnnStop(Llb_Mnn_t *p)
DdManager * Llb_NonlinImageStart(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, int *pOrder, int fFirst, abctime TimeTarget)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
double Cudd_CountMinterm(DdManager *manager, DdNode *node, int nvars)
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
static int Saig_ManPoNum(Aig_Man_t *p)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Llb_Mnn_t_ Llb_Mnn_t
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
void Llb_NonlinImageQuit()
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
int Cudd_bddPickOneCube(DdManager *ddm, DdNode *node, char *string)
#define Vec_PtrForEachEntryReverse(Type, vVec, pEntry, i)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
void Cudd_Deref(DdNode *node)
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
int Cudd_ReadReorderings(DdManager *dd)
void Llb_NonlinTrySubsetting(DdManager *dd, DdNode *bFunc)
static Aig_Obj_t * Saig_ManLo(Aig_Man_t *p, int i)
#define Cudd_IsConstant(node)
ABC_NAMESPACE_IMPL_START DdNode * Llb_BddComputeBad(Aig_Man_t *pInit, DdManager *dd, abctime TimeOut)
DECLARATIONS ///.
void Aig_ManPrintStats(Aig_Man_t *p)
int Llb_NonlinReachability(Llb_Mnn_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
int Llb_NonlinReoHook(DdManager *dd, char *Type, void *Method)
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
#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)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Vec_Int_t * Vec_IntStartFull(int nSize)
int Cudd_ReadSize(DdManager *dd)
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
long Cudd_ReadReorderingTime(DdManager *dd)
#define ABC_PRTP(a, t, T)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
DdNode * Llb_NonlinComputeInitState(Aig_Man_t *pAig, DdManager *dd)
static int Aig_ManCoNum(Aig_Man_t *p)
static int Abc_MinInt(int a, int b)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
#define Saig_ManForEachLi(p, pObj, i)
static int Aig_ManCiNum(Aig_Man_t *p)
static int Saig_ObjIsPo(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManDupFlopsOnly(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
DdNode * Llb_CoreComputeCube(DdManager *dd, Vec_Int_t *vVars, int fUseVarIndex, char *pValues)
FUNCTION DEFINITIONS ///.
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
static void Vec_IntFreeP(Vec_Int_t **p)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Llb_NonlinImage(Aig_Man_t *pAig, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vRoots, int *pVars2Q, DdManager *dd, DdNode *bCurrent, int fReorder, int fVerbose, int *pOrder)
static void Abc_Print(int level, const char *format,...)
int Llb_NonlinCompPerms(DdManager *dd, int *pVar2Lev)
static int Saig_ManRegNum(Aig_Man_t *p)
static int Aig_ManObjNumMax(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void Abc_InfoSetBit(unsigned *p, int i)
static int Aig_ManRegNum(Aig_Man_t *p)
DdNode * Cudd_ReadOne(DdManager *dd)
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
Llb_Mnn_t * Llb_MnnStart(Aig_Man_t *pInit, Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Abc_Cex_t * Llb_NonlinDeriveCex(Llb_Mnn_t *p)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
#define ABC_CALLOC(type, num)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static int Aig_ObjId(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
void Cudd_Quit(DdManager *unique)
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
int Llb_NonlinFindBestVar(DdManager *dd, DdNode *bFunc, Aig_Man_t *pAig)
FUNCTION DEFINITIONS ///.
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Cudd_SupportSize(DdManager *dd, DdNode *f)
DdNode * Llb_NonlinImageCompute(DdNode *bCurrent, int fReorder, int fDrop, int fVerbose, int *pOrder)
DdNode * Cudd_bddIntersect(DdManager *dd, DdNode *f, DdNode *g)
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
int Cudd_ReadGarbageCollections(DdManager *dd)
int Saig_ManFindFailedPoCex(Aig_Man_t *pAig, Abc_Cex_t *p)
int Cudd_DagSize(DdNode *node)
void Llb_NonlinPrepareVarMap(Llb_Mnn_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)