166 return (pGia->
pData != NULL);
187 double nMemTot = nMemSwp + nMemGia + nMemSat;
188 printf(
"SAT sweeper statistics:\n" );
189 printf(
"Memory usage:\n" );
190 ABC_PRMP(
"Sweeper ", nMemSwp, nMemTot );
191 ABC_PRMP(
"AIG manager ", nMemGia, nMemTot );
192 ABC_PRMP(
"SAT solver ", nMemSat, nMemTot );
193 ABC_PRMP(
"TOTAL ", nMemTot, nMemTot );
194 printf(
"Runtime usage:\n" );
195 p->timeTotal =
Abc_Clock() - p->timeStart;
196 ABC_PRTP(
"CNF construction", p->timeCnf, p->timeTotal );
197 ABC_PRTP(
"SAT solving ", p->timeSat, p->timeTotal );
198 ABC_PRTP(
" Sat ", p->timeSatSat, p->timeTotal );
199 ABC_PRTP(
" Unsat ", p->timeSatUnsat, p->timeTotal );
200 ABC_PRTP(
" Undecided ", p->timeSatUndec, p->timeTotal );
201 ABC_PRTP(
"TOTAL RUNTIME ", p->timeTotal, p->timeTotal );
204 printf(
"SAT calls = %d. Sat = %d. Unsat = %d. Undecided = %d. Proofs = %d.\n",
205 p->nSatCalls, p->nSatCallsSat, p->nSatCallsUnsat, p->nSatCallsUndec, p->nSatProofs );
223 pSwp->nConfMax = nConfMax;
228 pSwp->nTimeOut = nSeconds;
234 return pSwp->vCexUser;
302 if ( iLit < 0 )
continue;
332 return pSwp->vCondProbes;
432 printf(
"Dumping logic cones" );
440 printf(
" and conditions" );
444 printf(
" into file \"%s\".\n", pFileName );
467 int i, iLit, ProbeId;
474 if ( iLit < 0 )
continue;
493 if ( iLit < 0 )
continue;
546 int pLits[4], LitF, LitI, LitT, LitE, RetValue;
624 int i, RetValue, Lit, LitNode, pLits[2];
756 int i, LitSat, Value;
792 int iLitOld, iLitNew, iLitAig, pLitsSat[2], RetValue, RetValue1, ProbeId, i;
795 assert( p->pSat != NULL );
802 if ( iLitOld == iLitNew )
808 p->vCexUser = p->vCexSwp;
812 if ( iLitOld < iLitNew )
814 assert( iLitOld > iLitNew );
843 (ABC_INT64_T)p->nConfMax, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
855 else if ( RetValue1 ==
l_True )
857 p->vCexUser =
Gia_ManGetCex( p->pGia, p->vId2Lit, p->pSat, p->vCexSwp );
883 (ABC_INT64_T)p->nConfMax, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
895 else if ( RetValue1 ==
l_True )
897 p->vCexUser =
Gia_ManGetCex( p->pGia, p->vId2Lit, p->pSat, p->vCexSwp );
927 int RetValue, ProbeId, iLitAig, i;
929 assert( p->pSat != NULL );
949 (ABC_INT64_T)p->nConfMax, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
959 else if ( RetValue ==
l_True )
961 p->vCexUser =
Gia_ManGetCex( p->pGia, p->vId2Lit, p->pSat, p->vCexSwp );
1020 Gia_Man_t * pGiaCond, * pGiaOuts, * pGiaRes;
1024 pPars->nBTLimit = nConfs;
1025 pPars->fVerify = fVerify;
1026 pPars->fVerbose = fVerbose;
1072 pNew =
Gia_SweeperSweep( p, vProbeIds, nWords, nConfs, fVerify, fVerbose );
1119 printf(
"GIA manager statistics before and after applying \"%s\":\n", pCommLime );
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Gia_Man_t * Gia_SweeperStart(Gia_Man_t *pGia)
static int * Vec_IntArray(Vec_Int_t *p)
static void Swp_ManStop(Gia_Man_t *pGia)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
double Gia_SweeperMemUsage(Gia_Man_t *pGia)
static void Gia_ManCollectSuper(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper)
Vec_Int_t * Gia_SweeperCollectValidProbeIds(Gia_Man_t *p)
Vec_Int_t * Gia_SweeperCondVector(Gia_Man_t *p)
static Swp_Man_t * Swp_ManStart(Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
void Ssc_ManSetDefaultParams(Ssc_Pars_t *p)
MACRO DEFINITIONS ///.
void Gia_SweeperCondPush(Gia_Man_t *p, int ProbeId)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupOneHot(Gia_Man_t *p)
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
static int Gia_ObjIsTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManIsConstLit(int iLit)
static int Abc_Lit2LitL(int *pMap, int Lit)
static int Gia_ObjFaninLit0p(Gia_Man_t *p, Gia_Obj_t *pObj)
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)
static void sat_solver_compress(sat_solver *s)
void Gia_SweeperSetRuntimeLimit(Gia_Man_t *p, int nSeconds)
Gia_Man_t * Gia_SweeperExtractUserLogic(Gia_Man_t *p, Vec_Int_t *vProbeIds, Vec_Ptr_t *vInNames, Vec_Ptr_t *vOutNames)
typedefABC_NAMESPACE_HEADER_START struct Ssc_Pars_t_ Ssc_Pars_t
INCLUDES ///.
static int Gia_ManAppendCi(Gia_Man_t *p)
void sat_solver_delete(sat_solver *s)
int Gia_SweeperProbeUpdate(Gia_Man_t *p, int ProbeId, int iLitNew)
static int Abc_Var2Lit(int Var, int fCompl)
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ManAddClausesMux(Swp_Man_t *p, Gia_Obj_t *pNode)
static void Vec_IntSetEntry(Vec_Int_t *p, int i, int Entry)
int Gia_SweeperProbeCreate(Gia_Man_t *p, int iLit)
static int Vec_IntGetEntry(Vec_Int_t *p, int i)
static abctime Abc_Clock()
Gia_Man_t * Gia_SweeperFraigTest(Gia_Man_t *pInit, int nWords, int nConfs, int fVerbose)
static int Vec_PtrSize(Vec_Ptr_t *p)
double sat_solver_memory(sat_solver *s)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Vec_Int_t * Gia_SweeperGraft(Gia_Man_t *pDst, Vec_Int_t *vProbes, Gia_Man_t *pSrc)
static int Abc_LitNotCond(int Lit, int c)
static int sat_solver_var_value(sat_solver *s, int v)
#define ABC_SWAP(Type, a, b)
void Gia_SweeperSetConflictLimit(Gia_Man_t *p, int nConfMax)
int Gia_ManHasDangling(Gia_Man_t *p)
Gia_Man_t * Gia_SweeperSweep(Gia_Man_t *p, Vec_Int_t *vProbeOuts, int nWords, int nConfs, int fVerify, int fVerbose)
static int Swp_ManObj2Lit(Swp_Man_t *p, int Id)
#define ABC_PRTP(a, t, T)
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
static int Gia_ManConst0Lit()
struct Gia_Obj_t_ Gia_Obj_t
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
int Gia_SweeperProbeDelete(Gia_Man_t *p, int ProbeId)
void Gia_SweeperPrintStats(Gia_Man_t *pGia)
static int Abc_LitIsCompl(int Lit)
void Gia_SweeperLogicDump(Gia_Man_t *p, Vec_Int_t *vProbeIds, int fDumpConds, char *pFileName)
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Swp_ManLit2Lit(Swp_Man_t *p, int Lit)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Gia_Man_t * Gia_SweeperCleanup(Gia_Man_t *p, char *pCommLime)
void sat_solver_setnvars(sat_solver *s, int n)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static void Gia_ObjSetTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
Gia_Man_t * Ssc_PerformSweeping(Gia_Man_t *pAig, Gia_Man_t *pCare, Ssc_Pars_t *pPars)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
void * Abc_FrameGetGlobalFrame()
void Gia_ManHashStart(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
#define Gia_ManForEachAnd(p, pObj, i)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ManExtract_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vObjIds)
#define Gia_ManForEachPi(p, pObj, i)
void Gia_SweeperStop(Gia_Man_t *pGia)
static int Vec_IntCap(Vec_Int_t *p)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
void Gia_ManDupAppendShare(Gia_Man_t *p, Gia_Man_t *pTwo)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define ABC_NAMESPACE_IMPL_START
static void Gia_ManCollectSuper_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vSuper)
static void Gia_ManAddClausesSuper(Swp_Man_t *p, Gia_Obj_t *pNode, Vec_Int_t *vSuper)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
static int Abc_LitNot(int Lit)
static void Gia_ManObjAddToFrontier(Swp_Man_t *p, int Id, Vec_Int_t *vFront)
sat_solver * sat_solver_new(void)
static int Vec_IntSize(Vec_Int_t *p)
static int Gia_IsComplement(Gia_Obj_t *p)
int Gia_SweeperIsRunning(Gia_Man_t *pGia)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
int Gia_SweeperFraig(Gia_Man_t *p, Vec_Int_t *vProbeIds, char *pCommLime, int nWords, int nConfs, int fVerify, int fVerbose)
int Gia_SweeperCondPop(Gia_Man_t *p)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
#define ABC_PRMP(a, f, F)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Swp_Man_t_ Swp_Man_t
DECLARATIONS ///.
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Vec_Int_t * Gia_SweeperGetCex(Gia_Man_t *p)
int Gia_SweeperCheckEquiv(Gia_Man_t *pGia, int Probe1, int Probe2)
static void Gia_ManCnfNodeAddToSolver(Swp_Man_t *p, int NodeId)
static int Abc_LitRegular(int Lit)
void Gia_ManSetPhase(Gia_Man_t *p)
static void Swp_ManSetObj2Lit(Swp_Man_t *p, int Id, int Lit)
static Gia_Obj_t * Gia_Lit2Obj(Gia_Man_t *p, int iLit)
void Gia_ManIncrementTravId(Gia_Man_t *p)
int Gia_SweeperCondCheckUnsat(Gia_Man_t *pGia)
void Sat_SolverPrintStats(FILE *pFile, sat_solver *p)
int Gia_SweeperProbeLit(Gia_Man_t *p, int ProbeId)
static void Vec_IntFree(Vec_Int_t *p)
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
static int Gia_ManPiNum(Gia_Man_t *p)
Gia_Man_t * Abc_FrameGetGia(Abc_Frame_t *pAbc)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
char * Abc_UtilStrsav(char *s)
#define Gia_ManForEachPo(p, pObj, i)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static Vec_Ptr_t * Vec_PtrDupStr(Vec_Ptr_t *pVec)
static Vec_Int_t * Gia_ManGetCex(Gia_Man_t *pGia, Vec_Int_t *vId2Lit, sat_solver *pSat, Vec_Int_t *vCex)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_Obj2Lit(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManObjNum(Gia_Man_t *p)
void Gia_ManHashStop(Gia_Man_t *p)
int Gia_SweeperRun(Gia_Man_t *p, Vec_Int_t *vProbeIds, char *pCommLime, int fVerbose)