22#ifndef ABC__sat__bsat__satSolver2_h
23#define ABC__sat__bsat__satSolver2_h
52extern int sat_solver2_solve(
sat_solver2* s,
lit* begin,
lit* end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal);
102#ifdef USE_FLOAT_ACTIVITY2
179static inline int clause2_proofid(
sat_solver2* s,
clause* c,
int varA) {
return c->lrn ? (veci_begin(&s->
claProofs)[clause_id(c)]<<2) | (varA<<1) : (clause_id(c)<<2) | (varA<<1) | 1; }
182static inline int clause2_is_partA (
sat_solver2* s,
int h) {
return clause2_read(s, h)->partA; }
183static inline void clause2_set_partA(
sat_solver2* s,
int h,
int partA) { clause2_read(s, h)->partA = partA; }
184static inline int clause2_id(
sat_solver2* s,
int h) {
return clause_id(clause2_read(s, h)); }
185static inline void clause2_set_id(
sat_solver2* s,
int h,
int id) { clause_set_id(clause2_read(s, h),
id); }
195static inline int sat_solver2_nclauses(
sat_solver2* s)
200static inline int sat_solver2_nlearnts(
sat_solver2* s)
205static inline int sat_solver2_nconflicts(
sat_solver2* s)
210static inline int sat_solver2_var_value(
sat_solver2* s,
int v )
212 assert( v >= 0 && v < s->size );
215static inline int sat_solver2_var_literal(
sat_solver2* s,
int v )
217 assert( v >= 0 && v < s->size );
220static inline void sat_solver2_act_var_clear(
sat_solver2* s)
223 for (i = 0; i < s->
size; i++)
228static inline int sat_solver2_final(
sat_solver2* s,
int ** ppArray)
241static inline int sat_solver2_set_learntmax(
sat_solver2* s,
int nLearntMax)
248static inline void sat_solver2_bookmark(
sat_solver2* s)
255 Sat_MemBookMark( &s->
Mem );
263static inline int sat_solver2_add_const(
sat_solver2 * pSat,
int iVar,
int fCompl,
int fMark,
int Id )
269 Lits[0] = toLitCond( iVar, fCompl );
272 clause2_set_partA( pSat, Cid, 1 );
275static inline int sat_solver2_add_buffer(
sat_solver2 * pSat,
int iVarA,
int iVarB,
int fCompl,
int fMark,
int Id )
279 assert( iVarA >= 0 && iVarB >= 0 );
281 Lits[0] = toLitCond( iVarA, 0 );
282 Lits[1] = toLitCond( iVarB, !fCompl );
285 clause2_set_partA( pSat, Cid, 1 );
287 Lits[0] = toLitCond( iVarA, 1 );
288 Lits[1] = toLitCond( iVarB, fCompl );
291 clause2_set_partA( pSat, Cid, 1 );
294static inline int sat_solver2_add_and(
sat_solver2 * pSat,
int iVar,
int iVar0,
int iVar1,
int fCompl0,
int fCompl1,
int fMark,
int Id )
299 Lits[0] = toLitCond( iVar, 1 );
300 Lits[1] = toLitCond( iVar0, fCompl0 );
303 clause2_set_partA( pSat, Cid, 1 );
305 Lits[0] = toLitCond( iVar, 1 );
306 Lits[1] = toLitCond( iVar1, fCompl1 );
309 clause2_set_partA( pSat, Cid, 1 );
311 Lits[0] = toLitCond( iVar, 0 );
312 Lits[1] = toLitCond( iVar0, !fCompl0 );
313 Lits[2] = toLitCond( iVar1, !fCompl1 );
316 clause2_set_partA( pSat, Cid, 1 );
319static inline int sat_solver2_add_xor(
sat_solver2 * pSat,
int iVarA,
int iVarB,
int iVarC,
int fCompl,
int fMark,
int Id )
323 assert( iVarA >= 0 && iVarB >= 0 && iVarC >= 0 );
325 Lits[0] = toLitCond( iVarA, !fCompl );
326 Lits[1] = toLitCond( iVarB, 1 );
327 Lits[2] = toLitCond( iVarC, 1 );
330 clause2_set_partA( pSat, Cid, 1 );
332 Lits[0] = toLitCond( iVarA, !fCompl );
333 Lits[1] = toLitCond( iVarB, 0 );
334 Lits[2] = toLitCond( iVarC, 0 );
337 clause2_set_partA( pSat, Cid, 1 );
339 Lits[0] = toLitCond( iVarA, fCompl );
340 Lits[1] = toLitCond( iVarB, 1 );
341 Lits[2] = toLitCond( iVarC, 0 );
344 clause2_set_partA( pSat, Cid, 1 );
346 Lits[0] = toLitCond( iVarA, fCompl );
347 Lits[1] = toLitCond( iVarB, 0 );
348 Lits[2] = toLitCond( iVarC, 1 );
351 clause2_set_partA( pSat, Cid, 1 );
354static inline int sat_solver2_add_constraint(
sat_solver2 * pSat,
int iVar,
int iVar2,
int fCompl,
int fMark,
int Id )
360 Lits[0] = toLitCond( iVar, fCompl );
361 Lits[1] = toLitCond( iVar2, 0 );
364 clause2_set_partA( pSat, Cid, 1 );
366 Lits[0] = toLitCond( iVar, fCompl );
367 Lits[1] = toLitCond( iVar2, 1 );
370 clause2_set_partA( pSat, Cid, 1 );
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_HEADER_START struct Int2_Man_t_ Int2_Man_t
INCLUDES ///.
unsigned __int64 word
DECLARATIONS ///.
struct Sat_Mem_t_ Sat_Mem_t
typedefABC_NAMESPACE_HEADER_START struct Prf_Man_t_ Prf_Man_t
INCLUDES ///.
double sat_solver2_memory_proof(sat_solver2 *s)
void sat_solver2_delete(sat_solver2 *s)
word * Sat_ProofInterpolantTruth(sat_solver2 *s, void *pGloVars)
double sat_solver2_memory(sat_solver2 *s, int fAll)
int sat_solver2_simplify(sat_solver2 *s)
int var_is_assigned(sat_solver2 *s, int v)
void Int2_ManStop(Int2_Man_t *p)
void Sat_Solver2PrintStats(FILE *pFile, sat_solver2 *p)
void sat_solver2_reducedb(sat_solver2 *s)
sat_solver2 * sat_solver2_new(void)
struct sat_solver2_t sat_solver2
struct Int2_Man_t_ Int2_Man_t
void Sat_ProofCheck(sat_solver2 *s)
void * Int2_ManReadInterpolant(sat_solver2 *s)
void sat_solver2_rollback(sat_solver2 *s)
void Sat_Solver2WriteDimacs(sat_solver2 *p, char *pFileName, lit *assumptionsBegin, lit *assumptionsEnd, int incrementVars)
int Int2_ManChainStart(Int2_Man_t *p, clause *c)
struct varinfo2_t varinfo2
int Int2_ManChainResolve(Int2_Man_t *p, clause *c, int iLit, int varA)
int sat_solver2_solve(sat_solver2 *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
void Sat_Solver2DoubleClauses(sat_solver2 *p, int iVar)
int var_is_partA(sat_solver2 *s, int v)
int * Sat_Solver2GetModel(sat_solver2 *p, int *pVars, int nVars)
void sat_solver2_setnvars(sat_solver2 *s, int n)
void * Sat_ProofInterpolant(sat_solver2 *s, void *pGloVars)
void * Sat_ProofCore(sat_solver2 *s)
Int2_Man_t * Int2_ManStart(sat_solver2 *pSat, int *pGloVars, int nGloVars)
FUNCTION DEFINITIONS ///.
void var_set_partA(sat_solver2 *s, int v, int partA)
int sat_solver2_addclause(sat_solver2 *s, lit *begin, lit *end, int Id)
typedefABC_NAMESPACE_HEADER_START struct Vec_Set_t_ Vec_Set_t
INCLUDES ///.