70 DdNode * bRes, * bVar, * bTemp;
77 iVar = fUseVarIndex ? Index : i;
102 Vec_Ptr_t * vSupps, * vQuant0, * vQuant1;
103 DdNode * bState = NULL, * bImage, * bOneCube, * bTemp, * bRing;
104 int i, v, RetValue, nPiOffset;
109 p->ddR->TimeStop = 0;
113 vSupps =
Llb_ImgSupports( p->pAig, p->vDdMans, p->vVarsNs, p->vVarsCs, 1, 0 );
148 vQuant0, vQuant1, p->vDriRefs, p->pPars->TimeTarget, 1, 0, 0 );
177 assert( pValues[i] == 0 );
188 pCex->iPo = RetValue;
212 DdNode * bCurrent, * bReached, * bNext, * bTemp;
214 int nIters, nBddSize;
223 if (
Abc_Clock() > p->pPars->TimeTarget )
225 if ( !p->pPars->fSilent )
226 printf(
"Reached timeout (%d seconds) before image computation.\n", p->pPars->TimeLimit );
227 p->pPars->iFrame = -1;
232 p->dd->TimeStop = p->pPars->TimeTarget;
233 p->ddG->TimeStop = p->pPars->TimeTarget;
234 p->ddR->TimeStop = p->pPars->TimeTarget;
237 if ( p->pPars->fBackward )
243 if ( !p->pPars->fSilent )
244 printf(
"Reached timeout (%d seconds) while computing bad states.\n", p->pPars->TimeLimit );
245 p->pPars->iFrame = -1;
257 if ( bCurrent == NULL )
260 if ( !p->pPars->fSilent )
261 printf(
"Reached timeout (%d seconds) during transfer 0.\n", p->pPars->TimeLimit );
262 p->pPars->iFrame = -1;
271 if ( p->ddR->bFunc == NULL )
273 if ( !p->pPars->fSilent )
274 printf(
"Reached timeout (%d seconds) while computing bad states.\n", p->pPars->TimeLimit );
275 p->pPars->iFrame = -1;
287 for ( nIters = 0; nIters < p->pPars->nIterMax; nIters++ )
291 if ( p->pPars->TimeLimit &&
Abc_Clock() > p->pPars->TimeTarget )
293 if ( !p->pPars->fSilent )
294 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
295 p->pPars->iFrame = nIters - 1;
305 if ( !p->pPars->fSilent )
306 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
307 p->pPars->iFrame = nIters - 1;
318 assert( p->pInit->pSeqModel == NULL );
319 if ( !p->pPars->fBackward )
323 if ( !p->pPars->fSilent )
325 if ( !p->pPars->fBackward )
326 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. ", p->pInit->pSeqModel->iPo, p->pInit->pName, nIters );
328 Abc_Print( 1,
"Output ??? was asserted in frame %d (counter-example is not produced). ", nIters );
331 p->pPars->iFrame = nIters - 1;
337 vQuant0, vQuant1, p->vDriRefs, p->pPars->TimeTarget,
338 p->pPars->fBackward, p->pPars->fReorder, p->pPars->fVeryVerbose );
341 if ( !p->pPars->fSilent )
342 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
343 p->pPars->iFrame = nIters - 1;
360 if ( !p->pPars->fSilent )
361 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
362 p->pPars->iFrame = nIters - 1;
380 if ( bCurrent == NULL )
382 if ( !p->pPars->fSilent )
383 printf(
"Reached timeout (%d seconds) during image computation in transfer 2.\n", p->pPars->TimeLimit );
384 p->pPars->iFrame = nIters - 1;
397 if ( bCurrent == NULL )
399 if ( !p->pPars->fSilent )
400 printf(
"Reached timeout (%d seconds) during image computation in transfer 2.\n", p->pPars->TimeLimit );
401 p->pPars->iFrame = nIters - 1;
415 if ( p->pPars->fVeryVerbose )
419 fprintf( stdout,
" Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0,
Saig_ManRegNum(p->pAig)) );
422 if ( p->pPars->fVerbose )
424 fprintf( stdout,
"F =%3d : ", nIters );
425 fprintf( stdout,
"Image =%6d ", nBddSize );
426 fprintf( stdout,
"(%4d%4d) ",
428 fprintf( stdout,
"Reach =%6d ",
Cudd_DagSize(bReached) );
429 fprintf( stdout,
"(%4d%4d) ",
435 if ( nIters == p->pPars->nIterMax - 1 )
437 if ( !p->pPars->fSilent )
438 printf(
"Reached limit on the number of timeframes (%d).\n", p->pPars->nIterMax );
439 p->pPars->iFrame = nIters;
445 if ( bReached == NULL )
447 p->pPars->iFrame = nIters - 1;
453 if ( p->pPars->fVerbose )
456 if ( nIters >= p->pPars->nIterMax )
457 fprintf( stdout,
"Reachability analysis is stopped after %d frames.\n", nIters );
459 fprintf( stdout,
"Reachability analysis completed after %d frames.\n", nIters );
460 fprintf( stdout,
"Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0,
Saig_ManRegNum(p->pAig)) );
463 if ( p->pPars->fDumpReached )
466 printf(
"Reached states with %d BDD nodes are dumpted into file \"reached.blif\".\n",
Cudd_DagSize(bReached) );
469 if ( nIters >= p->pPars->nIterMax )
471 if ( !p->pPars->fSilent )
473 printf(
"Verified only for states reachable in %d frames. ", nIters );
476 p->pPars->iFrame = p->pPars->nIterMax;
479 if ( !p->pPars->fSilent )
481 printf(
"The miter is proved unreachable after %d iterations. ", nIters );
484 p->pPars->iFrame = nIters - 1;
501 Vec_Ptr_t * vSupps, * vQuant0, * vQuant1;
504 if ( p->pPars->fBackward )
507 vSupps =
Llb_ImgSupports( p->pAig, p->vDdMans, p->vVarsNs, p->vVarsCs, 0, p->pPars->fVeryVerbose );
510 vSupps =
Llb_ImgSupports( p->pAig, p->vDdMans, p->vVarsCs, p->vVarsNs, 0, p->pPars->fVeryVerbose );
580 int i, iVarCs, iVarNs;
581 assert( p->vVarsCs != NULL );
582 assert( p->vVarsNs != NULL );
583 assert( p->vCs2Glo == NULL );
584 assert( p->vNs2Glo == NULL );
585 assert( p->vGlo2Cs == NULL );
586 assert( p->vGlo2Ns == NULL );
702 if ( p->vDdMans == NULL )
704 if ( !pPars->fSilent )
705 printf(
"Reached timeout (%d seconds) while deriving the partitions.\n", pPars->TimeLimit );
734 pPars->TimeTarget = pPars->TimeLimit ? pPars->TimeLimit * CLOCKS_PER_SEC +
Abc_Clock(): 0;
738 if ( pPars->fVerbose )
740 if ( pPars->fVerbose )
744 vResult =
Llb_ManComputeCuts( p, pPars->nPartValue, pPars->fVerbose, pPars->fVeryVerbose );
746 if ( pPars->TimeLimit && Abc_Clock() > pPars->TimeTarget )
748 if ( !pPars->fSilent )
749 printf(
"Reached timeout (%d seconds) after partitioning.\n", pPars->TimeLimit );
758 if ( !pPars->fSkipReach )
766 if ( RetValue == -1 )
void Llb_ImgSchedule(Vec_Ptr_t *vSupps, Vec_Ptr_t **pvQuant0, Vec_Ptr_t **pvQuant1, int fVerbose)
static int * Vec_IntArray(Vec_Int_t *p)
static void Vec_PtrReverseOrder(Vec_Ptr_t *p)
static Vec_Ptr_t * Vec_PtrStart(int nSize)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define CUDD_UNIQUE_SLOTS
typedefABC_NAMESPACE_IMPL_START struct Llb_Img_t_ Llb_Img_t
DECLARATIONS ///.
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
double Cudd_CountMinterm(DdManager *manager, DdNode *node, int nvars)
int Llb_CoreReachability_int(Llb_Img_t *p, Vec_Ptr_t *vQuant0, Vec_Ptr_t *vQuant1)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Saig_ManPoNum(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
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)
int Cudd_ReadReorderings(DdManager *dd)
DdManager * Llb_DriverLastPartition(Aig_Man_t *p, Vec_Int_t *vVarsNs, abctime TimeTarget)
ABC_NAMESPACE_IMPL_START DdNode * Llb_BddComputeBad(Aig_Man_t *pInit, DdManager *dd, abctime TimeOut)
DECLARATIONS ///.
void Aig_ManPrintStats(Aig_Man_t *p)
Llb_Img_t * Llb_CoreStart(Aig_Man_t *pInit, Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
DdNode * Llb_ImgComputeImage(Aig_Man_t *pAig, Vec_Ptr_t *vDdMans, DdManager *dd, DdNode *bInit, Vec_Ptr_t *vQuant0, Vec_Ptr_t *vQuant1, Vec_Int_t *vDriRefs, abctime TimeTarget, int fBackward, int fReorder, int fVerbose)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
#define ABC_ALLOC(type, num)
void Llb_ImgQuantifyFirst(Aig_Man_t *pAig, Vec_Ptr_t *vDdMans, Vec_Ptr_t *vQuant0, int fVerbose)
int Llb_ManReachMinCut(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Vec_Ptr_t * Llb_ManComputeCuts(Aig_Man_t *p, int Num, int fVerbose, int fVeryVerbose)
static abctime Abc_Clock()
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static Vec_Int_t * Vec_IntStartFull(int nSize)
int Llb_CoreReachability(Llb_Img_t *p)
ABC_NAMESPACE_IMPL_START Vec_Int_t * Llb_DriverCountRefs(Aig_Man_t *p)
DECLARATIONS ///.
int Cudd_ReadSize(DdManager *dd)
DdNode * Cudd_bddTransfer(DdManager *ddSource, DdManager *ddDestination, DdNode *f)
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
void Aig_ManFanoutStop(Aig_Man_t *p)
DdNode * Llb_BddQuantifyPis(Aig_Man_t *pInit, DdManager *dd, DdNode *bFunc)
Vec_Int_t * Llb_DriverCollectNs(Aig_Man_t *pAig, Vec_Int_t *vDriRefs)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Vec_Int_t * Llb_DriverCollectCs(Aig_Man_t *pAig)
void Llb_CoreStop(Llb_Img_t *p)
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
Vec_Ptr_t * Llb_CoreConstructAll(Aig_Man_t *p, Vec_Ptr_t *vResult, Vec_Int_t *vVarsNs, abctime TimeTarget)
void Llb_CoreSetVarMaps(Llb_Img_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
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 ///.
#define Saig_ManForEachLo(p, pObj, i)
static void Vec_IntFreeP(Vec_Int_t **p)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
static void Abc_Print(int level, const char *format,...)
static int Saig_ManRegNum(Aig_Man_t *p)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static int Aig_ManObjNumMax(Aig_Man_t *p)
Vec_Ptr_t * Llb_ImgSupports(Aig_Man_t *p, Vec_Ptr_t *vDdMans, Vec_Int_t *vStart, Vec_Int_t *vStop, int fAddPis, int fVerbose)
FUNCTION DEFINITIONS ///.
#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)
void Llb_ManDumpReached(DdManager *ddG, DdNode *bReached, char *pModel, char *pFileName)
void Llb_ImgQuantifyReset(Vec_Ptr_t *vDdMans)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Llb_CoreExperiment(Aig_Man_t *pInit, Aig_Man_t *pAig, Gia_ParLlb_t *pPars, Vec_Ptr_t *vResult, abctime TimeTarget)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
void Aig_ManCleanMarkAB(Aig_Man_t *p)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
#define ABC_CALLOC(type, num)
static void Vec_PtrFreeP(Vec_Ptr_t **p)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static int Aig_ObjId(Aig_Obj_t *pObj)
Abc_Cex_t * Llb_CoreDeriveCex(Llb_Img_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
DdManager * Llb_ImgPartition(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper, abctime TimeTarget)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
DdNode * Cudd_bddIntersect(DdManager *dd, DdNode *f, DdNode *g)
int Cudd_ReadGarbageCollections(DdManager *dd)
int Saig_ManFindFailedPoCex(Aig_Man_t *pAig, Abc_Cex_t *p)
int Cudd_DagSize(DdNode *node)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)