92 for ( i = j = 0; i < nLits; i++ ) {
97 if ( pSeen[Var] >= nSeenId - 1 )
99 if ( (pSeen[Var] != nSeenId) == Sign )
104 pSeen[
Var] = nSeenId - !Sign;
109 if ( pAssigns[Var] == pLits[i] )
115 pLits[j++] = pLits[i];
156 nBytes =
sizeof(unsigned)*(nLits + 2 + (
int)fLearned);
157 #ifdef USE_SYSTEM_MEMORY_MANAGEMENT
162 pC->Num = p->nClauses++;
165 pC->fLearned = fLearned;
167 pC->nSizeAlloc = nBytes;
168 memcpy( pC->pData, pLits,
sizeof(
int)*nLits );
174 int iLevelMax, iLevelCur, iLitMax;
179 for ( i = 2; i < nLits; i++ )
182 assert( iLevelCur != -1 );
183 if ( iLevelMax < iLevelCur )
186 iLevelMax = iLevelCur, iLitMax = i;
188 pC->pData[1] = pLits[iLitMax];
189 pC->pData[iLitMax] = pLits[1];
196 for ( i = 0; i < nLits; i++ )
225 if ( fRemoveWatched )
236 #ifdef USE_SYSTEM_MEMORY_MANAGEMENT
281 return (
int )(pReasons[
MSAT_LIT2VAR(pC->pData[0])] == pC);
299 memcpy( &f, pC->pData + pC->nSize, sizeof (f));
316 memcpy( pC->pData + pC->nSize, &Num, sizeof (Num) );
339 if ( pC->pData[0] == LitF )
340 pC->pData[0] = pC->pData[1], pC->pData[1] = LitF;
341 assert( pC->pData[1] == LitF );
343 if ( pAssigns[
MSAT_LIT2VAR(pC->pData[0])] == pC->pData[0] )
349 for ( i = 2; i < (int)pC->nSize; i++ )
352 pC->pData[1] = pC->pData[i], pC->pData[i] = LitF;
358 *pLit_out = pC->pData[0];
378 for ( i = j = 0; i < (int)pC->nSize; i++ )
383 pC->pData[j++] = pC->pData[i];
386 if ( pAssigns[Var] == pC->pData[i] )
393 if ( j < (
int)pC->nSize )
450 for ( i = 0; pClauses[i] != pC; i++ )
452 for ( ; i < nClauses - 1; i++ )
453 pClauses[i] = pClauses[i+1];
472 printf(
"NULL pointer" );
477 for ( i = 0; i < (int)pC->nSize; i++ )
478 printf(
" %s%d", ((pC->pData[i]&1)?
"-":
""), pC->pData[i]/2 + 1 );
497 for ( i = 0; i < (int)pC->nSize; i++ )
498 fprintf( pFile,
"%s%d ", ((pC->pData[i]&1)?
"-":
""), pC->pData[i]/2 + (
int)(fIncrement>0) );
500 fprintf( pFile,
"0" );
501 fprintf( pFile,
"\n" );
519 printf(
"NULL pointer" );
524 for ( i = 0; i < (int)pC->nSize; i++ )
int Msat_SolverReadDecisionLevel(Msat_Solver_t *p)
#define MSAT_LIT_UNASSIGNED
void Msat_ClauseRemoveWatch(Msat_ClauseVec_t *vClauses, Msat_Clause_t *pC)
void Msat_ClauseFree(Msat_Solver_t *p, Msat_Clause_t *pC, int fRemoveWatched)
void Msat_MmStepEntryRecycle(Msat_MmStep_t *p, char *pEntry, int nBytes)
#define MSAT_VAR_UNASSIGNED
int * Msat_SolverReadSeenArray(Msat_Solver_t *p)
int Msat_ClauseReadLearned(Msat_Clause_t *pC)
char * Msat_MmStepEntryFetch(Msat_MmStep_t *p, int nBytes)
void Msat_ClauseCalcReason(Msat_Solver_t *p, Msat_Clause_t *pC, Msat_Lit_t Lit, Msat_IntVec_t *vLits_out)
void Msat_ClauseSetTypeA(Msat_Clause_t *pC, int fTypeA)
int Msat_ClausePropagate(Msat_Clause_t *pC, Msat_Lit_t Lit, int *pAssigns, Msat_Lit_t *pLit_out)
int Msat_SolverIncrementSeenId(Msat_Solver_t *p)
void Msat_IntVecClear(Msat_IntVec_t *p)
#define ABC_ALLOC(type, num)
int Msat_ClauseIsLocked(Msat_Solver_t *p, Msat_Clause_t *pC)
typedefABC_NAMESPACE_HEADER_START struct Msat_Clause_t_ Msat_Clause_t
INCLUDES ///.
int Msat_SolverEnqueue(Msat_Solver_t *p, Msat_Lit_t Lit, Msat_Clause_t *pC)
void Msat_ClauseSetMark(Msat_Clause_t *pC, int fMark)
int Msat_ClauseVecReadSize(Msat_ClauseVec_t *p)
ABC_NAMESPACE_IMPL_START void Msat_SolverVarBumpActivity(Msat_Solver_t *p, Msat_Lit_t Lit)
DECLARATIONS ///.
void Msat_ClauseWriteActivity(Msat_Clause_t *pC, float Num)
int Msat_ClauseReadNum(Msat_Clause_t *pC)
void Msat_ClauseSetNum(Msat_Clause_t *pC, int Num)
int Msat_ClauseReadMark(Msat_Clause_t *pC)
void Msat_ClausePrint(Msat_Clause_t *pC)
int Msat_IntVecReadSize(Msat_IntVec_t *p)
void Msat_IntVecPush(Msat_IntVec_t *p, int Entry)
int * Msat_SolverReadAssignsArray(Msat_Solver_t *p)
int Msat_ClauseSimplify(Msat_Clause_t *pC, int *pAssigns)
Msat_Clause_t ** Msat_ClauseVecReadArray(Msat_ClauseVec_t *p)
void Msat_ClauseVecPush(Msat_ClauseVec_t *p, Msat_Clause_t *Entry)
#define ABC_NAMESPACE_IMPL_END
int * Msat_ClauseReadLits(Msat_Clause_t *pC)
Msat_Clause_t * Msat_ClauseVecPop(Msat_ClauseVec_t *p)
Msat_MmStep_t * Msat_SolverReadMem(Msat_Solver_t *p)
int Msat_ClauseReadSize(Msat_Clause_t *pC)
#define ABC_NAMESPACE_IMPL_START
Msat_ClauseVec_t ** Msat_SolverReadWatchedArray(Msat_Solver_t *p)
Msat_Clause_t ** Msat_SolverReadReasonArray(Msat_Solver_t *p)
void Msat_IntVecShrink(Msat_IntVec_t *p, int nSizeNew)
int * Msat_IntVecReadArray(Msat_IntVec_t *p)
void Msat_ClausePrintSymbols(Msat_Clause_t *pC)
int * Msat_SolverReadDecisionLevelArray(Msat_Solver_t *p)
int Msat_ClauseReadTypeA(Msat_Clause_t *pC)
void Msat_IntVecSort(Msat_IntVec_t *p, int fReverse)
int Msat_ClauseCreate(Msat_Solver_t *p, Msat_IntVec_t *vLits, int fLearned, Msat_Clause_t **pClause_out)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ Msat_Solver_t
INCLUDES ///.
void Msat_ClauseWriteDimacs(FILE *pFile, Msat_Clause_t *pC, int fIncrement)
float Msat_ClauseReadActivity(Msat_Clause_t *pC)
void Msat_SolverClaBumpActivity(Msat_Solver_t *p, Msat_Clause_t *pC)