47 DdNode * bBdd0, * bBdd1, * bFunc;
94 DdNode * bBdd0, * bBdd1, * bRes, * bXor, * bTemp;
105 if ( pObj->
pData == NULL )
158 DdNode * bRes, * bTemp, * bVar;
159 int i, iGroupFirst, iGroupLast;
161 TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0;
169 assert( iGroupFirst <= iGroupLast );
170 if ( iGroupFirst < iGroupLast )
182 assert( iGroupFirst <= iGroupLast );
183 if ( iGroupFirst < iGroupLast )
190 p->dd->TimeStop = TimeStop;
208 DdNode * bRes, * bTemp, * bVar;
211 TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0;
216 assert( iGroupLast >= iGrpPlace );
217 if ( iGroupLast > iGrpPlace )
226 assert( iGroupLast >= iGrpPlace );
227 if ( iGroupLast > iGrpPlace )
234 p->dd->TimeStop = TimeStop;
252 DdNode * bRes, * bTemp, * bVar;
255 TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0;
262 assert( iGroupFirst <= iGrpPlace );
263 if ( iGroupFirst < iGrpPlace )
274 assert( iGroupFirst <= iGrpPlace );
275 if ( iGroupFirst < iGrpPlace )
282 p->dd->TimeStop = TimeStop;
300 DdNode * bRes, * bVar, * bTemp;
330 int fCheckSupport = 0;
332 DdNode * bImage, * bGroup, * bCube, * bTemp;
335 for ( k = 1; k < p->pMatrix->nCols-1; k++ )
338 Index = p->pMatrix->nCols - 1 - k;
343 pGroup = p->pMatrix->pColGrps[Index];
345 if ( bGroup == NULL )
354 if ( bGroup == NULL )
371 if ( bImage == NULL )
388 for ( bTemp = bCube; bTemp != p->dd->one; bTemp =
cuddT(bTemp) )
393 printf(
"Var %d assigned to obj %d that is not LI\n", bTemp->
index, ObjId );
414 DdNode * bConstr, * bFunc, * bTemp;
418 if ( vHints == NULL )
420 TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0;
444 if ( Entry != 0 && Entry != 1 )
454 p->dd->TimeStop = TimeStop;
473 DdNode * bState = NULL, * bImage, * bOneCube, * bTemp, * bRing;
474 int i, v, RetValue, nPiOffset;
479 p->ddR->TimeStop = 0;
553 assert( pValues[i] == 0 );
565 pCex->iPo = RetValue;
587 DdNode * bCurrent, * bReached, * bNext, * bTemp, * bCube;
588 DdNode * bConstrCs, * bConstrNs;
590 int nIters, nBddSize = 0;
594 p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC +
Abc_Clock(): 0;
605 if ( pddGlo && *pddGlo )
606 p->ddG = *pddGlo, *pddGlo = NULL;
610 if ( p->pPars->fReorder )
624 p->dd->TimeStop = p->pPars->TimeTarget;
625 p->ddG->TimeStop = p->pPars->TimeTarget;
626 p->ddR->TimeStop = p->pPars->TimeTarget;
630 if ( p->ddR->bFunc == NULL )
632 if ( !p->pPars->fSilent )
633 printf(
"Reached timeout (%d seconds) during constructing the bad states.\n", p->pPars->TimeLimit );
634 p->pPars->iFrame = -1;
649 bReached = p->ddG->bFunc; p->ddG->bFunc = NULL;
661 for ( nIters = 0; nIters < p->pPars->nIterMax; nIters++ )
665 if ( p->pPars->TimeLimit && Abc_Clock() > p->pPars->TimeTarget )
667 if ( !p->pPars->fSilent )
668 printf(
"Reached timeout during image computation (%d seconds).\n", p->pPars->TimeLimit );
669 p->pPars->iFrame = nIters - 1;
681 if ( !p->pPars->fSilent )
682 printf(
"Reached timeout (%d seconds) during ring transfer.\n", p->pPars->TimeLimit );
683 p->pPars->iFrame = nIters - 1;
696 assert( p->pAigGlo->pSeqModel == NULL );
697 if ( !p->pPars->fBackward )
699 if ( !p->pPars->fSilent )
701 if ( !p->pPars->fBackward )
702 Abc_Print( 1,
"Output %d of miter \"%s\" was asserted in frame %d. ", p->pAigGlo->pSeqModel->iPo, p->pAigGlo->pName, p->pAigGlo->pName, nIters );
704 Abc_Print( 1,
"Output ??? of miter \"%s\" was asserted in frame %d (counter-example is not produced). ", p->pAigGlo->pName, nIters );
707 p->pPars->iFrame = nIters - 1;
732 if ( !p->pPars->fSilent )
733 printf(
"Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit );
734 p->pPars->iFrame = nIters - 1;
759 if ( !p->pPars->fSilent )
760 printf(
"Reached timeout (%d seconds) during image computation in transfer 1.\n", p->pPars->TimeLimit );
761 p->pPars->iFrame = nIters - 1;
781 if ( nBddSize > p->pPars->nBddMax )
789 if ( bCurrent == NULL )
807 if ( bCurrent == NULL )
809 if ( !p->pPars->fSilent )
810 printf(
"Reached timeout (%d seconds) during image computation in transfer 2.\n", p->pPars->TimeLimit );
811 p->pPars->iFrame = nIters - 1;
823 bReached =
Cudd_bddOr( p->ddG, bTemp = bReached, bNext );
824 if ( bReached == NULL )
835 if ( p->pPars->fVerbose )
837 fprintf( stdout,
"F =%5d : ", nIters );
838 fprintf( stdout,
"Im =%6d ", nBddSize );
856 if ( bReached == NULL )
858 p->pPars->iFrame = nIters - 1;
865 if ( p->pPars->fVerbose )
868 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
869 fprintf( stdout,
"Reachability analysis is stopped after %d frames.\n", nIters );
871 fprintf( stdout,
"Reachability analysis completed after %d frames.\n", nIters );
872 fprintf( stdout,
"Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0,
Saig_ManRegNum(p->pAig)) );
875 if ( nIters >= p->pPars->nIterMax || nBddSize > p->pPars->nBddMax )
877 if ( !p->pPars->fSilent )
878 printf(
"Verified only for states reachable in %d frames. ", nIters );
879 p->pPars->iFrame = p->pPars->nIterMax;
885 assert( p->ddG->bFunc == NULL );
886 p->ddG->bFunc = bReached; bReached = NULL;
887 assert( *pddGlo == NULL );
888 *pddGlo = p->ddG; p->ddG = NULL;
892 if ( !p->pPars->fSilent )
893 printf(
"The miter is proved unreachable after %d iterations. ", nIters );
894 p->pPars->iFrame = nIters - 1;
static int * Vec_IntArray(Vec_Int_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define CUDD_UNIQUE_SLOTS
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
double Cudd_CountMinterm(DdManager *manager, DdNode *node, int nvars)
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 ///.
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 ///.
DdNode * Cudd_Support(DdManager *dd, DdNode *f)
void Cudd_Deref(DdNode *node)
int Cudd_ReadReorderings(DdManager *dd)
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
Abc_Cex_t * Llb_ManReachDeriveCex(Llb_Man_t *p)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
ABC_NAMESPACE_IMPL_START DdNode * Llb_BddComputeBad(Aig_Man_t *pInit, DdManager *dd, abctime TimeOut)
DECLARATIONS ///.
int Llb_ManReachability(Llb_Man_t *p, Vec_Int_t *vHints, DdManager **pddGlo)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
DdNode * Llb_ManComputeInitState(Llb_Man_t *p, DdManager *dd)
void Llb_ManPrepareVarLimits(Llb_Man_t *p)
static abctime Abc_Clock()
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
int Cudd_ReadSize(DdManager *dd)
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Vec_Ptr_t * Aig_ManDfsNodes(Aig_Man_t *p, Aig_Obj_t **ppNodes, int nNodes)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(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 ///.
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
#define Saig_ManForEachLo(p, pObj, i)
DdNode * Llb_ManConstructGroupBdd(Llb_Man_t *p, Llb_Grp_t *pGroup)
DdNode * Cudd_bddOr(DdManager *dd, DdNode *f, DdNode *g)
static void Abc_Print(int level, const char *format,...)
DdNode * Llb_ManConstructQuantCubeFwd(Llb_Man_t *p, Llb_Grp_t *pGroup, int iGrpPlace)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
ABC_NAMESPACE_IMPL_START DdNode * Llb_ManConstructOutBdd(Aig_Man_t *pAig, Aig_Obj_t *pNode, DdManager *dd)
DECLARATIONS ///.
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static void Abc_InfoSetBit(unsigned *p, int i)
void Cudd_AutodynDisable(DdManager *unique)
DdNode * Llb_ManConstructQuantCubeIntern(Llb_Man_t *p, Llb_Grp_t *pGroup, int iGrpPlace, int fBackward)
static int Aig_ManRegNum(Aig_Man_t *p)
DdNode * Cudd_ReadOne(DdManager *dd)
int Cudd_bddLeq(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Llb_ManConstructQuantCubeBwd(Llb_Man_t *p, Llb_Grp_t *pGroup, int iGrpPlace)
static int Vec_IntSize(Vec_Int_t *p)
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
DdNode * Cudd_bddXor(DdManager *dd, DdNode *f, DdNode *g)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
#define Cudd_NotCond(node, c)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
static int Aig_ObjId(Aig_Obj_t *pObj)
DdNode * Llb_ManCreateConstraints(Llb_Man_t *p, Vec_Int_t *vHints, int fUseNsVars)
DdNode * Llb_ManComputeImage(Llb_Man_t *p, DdNode *bInit, int fBackward)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
void Cudd_AutodynEnable(DdManager *unique, Cudd_ReorderingType method)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
void Aig_ManCleanData(Aig_Man_t *p)
DdNode * Cudd_bddIntersect(DdManager *dd, DdNode *f, DdNode *g)
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Llb_Man_t_ Llb_Man_t
INCLUDES ///.
int Cudd_ReadGarbageCollections(DdManager *dd)
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
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)