86 assert( Num < p->nClauses );
88 if ( Num < nClausesP )
106 return p->vAdjacents;
155 double dClaInc,
double dClaDecay,
156 double dVarInc,
double dVarDecay,
163 assert(
sizeof(
float) ==
sizeof(
unsigned));
168 p->nVarsAlloc = nVarsAlloc;
175 p->dClaInc = dClaInc;
176 p->dClaDecay = dClaDecay;
177 p->dVarInc = dVarInc;
178 p->dVarDecay = dVarDecay;
180 p->pdActivity =
ABC_ALLOC(
double, p->nVarsAlloc );
181 p->pFactors =
ABC_ALLOC(
float, p->nVarsAlloc );
182 for ( i = 0; i < p->nVarsAlloc; i++ )
184 p->pdActivity[i] = 0.0;
185 p->pFactors[i] = 1.0;
188 p->pAssigns =
ABC_ALLOC(
int, p->nVarsAlloc );
189 p->pModel =
ABC_ALLOC(
int, p->nVarsAlloc );
190 for ( i = 0; i < p->nVarsAlloc; i++ )
196 for ( i = 0; i < 2 * p->nVarsAlloc; i++ )
204 p->pLevel =
ABC_ALLOC(
int, p->nVarsAlloc );
205 for ( i = 0; i < p->nVarsAlloc; i++ )
207 p->dRandSeed = 91648253;
208 p->fVerbose = fVerbose;
215 for ( i = 0; i < p->nVarsAlloc; i++ )
221 p->pSeen =
ABC_ALLOC(
int, p->nVarsAlloc );
222 memset( p->pSeen, 0,
sizeof(
int) * p->nVarsAlloc );
244 int nVarsAllocOld, i;
246 nVarsAllocOld = p->nVarsAlloc;
247 p->nVarsAlloc = nVarsAlloc;
249 p->pdActivity =
ABC_REALLOC(
double, p->pdActivity, p->nVarsAlloc );
250 p->pFactors =
ABC_REALLOC(
float, p->pFactors, p->nVarsAlloc );
251 for ( i = nVarsAllocOld; i < p->nVarsAlloc; i++ )
253 p->pdActivity[i] = 0.0;
254 p->pFactors[i] = 1.0;
257 p->pAssigns =
ABC_REALLOC(
int, p->pAssigns, p->nVarsAlloc );
258 p->pModel =
ABC_REALLOC(
int, p->pModel, p->nVarsAlloc );
259 for ( i = nVarsAllocOld; i < p->nVarsAlloc; i++ )
266 for ( i = 2 * nVarsAllocOld; i < 2 * p->nVarsAlloc; i++ )
273 p->pLevel =
ABC_REALLOC(
int, p->pLevel, p->nVarsAlloc );
274 for ( i = nVarsAllocOld; i < p->nVarsAlloc; i++ )
276 p->pReasons[i] = NULL;
280 p->pSeen =
ABC_REALLOC(
int, p->pSeen, p->nVarsAlloc );
281 for ( i = nVarsAllocOld; i < p->nVarsAlloc; i++ )
314 assert( p->nVarsAlloc >= nVars );
320 for ( i = 0; i < nClauses; i++ )
327 for ( i = 0; i < nClauses; i++ )
333 for ( i = 0; i < p->nVars; i++ )
334 p->pdActivity[i] = 0;
340 for ( i = 0; i < 2 * p->nVars; i++ )
348 for ( i = 0; i < p->nVars; i++ )
357 for ( i = 0; i < p->nVars; i++ )
361 p->dRandSeed = 91648253;
365 memset( p->pSeen, 0,
sizeof(
int) * p->nVars );
398 for ( i = 0; i < nClauses; i++ )
404 for ( i = 0; i < nClauses; i++ )
412 for ( i = 0; i < 2 * p->nVarsAlloc; i++ )
428 for ( i = 0; i < nClauses; i++ )
456 for ( i = 0; i < p->nVarsAlloc; i++ )
459 p->pReasons[i] = NULL;
461 p->pdActivity[i] = 0.0;
488 for ( m = 0; m < 32; m++ )
489 for ( v = 0; v < 5; v++ )
491 uTruths[v][0] |= (1 << m);
493 for ( v = 0; v < 5; v++ )
494 uTruths[v][1] = uTruths[v][0];
496 uTruths[5][1] = ~((unsigned)0);
float * Msat_SolverReadFactors(Msat_Solver_t *p)
Msat_ClauseVec_t * Msat_SolverReadAdjacents(Msat_Solver_t *p)
void Msat_ClauseFree(Msat_Solver_t *p, Msat_Clause_t *pC, int fRemoveWatched)
int Msat_SolverReadVarNum(Msat_Solver_t *p)
FUNCTION DEFINITIONS ///.
void Msat_SolverResize(Msat_Solver_t *p, int nVarsAlloc)
int * Msat_SolverReadModelArray(Msat_Solver_t *p)
void Msat_QueueFree(Msat_Queue_t *p)
#define MSAT_VAR_UNASSIGNED
void Msat_QueueClear(Msat_Queue_t *p)
void Msat_SolverClausesDecrement(Msat_Solver_t *p)
Msat_ClauseVec_t * Msat_SolverReadLearned(Msat_Solver_t *p)
void Msat_ClauseSetTypeA(Msat_Clause_t *pC, int fTypeA)
Msat_Clause_t * Msat_ClauseVecReadEntry(Msat_ClauseVec_t *p, int i)
#define ABC_REALLOC(type, obj, num)
void Msat_OrderSetBounds(Msat_Order_t *p, int nVarsMax)
void Msat_SolverFree(Msat_Solver_t *p)
void Msat_IntVecClear(Msat_IntVec_t *p)
Msat_MmStep_t * Msat_SolverReadMem(Msat_Solver_t *p)
int * Msat_SolverReadDecisionLevelArray(Msat_Solver_t *p)
int Msat_SolverReadInspects(Msat_Solver_t *p)
#define ABC_ALLOC(type, num)
typedefABC_NAMESPACE_HEADER_START struct Msat_Clause_t_ Msat_Clause_t
INCLUDES ///.
int Msat_ClauseVecReadSize(Msat_ClauseVec_t *p)
Msat_Solver_t * Msat_SolverAlloc(int nVarsAlloc, double dClaInc, double dClaDecay, double dVarInc, double dVarDecay, int fVerbose)
int Msat_SolverReadClauseNum(Msat_Solver_t *p)
int Msat_IntVecReadSize(Msat_IntVec_t *p)
void Msat_SolverMarkClausesStart(Msat_Solver_t *p)
int * Msat_SolverReadAssignsArray(Msat_Solver_t *p)
Msat_Clause_t ** Msat_ClauseVecReadArray(Msat_ClauseVec_t *p)
void Msat_ClauseVecPush(Msat_ClauseVec_t *p, Msat_Clause_t *Entry)
void Msat_OrderFree(Msat_Order_t *p)
Msat_Type_t Msat_SolverReadVarValue(Msat_Solver_t *p, Msat_Var_t Var)
void Msat_IntVecFill(Msat_IntVec_t *p, int nSize, int Entry)
#define ABC_NAMESPACE_IMPL_END
void Msat_SolverClausesDecrementL(Msat_Solver_t *p)
void Msat_ClauseVecClear(Msat_ClauseVec_t *p)
Msat_IntVec_t * Msat_IntVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Msat_IntVecFree(Msat_IntVec_t *p)
Msat_Order_t * Msat_OrderAlloc(Msat_Solver_t *pSat)
FUNCTION DEFINITIONS ///.
void Msat_SolverClausesIncrementL(Msat_Solver_t *p)
int Msat_SolverIncrementSeenId(Msat_Solver_t *p)
#define ABC_NAMESPACE_IMPL_START
void Msat_SolverMarkLastClauseTypeA(Msat_Solver_t *p)
static ABC_NAMESPACE_IMPL_START void Msat_SolverSetupTruthTables(unsigned uTruths[][2])
DECLARATIONS ///.
Msat_IntVec_t * Msat_SolverReadVarsUsed(Msat_Solver_t *p)
Msat_Clause_t ** Msat_SolverReadReasonArray(Msat_Solver_t *p)
int * Msat_SolverReadSeenArray(Msat_Solver_t *p)
void Msat_SolverClean(Msat_Solver_t *p, int nVars)
Msat_ClauseVec_t ** Msat_SolverReadWatchedArray(Msat_Solver_t *p)
void Msat_OrderClean(Msat_Order_t *p, Msat_IntVec_t *vCone)
int Msat_SolverReadBackTracks(Msat_Solver_t *p)
ABC_NAMESPACE_IMPL_START Msat_ClauseVec_t * Msat_ClauseVecAlloc(int nCap)
DECLARATIONS ///.
Msat_Clause_t * Msat_SolverReadClause(Msat_Solver_t *p, int Num)
void Msat_SolverSetVerbosity(Msat_Solver_t *p, int fVerbose)
void Msat_IntVecGrow(Msat_IntVec_t *p, int nCapMin)
Msat_Queue_t * Msat_QueueAlloc(int nVars)
FUNCTION DEFINITIONS ///.
Msat_IntVec_t * Msat_SolverReadConeVars(Msat_Solver_t *p)
int Msat_SolverReadDecisionLevel(Msat_Solver_t *p)
Msat_MmStep_t * Msat_MmStepStart(int nSteps)
void Msat_MmStepStop(Msat_MmStep_t *p, int fVerbose)
void Msat_SolverClausesIncrement(Msat_Solver_t *p)
typedefABC_NAMESPACE_HEADER_START struct Msat_Solver_t_ Msat_Solver_t
INCLUDES ///.
int Msat_SolverReadVarAllocNum(Msat_Solver_t *p)
void Msat_SolverPrepare(Msat_Solver_t *p, Msat_IntVec_t *vVars)
void Msat_ClauseVecFree(Msat_ClauseVec_t *p)