58 assert( newStructure != NULL );
64 assert( toBeDeleted != NULL );
76 int iElem, i, nRegCount;
77 int piCopied = 0, liCopied = 0, liCreated = 0, loCopied = 0, loCreated = 0;
78 int poCopied = 0, poCreated = 0;
79 Aig_Obj_t *pObj, *pObjPo, *pObjDriver, *pObjDriverNew, *pObjPendingDriverNew, *pObjPendingAndNextPending;
80 Aig_Obj_t *pPendingFlop, *pObjConseCandFlop, *pObjSafetyInvariantPoDriver;
85 Aig_Obj_t *pObjAnteDisjunction, *pObjConsecDriver, *pObjConsecDriverNew, *pObjCandMonotone, *pObjPrevCandMonotone, *pObjMonotonePropDriver;
94 if( vConsequentCandidatesLocal == NULL )
105 sprintf(pNewAig->pName,
"%s_%s", pAig->pName,
"monotone");
106 pNewAig->pSpec = NULL;
146 Vec_PtrPush( vConseCandFlopOutput, pObjConseCandFlop );
149 nRegCount = loCreated + loCopied;
170 pObjSafetyInvariantPoDriver = pObjDriverNew;
175 pObjPo =
Aig_ManCo( pAig, pendingSignalIndexLocal );
181 pObjPendingAndNextPending =
Aig_And( pNewAig, pObjPendingDriverNew, pPendingFlop );
184 if( vAntecedentsLocal )
194 pObjAnteDisjunction =
Aig_Or( pNewAig, pObjDriverNew, pObjAnteDisjunction );
208 pObjCandMonotone =
Aig_Or( pNewAig, pObjConsecDriverNew, pObjAnteDisjunction );
210 pObjMonotonePropDriver =
Aig_Or( pNewAig,
Aig_Not(
Aig_And( pNewAig, pObjPendingAndNextPending, pObjPrevCandMonotone ) ),
214 pObjMonotonePropDriver =
Aig_And( pNewAig, pObjMonotonePropDriver, pObjSafetyInvariantPoDriver );
216 Vec_PtrPush( vCandMonotoneFlopInput, pObjCandMonotone );
217 Vec_PtrPush( vCandMonotoneProp, pObjMonotonePropDriver );
229 *startMonotonePropPo = i;
267 assert( loCopied + loCreated == liCopied + liCreated );
306 pPars->fNotVerbose = 1;
307 pPars->fSolveAll = 1;
308 pAigNew->vSeqModelVec = NULL;
311 if( pAigNew->vSeqModelVec )
315 if( cexElem == NULL && i >= pendingSignalIndexLocal + 1)
317 poSerialNum = i - (pendingSignalIndexLocal + 1);
335 return vMonotoneIndex;
360 return vCandMonotone;
389 Vec_Ptr_t *generateDisjuntiveMonotone_rec()
392 if level is not exhausted
393 for all x \in nextLevelSignals
395 append x in currAntecendent
396 recond it as a monotone predicate
397 resurse with level - 1
415 if( firstLevelMonotone == NULL ||
Vec_IntSize(firstLevelMonotone) <= 0 )
436 return hierarchyList;
443 for ( i = 0; i < p->nSize; i++ )
444 if ( p->pArray[i] == Entry )
457 Vec_Int_t *vElem, *vNewDisjunctVector, *newDisjunction;
460 Vec_Int_t *vUnionPrevMonotoneVector, *vDiffVector;
480 if( vNewDisjunctVector )
495 return newLevelPtrVec;
502 char *
name, *hintSubStr;
505 fp = fopen( fileName,
"a" );
513 hintSubStr =
strstr( name,
"hint");
515 fprintf(fp,
"%s", hintSubStr);
533 char *
name, *hintSubStr;
536 fp = fopen( fileName,
"a" );
540 printf(
"INT[%d] : ( ", i);
545 hintSubStr =
strstr( name,
"csLevel1Stabil");
547 printf(
"%s", hintSubStr);
548 fprintf(fp,
"%s", hintSubStr);
572 assert(masterVec != NULL);
606 int pendingSignalIndex;
608 int hintSingalBeginningMarker;
609 int hintSingalEndMarker;
615 Vec_Ptr_t *levelOneMonotne, *levelTwoMonotne;
630 if( pendingSignalIndex == -1 )
632 printf(
"\nNo Pending Signal Found\n");
642 if( vCandidateMonotoneSignals == NULL )
648 hintSingalBeginningMarker =
Vec_IntEntry( vCandidateMonotoneSignals, 0 );
703 if( vKnownMonotoneSignals )
707 printf(
"\n**************************************************************\n");
708 printf(
"Exploring Second Layer : Reference Po[%d] = %s", iElem,
Abc_ObjName(
Abc_NtkPo(pNtk, iElem) ));
709 printf(
"\n**************************************************************\n");
720 printf(
"Monotone Po[%d] = %s, (%d, %d)\n", iElemTwo,
Abc_ObjName(
Abc_NtkPo(pNtk, iElemTwo) ), iElem, iElemTwo );
754 return vMasterDisjunctions;
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
int findPendingSignal(Abc_Ntk_t *pNtk)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void append(const vec< T > &from, vec< T > &to)
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
void deallocateVecOfIntVec(Vec_Ptr_t *vecOfIntVec)
int collectSafetyInvariantPOIndex(Abc_Ntk_t *pNtk)
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)
void Pdr_ManSetDefaultParams(Pdr_Par_t *pPars)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Pdr_Par_t_ Pdr_Par_t
INCLUDES ///.
struct antecedentConsequentVectorsStruct * allocAntecedentConsequentVectorsStruct()
int Vec_IntPushUniqueLocal(Vec_Int_t *p, int Entry)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Vec_Ptr_t * findNextLevelDisjunctiveMonotone(Aig_Man_t *pAig, struct aigPoIndices *aigPoIndicesInstance, struct antecedentConsequentVectorsStruct *anteConsecInstance, Vec_Ptr_t *previousMonotoneVectors)
static int Aig_IsComplement(Aig_Obj_t *p)
Vec_Int_t * updateAnteConseVectors(struct antecedentConsequentVectorsStruct *anteConse)
Vec_Int_t * vectorDifference(Vec_Int_t *A, Vec_Int_t *B)
Vec_Int_t * createSingletonIntVector(int iElem)
struct aigPoIndices * allocAigPoIndices()
static int Vec_IntFind(Vec_Int_t *p, int Entry)
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Aig_Man_t * createDisjunctiveMonotoneTester(Aig_Man_t *pAig, struct aigPoIndices *aigPoIndicesArg, struct antecedentConsequentVectorsStruct *anteConseVectors, int *startMonotonePropPo)
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
int attrHintSingalBeginningMarker
static int Vec_PtrSize(Vec_Ptr_t *p)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
#define Saig_ManForEachLi(p, pObj, i)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
Vec_Ptr_t * findDisjunctiveMonotoneSignals(Abc_Ntk_t *pNtk)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
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 void Aig_ObjChild0Flip(Aig_Obj_t *pObj)
void deallocAigPoIndices(struct aigPoIndices *toBeDeletedAigPoIndices)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Aig_ManObjNumMax(Aig_Man_t *p)
int attrPendingSignalIndex
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
void printAllIntVectors(Vec_Ptr_t *vDisjunctions, Abc_Ntk_t *pNtk, char *fileName)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
int Pdr_ManSolve(Aig_Man_t *p, Pdr_Par_t *pPars)
int attrHintSingalEndMarker
static int Vec_IntSize(Vec_Int_t *p)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void deallocAntecedentConsequentVectorsStruct(struct antecedentConsequentVectorsStruct *toBeDeleted)
void appendVecToMasterVecInt(Vec_Ptr_t *masterVec, Vec_Ptr_t *candVec)
#define Saig_ManForEachPo(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
void printAllIntVectorsStabil(Vec_Ptr_t *vDisjunctions, Abc_Ntk_t *pNtk, char *fileName)
Vec_Int_t * findHintOutputs(Abc_Ntk_t *pNtk)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Vec_Int_t * findNewDisjunctiveMonotone(Aig_Man_t *pAig, struct aigPoIndices *aigPoIndicesArg, struct antecedentConsequentVectorsStruct *anteConseVectors)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Aig_ManCleanup(Aig_Man_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)