284 printf(
"Aig_Gla1DeriveAbs(): Internal error! Object count mismatch.\n" );
307 for ( i = 0; i < p->nFrames; i++ )
331 iSatVar =
Vec_IntEntry( p->vVec2Var, iVecId * p->nFrames + k );
356 if ( k == p->nFrames )
358 int i, j, nVecIds =
Vec_IntSize( p->vVec2Var ) / p->nFrames;
360 for ( i = 0; i < nVecIds; i++ )
362 for ( j = 0; j < p->nFrames; j++ )
364 for ( j = 0; j < p->nFrames; j++ )
368 p->vVec2Var = vVec2VarNew;
392 if ( p->vObj2Cnf == NULL )
400 if ( vClauses == NULL )
403 Cnf_ComputeClauses( p->pAig, pObj, p->vLeaves, p->vVolume, NULL, p->vCover, vClauses );
489 for ( i = 0; i < p->nFrames; i++ )
497 if ( vGateClassesOld )
585 int i, f, iVecId, iSatId;
587 pCex->iFrame = iFrame;
592 for ( f = 0; f <= iFrame; f++ )
594 iSatId =
Vec_IntEntry( p->vVec2Var, iVecId * p->nFrames + f );
606 for ( f = 0; f <= iFrame; f++ )
608 iSatId =
Vec_IntEntry( p->vVec2Var, iVecId * p->nFrames + f );
633 printf(
"== %3d ==", f );
636 printf(
" %4d PI =%6d PPI =%6d FF =%6d Node =%6d Var =%7d Conf =%6d\n",
659 Cnf_ComputeClauses( p->pAig, pObj, p->vLeaves, p->vVolume, NULL, p->vCover, p->vNodes );
689 int f, g, r, i, iSatVar, Lit, Entry, RetValue;
690 int nConfBef, nConfAft;
691 clock_t clk, clkTotal = clock();
692 clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0;
695 if ( nFramesMax == 0 )
701 printf(
"Abstracting from frame %d to frame %d with timeout %d sec.\n", nStart, nFramesMax, TimeLimit );
703 printf(
"Abstracting from frame %d to frame %d with no timeout.\n", nStart, nFramesMax );
708 p->nFramesMax = nFramesMax;
709 p->nConfLimit = nConfLimit;
710 p->fVerbose = fVerbose;
721 for ( f = 0; f < nFramesMax; f++ )
727 printf(
"Error! SAT solver became UNSAT.\n" );
744 nConfBef = p->pSat->stats.conflicts;
746 (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
747 nConfAft = p->pSat->stats.conflicts;
748 p->timeSat += clock() - clk;
754 printf(
"== %3d ==", f );
757 if ( TimeLimit && clock() > nTimeToStop )
758 printf(
" SAT solver timed out after %d seconds.\n", TimeLimit );
759 else if ( RetValue !=
l_False )
760 printf(
" SAT solver returned UNDECIDED after %5d conflicts.\n", nConfAft - nConfBef );
763 printf(
" SAT solver returned UNSAT after %5d conflicts. ", nConfAft - nConfBef );
777 printf(
"Error! CEX is invalid.\n" );
786 for ( g = 0; g <= f; g++ )
788 printf(
"Error! SAT solver became UNSAT.\n" );
801 p->timeRef += clock() - clk;
811 p->timeTotal = clock() - clkTotal;
812 if ( f == nFramesMax )
813 printf(
"Finished %d frames without exceeding conflict limit (%d).\n", f, nConfLimit );
814 else if ( p->vIncluded == NULL )
815 printf(
"The problem is SAT in frame %d. The CEX is currently not produced.\n", f );
817 printf(
"Ran out of conflict limit (%d) at frame %d.\n", nConfLimit, f );
822 ABC_PRTP(
"Sat ", p->timeSat, p->timeTotal );
823 ABC_PRTP(
"Ref ", p->timeRef, p->timeTotal );
824 ABC_PRTP(
"Total ", p->timeTotal, p->timeTotal );
827 if ( !fNaiveCnf && p->vIncluded )
829 vResult = p->vIncluded; p->vIncluded = NULL;
void Aig_Gla1ManStop(Aig_Gla1Man_t *p)
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
static int * Vec_IntArray(Vec_Int_t *p)
static Vec_Ptr_t * Vec_PtrStart(int nSize)
void Cnf_DeriveFastMark(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Saig_ManPoNum(Aig_Man_t *p)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
#define Aig_ManForEachObjVec(vIds, p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
void Aig_Gla1CollectAbstr(Aig_Gla1Man_t *p)
void sat_solver_delete(sat_solver *s)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
#define Vec_IntForEachEntryReverse(vVec, pEntry, i)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static Aig_Obj_t * Aig_ManObj(Aig_Man_t *p, int i)
Abc_Cex_t * Aig_Gla1DeriveCex(Aig_Gla1Man_t *p, int iFrame)
void Aig_Gla1ExtendIncluded(Aig_Gla1Man_t *p)
void Cnf_ComputeClauses(Aig_Man_t *p, Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes, Vec_Int_t *vMap, Vec_Int_t *vCover, Vec_Int_t *vClauses)
static int Aig_Gla1AddNode(sat_solver *pSat, int iVar, int iVar0, int iVar1, int fCompl0, int fCompl1)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int sat_solver_var_value(sat_solver *s, int v)
static int Aig_Gla1FetchVar(Aig_Gla1Man_t *p, Aig_Obj_t *pObj, int k)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Vec_Int_t * Aig_Gla1ManPerform(Aig_Man_t *pAig, Vec_Int_t *vGateClassesOld, int nStart, int nFramesMax, int nConfLimit, int TimeLimit, int fNaiveCnf, int fVerbose, int *piFrame)
#define ABC_PRTP(a, t, T)
int Aig_Gla1ObjAddToSolver(Aig_Gla1Man_t *p, Aig_Obj_t *pObj, int k)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Aig_Gla1AddConst(sat_solver *pSat, int iVar, int fCompl)
FUNCTION DEFINITIONS ///.
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
static int Aig_Gla1FetchVecId(Aig_Gla1Man_t *p, Aig_Obj_t *pObj)
static lit toLitCond(int v, int c)
void sat_solver_setnvars(sat_solver *s, int n)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Cnf_CollectLeaves(Aig_Obj_t *pRoot, Vec_Ptr_t *vSuper, int fStopCompl)
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
static void Vec_IntFreeP(Vec_Int_t **p)
Aig_Man_t * Aig_Gla1DeriveAbs(Aig_Gla1Man_t *p)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static void Abc_InfoSetBit(unsigned *p, int i)
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
sat_solver * sat_solver_new(void)
static int Vec_IntSize(Vec_Int_t *p)
static void Vec_IntPushOrderReverse(Vec_Int_t *p, int Entry)
Aig_Gla1Man_t * Aig_Gla1ManStart(Aig_Man_t *pAig, Vec_Int_t *vGateClassesOld, int fNaiveCnf)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Aig_Gla1PrintAbstr(Aig_Gla1Man_t *p, int f, int r, int v, int c)
Vec_Int_t * Saig_ManCbaFilterInputs(Aig_Man_t *pAig, int iFirstFlopPi, Abc_Cex_t *pCex, int fVerbose)
void Aig_Gla1CollectAssigned(Aig_Gla1Man_t *p, Vec_Int_t *vGateClasses)
void Aig_ManCleanMarkA(Aig_Man_t *p)
#define ABC_CALLOC(type, num)
typedefABC_NAMESPACE_IMPL_START struct Aig_Gla1Man_t_ Aig_Gla1Man_t
DECLARATIONS ///.
static void Vec_PtrFreeP(Vec_Ptr_t **p)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static void Vec_VecFreeP(Vec_Vec_t **p)
#define Saig_ManForEachPo(p, pObj, i)
static int Aig_ObjId(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
void Aig_Gla1DeriveAbs_rec(Aig_Man_t *pNew, Aig_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
void Abc_CexFree(Abc_Cex_t *p)
static void Vec_IntClear(Vec_Int_t *p)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
void Aig_ManCleanData(Aig_Man_t *p)
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
int Aig_ManCleanup(Aig_Man_t *p)
static int Aig_Gla1AddBuffer(sat_solver *pSat, int iVar0, int iVar1, int fCompl)