104 #define Cbs_QueForEachEntry( Que, pObj, i ) \
105 for ( i = (Que).iHead; (i < (Que).iTail) && ((pObj) = (Que).pData[i]); i++ )
107 #define Cbs_ClauseForEachVar( p, hClause, pObj ) \
108 for ( (p)->pIter = (p)->pClauses.pData + hClause; (pObj = *pIter); (p)->pIter++ )
109 #define Cbs_ClauseForEachVar1( p, hClause, pObj ) \
110 for ( (p)->pIter = (p)->pClauses.pData+hClause+1; (pObj = *pIter); (p)->pIter++ )
130 pPars->nBTLimit = 1000;
131 pPars->nJustLimit = 100;
132 pPars->fUseHighest = 1;
133 pPars->fUseLowest = 0;
134 pPars->fUseMaxFF = 0;
219 return p->
Pars.nJustThis > p->
Pars.nJustLimit || p->
Pars.nBTThis > p->
Pars.nBTLimit;
317 *piHeadOld = p->
iHead;
318 *piTailOld = p->
iTail;
319 for ( i = *piHeadOld; i < *piTailOld; i++ )
321 p->
iHead = *piTailOld;
354 int iHeadOld = p->
iHead;
399 if ( pObjMax == NULL || pObjMax < pObj )
420 if ( pObjMin == NULL || pObjMin > pObj )
439 int i, iMaxFF = 0, iCurFF;
445 if ( iMaxFF < iCurFF )
471 assert( iBound <= p->pProp.iTail );
526 for ( pIter = pQue->
pData + hClause; *pIter; pIter++ );
527 return pIter - pQue->
pData - hClause ;
547 printf(
"Level %2d : ", Level );
548 for ( i = hClause; (pObj = pQue->
pData[i]); i++ )
570 printf(
"Level %2d : ", Level );
571 for ( i = hClause; (pObj = pQue->
pData[i]); i++ )
603 for ( i = k = pQue->
iHead + 1; i < pQue->iTail; i++ )
605 pObj = pQue->
pData[i];
613 if ( iLitLevel < Level )
615 pQue->
pData[k++] = pObj;
618 assert( iLitLevel == Level );
620 if ( pReason == pObj )
628 if ( pReason != pObj )
681 int i, LevelMax = -1, LevelCur;
692 for ( i = hClause0 + 1; (pObj = pQue->
pData[i]); i++ )
700 if ( LevelMax < LevelCur )
703 for ( i = hClause1 + 1; (pObj = pQue->
pData[i]); i++ )
711 if ( LevelMax < LevelCur )
714 for ( i = pQue->
iHead + 1; i < pQue->iTail; i++ )
743 if ( Value0 == 0 || Value1 == 0 )
745 if ( Value0 == 0 && Value1 != 0 )
747 if ( Value0 != 0 && Value1 == 0 )
749 assert( Value0 == 0 && Value1 == 0 );
759 if ( Value0 == 0 || Value1 == 0 )
761 if ( Value0 == 1 && Value1 == 1 )
763 if ( Value0 == 1 || Value1 == 1 )
798 if ( Value0 == 0 || Value1 == 0 )
800 if ( Value0 == 1 && Value1 == 1 )
802 assert( Value0 == 1 || Value1 == 1 );
864 int hClause, hLearn0, hLearn1;
865 int iPropHead, iJustHead, iJustTail;
882 if ( p->
Pars.fUseHighest )
884 else if ( p->
Pars.fUseLowest )
886 else if ( p->
Pars.fUseMaxFF )
939 p->
Pars.nBTThis = p->
Pars.nJustThis = p->
Pars.nBTThisNc = 0;
948 p->
Pars.nBTTotal += p->
Pars.nBTThis;
972 printf(
"Conf = %6d ", p->
Pars.nBTLimit );
973 printf(
"JustMax = %5d ", p->
Pars.nJustLimit );
975 printf(
"Unsat calls %6d (%6.2f %%) Ave conf = %8.1f ",
978 printf(
"Sat calls %6d (%6.2f %%) Ave conf = %8.1f ",
981 printf(
"Undef calls %6d (%6.2f %%) Ave conf = %8.1f ",
1003 Vec_Int_t * vCex, * vVisit, * vCexStore;
1018 p->
Pars.nBTLimit = nConfs;
1047 p->
Pars.fUseHighest = 1;
1048 p->
Pars.fUseLowest = 0;
1088 *pvStatus = vStatus;
void Gia_ManCreateRefs(Gia_Man_t *p)
static Gia_Obj_t * Cbs_ManDecideLowest(Cbs_Man_t *p)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Cbs_VarFanin0Value(Gia_Obj_t *pVar)
static void Cbs_QueStore(Cbs_Que_t *p, int *piHeadOld, int *piTailOld)
static int Cbs_ManPropagateTwo(Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
#define Gia_ManForEachCo(p, pObj, i)
int Cbs_ManPropagate(Cbs_Man_t *p, int Level)
typedefABC_NAMESPACE_IMPL_START struct Cbs_Par_t_ Cbs_Par_t
DECLARATIONS ///.
int Cbs_ManSolve(Cbs_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
void Cbs_ManSatPrintStats(Cbs_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Cbs_VarIsAssigned(Gia_Obj_t *pVar)
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
#define ABC_REALLOC(type, obj, num)
static int Gia_ObjIsCand(Gia_Obj_t *pObj)
Cbs_Man_t * Cbs_ManAlloc()
static Gia_Obj_t * Cbs_ManDecideMaxFF(Cbs_Man_t *p)
Vec_Int_t * Cbs_ReadModel(Cbs_Man_t *p)
static void Cbs_VarAssign(Gia_Obj_t *pVar)
void Gia_ManCleanMark0(Gia_Man_t *p)
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
static int Abc_Var2Lit(int Var, int fCompl)
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
void Cbs_ManStop(Cbs_Man_t *p)
static Gia_Obj_t * Cbs_VarReason1(Cbs_Man_t *p, Gia_Obj_t *pVar)
static Vec_Str_t * Vec_StrAlloc(int nCap)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
int Cbs_ManSolve_rec(Cbs_Man_t *p, int Level)
static int Cbs_VarIsJust(Gia_Obj_t *pVar)
static int Cbs_ClauseDecLevel(Cbs_Man_t *p, int hClause)
void Gia_ManCleanMark1(Gia_Man_t *p)
#define ABC_PRTP(a, t, T)
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_Not(Gia_Obj_t *p)
static int Gia_ManAndNum(Gia_Man_t *p)
static void Cbs_ManPrintClauseNew(Cbs_Man_t *p, int Level, int hClause)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static int Cbs_ManCheckLimits(Cbs_Man_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Cbs_ManClauseSize(Cbs_Man_t *p, int hClause)
static void Cbs_ManAssign(Cbs_Man_t *p, Gia_Obj_t *pObj, int Level, Gia_Obj_t *pRes0, Gia_Obj_t *pRes1)
static int Cbs_QueHasNode(Cbs_Que_t *p, Gia_Obj_t *pObj)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static Gia_Obj_t * Cbs_VarReason0(Cbs_Man_t *p, Gia_Obj_t *pVar)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Cbs_VarUnassign(Gia_Obj_t *pVar)
void Gia_ManFillValue(Gia_Man_t *p)
static void Cbs_ManPrintClause(Cbs_Man_t *p, int Level, int hClause)
static void Cbs_QueRestore(Cbs_Que_t *p, int iHeadOld, int iTailOld)
static int Cbs_VarFanin1Value(Gia_Obj_t *pVar)
static int Cbs_ManPropagateOne(Cbs_Man_t *p, Gia_Obj_t *pVar, int Level)
static void Cbs_ManDeriveReason(Cbs_Man_t *p, int Level)
static void Cbs_VarSetValue(Gia_Obj_t *pVar, int v)
static int Cbs_QueIsEmpty(Cbs_Que_t *p)
static void Cbs_QuePush(Cbs_Que_t *p, Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
void Cec_ManSatAddToStore(Vec_Int_t *vCexStore, Vec_Int_t *vCex, int Out)
static int Cbs_VarValue(Gia_Obj_t *pVar)
static int Cbs_VarFaninFanoutMax(Cbs_Man_t *p, Gia_Obj_t *pObj)
static int Vec_IntSize(Vec_Int_t *p)
#define Cbs_QueForEachEntry(Que, pObj, i)
static int Gia_IsComplement(Gia_Obj_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define ABC_CALLOC(type, num)
void Cbs_SetDefaultParams(Cbs_Par_t *pPars)
FUNCTION DEFINITIONS ///.
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Vec_Int_t * Cbs_ManSolveMiterNc(Gia_Man_t *pAig, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
static void Vec_PtrClear(Vec_Ptr_t *p)
void Gia_ManSetPhase(Gia_Man_t *p)
static Gia_Obj_t * Cbs_ManDecideHighest(Cbs_Man_t *p)
static int Cbs_VarDecLevel(Cbs_Man_t *p, Gia_Obj_t *pVar)
void Gia_ManCollectTest(Gia_Man_t *p)
static void Cbs_ManCancelUntil(Cbs_Man_t *p, int iBound)
static int Cbs_ManAnalyze(Cbs_Man_t *p, int Level, Gia_Obj_t *pVar, Gia_Obj_t *pFan0, Gia_Obj_t *pFan1)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static int Cbs_ManResolve(Cbs_Man_t *p, int Level, int hClause0, int hClause1)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
static void Cbs_ManSaveModel(Cbs_Man_t *p, Vec_Int_t *vCex)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Cbs_QueFinish(Cbs_Que_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)
static int Gia_ManCoNum(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)