yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat::SimpSolver Class Reference

#include <SimpSolver.h>

+ Inheritance diagram for Minisat::SimpSolver:
+ Collaboration diagram for Minisat::SimpSolver:

Data Structures

struct  ClauseDeleted
 
struct  ElimLt
 

Public Member Functions

 SimpSolver ()
 
 ~SimpSolver ()
 
Var newVar (lbool upol=l_Undef, bool dvar=true)
 
void releaseVar (Lit l)
 
bool addClause (const vec< Lit > &ps)
 
bool addEmptyClause ()
 
bool addClause (Lit p)
 
bool addClause (Lit p, Lit q)
 
bool addClause (Lit p, Lit q, Lit r)
 
bool addClause (Lit p, Lit q, Lit r, Lit s)
 
bool addClause_ (vec< Lit > &ps)
 
bool substitute (Var v, Lit x)
 
void setFrozen (Var v, bool b)
 
bool isEliminated (Var v) const
 
void freezeVar (Var v)
 
void thaw ()
 
bool solve (const vec< Lit > &assumps, bool do_simp=true, bool turn_off_simp=false)
 
lbool solveLimited (const vec< Lit > &assumps, bool do_simp=true, bool turn_off_simp=false)
 
bool solve (bool do_simp=true, bool turn_off_simp=false)
 
bool solve (Lit p, bool do_simp=true, bool turn_off_simp=false)
 
bool solve (Lit p, Lit q, bool do_simp=true, bool turn_off_simp=false)
 
bool solve (Lit p, Lit q, Lit r, bool do_simp=true, bool turn_off_simp=false)
 
bool eliminate (bool turn_off_elim=false)
 
virtual void garbageCollect ()
 
bool simplify ()
 
bool solve (const vec< Lit > &assumps)
 
bool solve ()
 
bool solve (Lit p)
 
bool solve (Lit p, Lit q)
 
bool solve (Lit p, Lit q, Lit r)
 
lbool solveLimited (const vec< Lit > &assumps)
 
bool okay () const
 
bool implies (const vec< Lit > &assumps, vec< Lit > &out)
 
ClauseIterator clausesBegin () const
 
ClauseIterator clausesEnd () const
 
TrailIterator trailBegin () const
 
TrailIterator trailEnd () const
 
void toDimacs (FILE *f, const vec< Lit > &assumps)
 
void toDimacs (const char *file, const vec< Lit > &assumps)
 
void toDimacs (FILE *f, Clause &c, vec< Var > &map, Var &max)
 
void toDimacs (const char *file)
 
void toDimacs (const char *file, Lit p)
 
void toDimacs (const char *file, Lit p, Lit q)
 
void toDimacs (const char *file, Lit p, Lit q, Lit r)
 
void setPolarity (Var v, lbool b)
 
void setDecisionVar (Var v, bool b)
 
lbool value (Var x) const
 
lbool value (Lit p) const
 
lbool modelValue (Var x) const
 
lbool modelValue (Lit p) const
 
int nAssigns () const
 
int nClauses () const
 
int nLearnts () const
 
int nVars () const
 
int nFreeVars () const
 
void printStats () const
 
void setConfBudget (int64_t x)
 
void setPropBudget (int64_t x)
 
void budgetOff ()
 
void interrupt ()
 
void clearInterrupt ()
 
void checkGarbage (double gf)
 
void checkGarbage ()
 

Data Fields

int grow
 
int clause_lim
 
int subsumption_lim
 
double simp_garbage_frac
 
bool use_asymm
 
bool use_rcheck
 
bool use_elim
 
bool extend_model
 
int merges
 
int asymm_lits
 
int eliminated_vars
 
vec< lboolmodel
 
LSet conflict
 
int verbosity
 
double var_decay
 
double clause_decay
 
double random_var_freq
 
double random_seed
 
bool luby_restart
 
int ccmin_mode
 
int phase_saving
 
bool rnd_pol
 
bool rnd_init_act
 
double garbage_frac
 
int min_learnts_lim
 
int restart_first
 
double restart_inc
 
double learntsize_factor
 
double learntsize_inc
 
int learntsize_adjust_start_confl
 
double learntsize_adjust_inc
 
uint64_t solves
 
uint64_t starts
 
uint64_t decisions
 
uint64_t rnd_decisions
 
uint64_t propagations
 
uint64_t conflicts
 
uint64_t dec_vars
 
uint64_t num_clauses
 
uint64_t num_learnts
 
uint64_t clauses_literals
 
uint64_t learnts_literals
 
uint64_t max_literals
 
uint64_t tot_literals
 

Protected Member Functions

lbool solve_ (bool do_simp=true, bool turn_off_simp=false)
 
bool asymm (Var v, CRef cr)
 
bool asymmVar (Var v)
 
void updateElimHeap (Var v)
 
void gatherTouchedClauses ()
 
bool merge (const Clause &_ps, const Clause &_qs, Var v, vec< Lit > &out_clause)
 
bool merge (const Clause &_ps, const Clause &_qs, Var v, int &size)
 
bool backwardSubsumptionCheck (bool verbose=false)
 
bool eliminateVar (Var v)
 
void extendModel ()
 
void removeClause (CRef cr)
 
bool strengthenClause (CRef cr, Lit l)
 
bool implied (const vec< Lit > &c)
 
void relocAll (ClauseAllocator &to)
 
void insertVarOrder (Var x)
 
Lit pickBranchLit ()
 
void newDecisionLevel ()
 
void uncheckedEnqueue (Lit p, CRef from=CRef_Undef)
 
bool enqueue (Lit p, CRef from=CRef_Undef)
 
CRef propagate ()
 
void cancelUntil (int level)
 
void analyze (CRef confl, vec< Lit > &out_learnt, int &out_btlevel)
 
void analyzeFinal (Lit p, LSet &out_conflict)
 
bool litRedundant (Lit p)
 
lbool search (int nof_conflicts)
 
lbool solve_ ()
 
void reduceDB ()
 
void removeSatisfied (vec< CRef > &cs)
 
void rebuildOrderHeap ()
 
void varDecayActivity ()
 
void varBumpActivity (Var v, double inc)
 
void varBumpActivity (Var v)
 
void claDecayActivity ()
 
void claBumpActivity (Clause &c)
 
void attachClause (CRef cr)
 
void detachClause (CRef cr, bool strict=false)
 
bool isRemoved (CRef cr) const
 
bool locked (const Clause &c) const
 
bool satisfied (const Clause &c) const
 
int decisionLevel () const
 
uint32_t abstractLevel (Var x) const
 
CRef reason (Var x) const
 
int level (Var x) const
 
double progressEstimate () const
 
bool withinBudget () const
 

Static Protected Member Functions

static VarData mkVarData (CRef cr, int l)
 
static double drand (double &seed)
 
static int irand (double &seed, int size)
 

Protected Attributes

int elimorder
 
bool use_simplification
 
Var max_simp_var
 
vec< uint32_t > elimclauses
 
VMap< char > touched
 
OccLists< Var, vec< CRef >
, ClauseDeleted
occurs
 
LMap< int > n_occ
 
Heap< Var, ElimLtelim_heap
 
Queue< CRefsubsumption_queue
 
VMap< char > frozen
 
vec< Varfrozen_vars
 
VMap< char > eliminated
 
int bwdsub_assigns
 
int n_touched
 
CRef bwdsub_tmpunit
 
vec< CRefclauses
 
vec< CReflearnts
 
vec< Littrail
 
vec< int > trail_lim
 
vec< Litassumptions
 
VMap< double > activity
 
VMap< lboolassigns
 
VMap< char > polarity
 
VMap< lbooluser_pol
 
VMap< char > decision
 
VMap< VarDatavardata
 
OccLists< Lit, vec< Watcher >
, WatcherDeleted, MkIndexLit
watches
 
Heap< Var, VarOrderLtorder_heap
 
bool ok
 
double cla_inc
 
double var_inc
 
int qhead
 
int simpDB_assigns
 
int64_t simpDB_props
 
double progress_estimate
 
bool remove_satisfied
 
Var next_var
 
ClauseAllocator ca
 
vec< Varreleased_vars
 
vec< Varfree_vars
 
VMap< char > seen
 
vec< ShrinkStackElemanalyze_stack
 
vec< Litanalyze_toclear
 
vec< Litadd_tmp
 
double max_learnts
 
double learntsize_adjust_confl
 
int learntsize_adjust_cnt
 
int64_t conflict_budget
 
int64_t propagation_budget
 
bool asynch_interrupt
 

Detailed Description

Definition at line 33 of file SimpSolver.h.

Constructor & Destructor Documentation

SimpSolver::SimpSolver ( )

Definition at line 48 of file SimpSolver.cc.

48  :
49  grow (opt_grow)
56  , extend_model (true)
57  , merges (0)
58  , asymm_lits (0)
59  , eliminated_vars (0)
60  , elimorder (1)
61  , use_simplification (true)
62  , occurs (ClauseDeleted(ca))
63  , elim_heap (ElimLt(n_occ))
64  , bwdsub_assigns (0)
65  , n_touched (0)
66 {
67  vec<Lit> dummy(1,lit_Undef);
68  ca.extra_clause_field = true; // NOTE: must happen before allocating the dummy clause below.
69  bwdsub_tmpunit = ca.alloc(dummy);
70  remove_satisfied = false;
71 }
ClauseAllocator ca
Definition: Solver.h:216
static DoubleOption opt_simp_garbage_frac(_cat,"simp-gc-frac","The fraction of wasted memory allowed before a garbage collection is triggered during simplification.", 0.5, DoubleRange(0, false, HUGE_VAL, false))
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
static IntOption opt_clause_lim(_cat,"cl-lim","Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit", 20, IntRange(-1, INT32_MAX))
static BoolOption opt_use_asymm(_cat,"asymm","Shrink clauses by asymmetric branching.", false)
Heap< Var, ElimLt > elim_heap
Definition: SimpSolver.h:142
static BoolOption opt_use_elim(_cat,"elim","Perform variable elimination.", true)
CRef alloc(const vec< Lit > &ps, bool learnt=false)
Definition: SolverTypes.h:245
const Lit lit_Undef
Definition: SolverTypes.h:77
static BoolOption opt_use_rcheck(_cat,"rcheck","Check if a clause is already implied. (costly)", false)
double simp_garbage_frac
Definition: SimpSolver.h:94
static IntOption opt_grow(_cat,"grow","Allow a variable elimination step to grow by a number of clauses.", 0)
static IntOption opt_subsumption_lim(_cat,"sub-lim","Do not check if subsumption against a clause larger than this. -1 means no limit.", 1000, IntRange(-1, INT32_MAX))
bool remove_satisfied
Definition: Solver.h:214

+ Here is the call graph for this function:

SimpSolver::~SimpSolver ( )

Definition at line 74 of file SimpSolver.cc.

75 {
76 }

Member Function Documentation

uint32_t Minisat::Solver::abstractLevel ( Var  x) const
inlineprotectedinherited

Definition at line 349 of file Solver.h.

349 { return 1 << (level(x) & 31); }
int level(Var x) const
Definition: Solver.h:304

+ Here is the call graph for this function:

bool Minisat::SimpSolver::addClause ( const vec< Lit > &  ps)
inline

Definition at line 186 of file SimpSolver.h.

186 { ps.copyTo(add_tmp); return addClause_(add_tmp); }
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::SimpSolver::addClause ( Lit  p)
inline

Definition at line 188 of file SimpSolver.h.

188 { add_tmp.clear(); add_tmp.push(p); return addClause_(add_tmp); }
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

bool Minisat::SimpSolver::addClause ( Lit  p,
Lit  q 
)
inline

Definition at line 189 of file SimpSolver.h.

189 { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); return addClause_(add_tmp); }
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

bool Minisat::SimpSolver::addClause ( Lit  p,
Lit  q,
Lit  r 
)
inline

Definition at line 190 of file SimpSolver.h.

190 { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); add_tmp.push(r); return addClause_(add_tmp); }
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

bool Minisat::SimpSolver::addClause ( Lit  p,
Lit  q,
Lit  r,
Lit  s 
)
inline

Definition at line 191 of file SimpSolver.h.

191 { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); add_tmp.push(r); add_tmp.push(s); return addClause_(add_tmp); }
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

bool SimpSolver::addClause_ ( vec< Lit > &  ps)

Definition at line 150 of file SimpSolver.cc.

151 {
152 #ifndef NDEBUG
153  for (int i = 0; i < ps.size(); i++)
154  assert(!isEliminated(var(ps[i])));
155 #endif
156 
157  int nclauses = clauses.size();
158 
159  if (use_rcheck && implied(ps))
160  return true;
161 
162  if (!Solver::addClause_(ps))
163  return false;
164 
165  if (use_simplification && clauses.size() == nclauses + 1){
166  CRef cr = clauses.last();
167  const Clause& c = ca[cr];
168 
169  // NOTE: the clause is added to the queue immediately and then
170  // again during 'gatherTouchedClauses()'. If nothing happens
171  // in between, it will only be checked once. Otherwise, it may
172  // be checked twice unnecessarily. This is an unfortunate
173  // consequence of how backward subsumption is used to mimic
174  // forward subsumption.
176  for (int i = 0; i < c.size(); i++){
177  occurs[var(c[i])].push(cr);
178  n_occ[c[i]]++;
179  touched[var(c[i])] = 1;
180  n_touched++;
181  if (elim_heap.inHeap(var(c[i])))
182  elim_heap.increase(var(c[i]));
183  }
184  }
185 
186  return true;
187 }
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:137
ClauseAllocator ca
Definition: Solver.h:216
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
int var(Lit p)
Definition: SolverTypes.h:67
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
const T & last(void) const
Definition: Vec.h:84
void insert(T elem)
Definition: Queue.h:49
bool implied(const vec< Lit > &c)
Definition: SimpSolver.cc:322
vec< CRef > clauses
Definition: Solver.h:190
Heap< Var, ElimLt > elim_heap
Definition: SimpSolver.h:142
bool addClause_(vec< Lit > &ps)
Definition: Solver.cc:156
Size size(void) const
Definition: Vec.h:64
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
VMap< char > touched
Definition: SimpSolver.h:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::SimpSolver::addEmptyClause ( )
inline

Definition at line 187 of file SimpSolver.h.

187 { add_tmp.clear(); return addClause_(add_tmp); }
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

void Solver::analyze ( CRef  confl,
vec< Lit > &  out_learnt,
int &  out_btlevel 
)
protectedinherited

Definition at line 298 of file Solver.cc.

299 {
300  int pathC = 0;
301  Lit p = lit_Undef;
302 
303  // Generate conflict clause:
304  //
305  out_learnt.push(); // (leave room for the asserting literal)
306  int index = trail.size() - 1;
307 
308  do{
309  assert(confl != CRef_Undef); // (otherwise should be UIP)
310  Clause& c = ca[confl];
311 
312  if (c.learnt())
313  claBumpActivity(c);
314 
315  for (int j = (p == lit_Undef) ? 0 : 1; j < c.size(); j++){
316  Lit q = c[j];
317 
318  if (!seen[var(q)] && level(var(q)) > 0){
319  varBumpActivity(var(q));
320  seen[var(q)] = 1;
321  if (level(var(q)) >= decisionLevel())
322  pathC++;
323  else
324  out_learnt.push(q);
325  }
326  }
327 
328  // Select next clause to look at:
329  while (!seen[var(trail[index--])]);
330  p = trail[index+1];
331  confl = reason(var(p));
332  seen[var(p)] = 0;
333  pathC--;
334 
335  }while (pathC > 0);
336  out_learnt[0] = ~p;
337 
338  // Simplify conflict clause:
339  //
340  int i, j;
341  out_learnt.copyTo(analyze_toclear);
342  if (ccmin_mode == 2){
343  for (i = j = 1; i < out_learnt.size(); i++)
344  if (reason(var(out_learnt[i])) == CRef_Undef || !litRedundant(out_learnt[i]))
345  out_learnt[j++] = out_learnt[i];
346 
347  }else if (ccmin_mode == 1){
348  for (i = j = 1; i < out_learnt.size(); i++){
349  Var x = var(out_learnt[i]);
350 
351  if (reason(x) == CRef_Undef)
352  out_learnt[j++] = out_learnt[i];
353  else{
354  Clause& c = ca[reason(var(out_learnt[i]))];
355  for (int k = 1; k < c.size(); k++)
356  if (!seen[var(c[k])] && level(var(c[k])) > 0){
357  out_learnt[j++] = out_learnt[i];
358  break; }
359  }
360  }
361  }else
362  i = j = out_learnt.size();
363 
364  max_literals += out_learnt.size();
365  out_learnt.shrink(i - j);
366  tot_literals += out_learnt.size();
367 
368  // Find correct backtrack level:
369  //
370  if (out_learnt.size() == 1)
371  out_btlevel = 0;
372  else{
373  int max_i = 1;
374  // Find the first literal assigned at the next-highest level:
375  for (int i = 2; i < out_learnt.size(); i++)
376  if (level(var(out_learnt[i])) > level(var(out_learnt[max_i])))
377  max_i = i;
378  // Swap-in this literal at index 1:
379  Lit p = out_learnt[max_i];
380  out_learnt[max_i] = out_learnt[1];
381  out_learnt[1] = p;
382  out_btlevel = level(var(p));
383  }
384 
385  for (int j = 0; j < analyze_toclear.size(); j++) seen[var(analyze_toclear[j])] = 0; // ('seen[]' is now cleared)
386 }
ClauseAllocator ca
Definition: Solver.h:216
CRef reason(Var x) const
Definition: Solver.h:303
int level(Var x) const
Definition: Solver.h:304
void shrink(Size nelems)
Definition: Vec.h:65
int var(Lit p)
Definition: SolverTypes.h:67
void claBumpActivity(Clause &c)
Definition: Solver.h:323
int ccmin_mode
Definition: Solver.h:134
unsigned learnt
Definition: SolverTypes.h:143
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
bool litRedundant(Lit p)
Definition: Solver.cc:390
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
vec< Lit > analyze_toclear
Definition: Solver.h:226
VMap< char > seen
Definition: Solver.h:224
int Var
Definition: SolverTypes.h:43
const Lit lit_Undef
Definition: SolverTypes.h:77
vec< Lit > trail
Definition: Solver.h:192
uint64_t max_literals
Definition: Solver.h:152
void varBumpActivity(Var v, double inc)
Definition: Solver.h:311
uint64_t tot_literals
Definition: Solver.h:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::analyzeFinal ( Lit  p,
LSet out_conflict 
)
protectedinherited

Definition at line 458 of file Solver.cc.

459 {
460  out_conflict.clear();
461  out_conflict.insert(p);
462 
463  if (decisionLevel() == 0)
464  return;
465 
466  seen[var(p)] = 1;
467 
468  for (int i = trail.size()-1; i >= trail_lim[0]; i--){
469  Var x = var(trail[i]);
470  if (seen[x]){
471  if (reason(x) == CRef_Undef){
472  assert(level(x) > 0);
473  out_conflict.insert(~trail[i]);
474  }else{
475  Clause& c = ca[reason(x)];
476  for (int j = 1; j < c.size(); j++)
477  if (level(var(c[j])) > 0)
478  seen[var(c[j])] = 1;
479  }
480  seen[x] = 0;
481  }
482  }
483 
484  seen[var(p)] = 0;
485 }
ClauseAllocator ca
Definition: Solver.h:216
CRef reason(Var x) const
Definition: Solver.h:303
int level(Var x) const
Definition: Solver.h:304
void insert(K k)
Definition: IntMap.h:84
int var(Lit p)
Definition: SolverTypes.h:67
void clear(bool free=false)
Definition: IntMap.h:67
vec< int > trail_lim
Definition: Solver.h:193
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
Size size(void) const
Definition: Vec.h:64
VMap< char > seen
Definition: Solver.h:224
int Var
Definition: SolverTypes.h:43
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::asymm ( Var  v,
CRef  cr 
)
protected

Definition at line 410 of file SimpSolver.cc.

411 {
412  Clause& c = ca[cr];
413  assert(decisionLevel() == 0);
414 
415  if (c.mark() || satisfied(c)) return true;
416 
418  Lit l = lit_Undef;
419  for (int i = 0; i < c.size(); i++)
420  if (var(c[i]) != v && value(c[i]) != l_False)
421  uncheckedEnqueue(~c[i]);
422  else
423  l = c[i];
424 
425  if (propagate() != CRef_Undef){
426  cancelUntil(0);
427  asymm_lits++;
428  if (!strengthenClause(cr, l))
429  return false;
430  }else
431  cancelUntil(0);
432 
433  return true;
434 }
const lbool l_False((uint8_t) 1)
ClauseAllocator ca
Definition: Solver.h:216
int var(Lit p)
Definition: SolverTypes.h:67
void cancelUntil(int level)
Definition: Solver.cc:233
vec< int > trail_lim
Definition: Solver.h:193
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
bool strengthenClause(CRef cr, Lit l)
Definition: SimpSolver.cc:205
lbool value(Var x) const
Definition: Solver.h:350
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488
const Lit lit_Undef
Definition: SolverTypes.h:77
vec< Lit > trail
Definition: Solver.h:192
bool satisfied(const Clause &c) const
Definition: Solver.cc:224
CRef propagate()
Definition: Solver.cc:508

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::asymmVar ( Var  v)
protected

Definition at line 437 of file SimpSolver.cc.

438 {
439  assert(use_simplification);
440 
441  const vec<CRef>& cls = occurs.lookup(v);
442 
443  if (value(v) != l_Undef || cls.size() == 0)
444  return true;
445 
446  for (int i = 0; i < cls.size(); i++)
447  if (!asymm(v, cls[i]))
448  return false;
449 
450  return backwardSubsumptionCheck();
451 }
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
const lbool l_Undef((uint8_t) 2)
bool asymm(Var v, CRef cr)
Definition: SimpSolver.cc:410
Size size(void) const
Definition: Vec.h:64
bool backwardSubsumptionCheck(bool verbose=false)
Definition: SimpSolver.cc:343
lbool value(Var x) const
Definition: Solver.h:350

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::attachClause ( CRef  cr)
protectedinherited

Definition at line 186 of file Solver.cc.

186  {
187  const Clause& c = ca[cr];
188  assert(c.size() > 1);
189  watches[~c[0]].push(Watcher(cr, c[1]));
190  watches[~c[1]].push(Watcher(cr, c[0]));
191  if (c.learnt()) num_learnts++, learnts_literals += c.size();
192  else num_clauses++, clauses_literals += c.size();
193 }
ClauseAllocator ca
Definition: Solver.h:216
uint64_t num_clauses
Definition: Solver.h:152
unsigned learnt
Definition: SolverTypes.h:143
uint64_t learnts_literals
Definition: Solver.h:152
uint64_t num_learnts
Definition: Solver.h:152
uint64_t clauses_literals
Definition: Solver.h:152
OccLists< Lit, vec< Watcher >, WatcherDeleted, MkIndexLit > watches
Definition: Solver.h:203

+ Here is the caller graph for this function:

bool SimpSolver::backwardSubsumptionCheck ( bool  verbose = false)
protected

Definition at line 343 of file SimpSolver.cc.

344 {
345  int cnt = 0;
346  int subsumed = 0;
347  int deleted_literals = 0;
348  assert(decisionLevel() == 0);
349 
350  while (subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()){
351 
352  // Empty subsumption queue and return immediately on user-interrupt:
353  if (asynch_interrupt){
356  break; }
357 
358  // Check top-level assignments by creating a dummy clause and placing it in the queue:
359  if (subsumption_queue.size() == 0 && bwdsub_assigns < trail.size()){
360  Lit l = trail[bwdsub_assigns++];
361  ca[bwdsub_tmpunit][0] = l;
362  ca[bwdsub_tmpunit].calcAbstraction();
364 
366  Clause& c = ca[cr];
367 
368  if (c.mark()) continue;
369 
370  if (verbose && verbosity >= 2 && cnt++ % 1000 == 0)
371  printf("subsumption left: %10d (%10d subsumed, %10d deleted literals)\r", subsumption_queue.size(), subsumed, deleted_literals);
372 
373  assert(c.size() > 1 || value(c[0]) == l_True); // Unit-clauses should have been propagated before this point.
374 
375  // Find best variable to scan:
376  Var best = var(c[0]);
377  for (int i = 1; i < c.size(); i++)
378  if (occurs[var(c[i])].size() < occurs[best].size())
379  best = var(c[i]);
380 
381  // Search all candidates:
382  vec<CRef>& _cs = occurs.lookup(best);
383  CRef* cs = (CRef*)_cs;
384 
385  for (int j = 0; j < _cs.size(); j++)
386  if (c.mark())
387  break;
388  else if (!ca[cs[j]].mark() && cs[j] != cr && (subsumption_lim == -1 || ca[cs[j]].size() < subsumption_lim)){
389  Lit l = c.subsumes(ca[cs[j]]);
390 
391  if (l == lit_Undef)
392  subsumed++, removeClause(cs[j]);
393  else if (l != lit_Error){
394  deleted_literals++;
395 
396  if (!strengthenClause(cs[j], ~l))
397  return false;
398 
399  // Did current candidate get deleted from cs? Then check candidate at index j again:
400  if (var(l) == best)
401  j--;
402  }
403  }
404  }
405 
406  return true;
407 }
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:137
void removeClause(CRef cr)
Definition: SimpSolver.cc:190
ClauseAllocator ca
Definition: Solver.h:216
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
int var(Lit p)
Definition: SolverTypes.h:67
uint32_t size() const
Definition: SolverTypes.h:263
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
int size() const
Definition: Queue.h:42
void clear(bool dealloc=false)
Definition: Queue.h:41
void pop()
Definition: Queue.h:48
void insert(T elem)
Definition: Queue.h:49
int decisionLevel() const
Definition: Solver.h:348
bool asynch_interrupt
Definition: Solver.h:237
Size size(void) const
Definition: Vec.h:64
bool strengthenClause(CRef cr, Lit l)
Definition: SimpSolver.cc:205
T peek() const
Definition: Queue.h:47
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
int Var
Definition: SolverTypes.h:43
const Lit lit_Error
Definition: SolverTypes.h:78
Lit subsumes(const Clause &other) const
Definition: SolverTypes.h:438
const Lit lit_Undef
Definition: SolverTypes.h:77
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::budgetOff ( )
inlineinherited

Definition at line 373 of file Solver.h.

int64_t conflict_budget
Definition: Solver.h:235
int64_t propagation_budget
Definition: Solver.h:236

+ Here is the caller graph for this function:

void Solver::cancelUntil ( int  level)
protectedinherited

Definition at line 233 of file Solver.cc.

233  {
234  if (decisionLevel() > level){
235  for (int c = trail.size()-1; c >= trail_lim[level]; c--){
236  Var x = var(trail[c]);
237  assigns [x] = l_Undef;
238  if (phase_saving > 1 || (phase_saving == 1 && c > trail_lim.last()))
239  polarity[x] = sign(trail[c]);
240  insertVarOrder(x); }
241  qhead = trail_lim[level];
244  } }
int level(Var x) const
Definition: Solver.h:304
void shrink(Size nelems)
Definition: Vec.h:65
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
const lbool l_Undef((uint8_t) 2)
const T & last(void) const
Definition: Vec.h:84
void insertVarOrder(Var x)
Definition: Solver.h:306
vec< int > trail_lim
Definition: Solver.h:193
int decisionLevel() const
Definition: Solver.h:348
VMap< char > polarity
Definition: Solver.h:198
Size size(void) const
Definition: Vec.h:64
int phase_saving
Definition: Solver.h:135
VMap< lbool > assigns
Definition: Solver.h:197
int Var
Definition: SolverTypes.h:43
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::checkGarbage ( double  gf)
inlineinherited

Definition at line 331 of file Solver.h.

331  {
332  if (ca.wasted() > ca.size() * gf)
333  garbageCollect(); }
ClauseAllocator ca
Definition: Solver.h:216
uint32_t size() const
Definition: SolverTypes.h:263
virtual void garbageCollect()
Definition: Solver.cc:1057
uint32_t wasted() const
Definition: SolverTypes.h:264

+ Here is the call graph for this function:

void Minisat::Solver::checkGarbage ( void  )
inlineinherited

Definition at line 330 of file Solver.h.

330 { return checkGarbage(garbage_frac); }
void checkGarbage()
Definition: Solver.h:330
double garbage_frac
Definition: Solver.h:138

+ Here is the caller graph for this function:

void Minisat::Solver::claBumpActivity ( Clause c)
inlineprotectedinherited

Definition at line 323 of file Solver.h.

323  {
324  if ( (c.activity() += cla_inc) > 1e20 ) {
325  // Rescale:
326  for (int i = 0; i < learnts.size(); i++)
327  ca[learnts[i]].activity() *= 1e-20;
328  cla_inc *= 1e-20; } }
ClauseAllocator ca
Definition: Solver.h:216
double cla_inc
Definition: Solver.h:208
Size size(void) const
Definition: Vec.h:64
VMap< double > activity
Definition: Solver.h:196
vec< CRef > learnts
Definition: Solver.h:191

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::claDecayActivity ( )
inlineprotectedinherited

Definition at line 322 of file Solver.h.

322 { cla_inc *= (1 / clause_decay); }
double clause_decay
Definition: Solver.h:130
double cla_inc
Definition: Solver.h:208

+ Here is the caller graph for this function:

ClauseIterator Minisat::Solver::clausesBegin ( ) const
inlineinherited

Definition at line 390 of file Solver.h.

390 { return ClauseIterator(ca, &clauses[0]); }
ClauseAllocator ca
Definition: Solver.h:216
vec< CRef > clauses
Definition: Solver.h:190
ClauseIterator Minisat::Solver::clausesEnd ( ) const
inlineinherited

Definition at line 391 of file Solver.h.

391 { return ClauseIterator(ca, &clauses[clauses.size()]); }
ClauseAllocator ca
Definition: Solver.h:216
vec< CRef > clauses
Definition: Solver.h:190
Size size(void) const
Definition: Vec.h:64

+ Here is the call graph for this function:

void Minisat::Solver::clearInterrupt ( )
inlineinherited

Definition at line 372 of file Solver.h.

372 { asynch_interrupt = false; }
bool asynch_interrupt
Definition: Solver.h:237
int Minisat::Solver::decisionLevel ( ) const
inlineprotectedinherited

Definition at line 348 of file Solver.h.

348 { return trail_lim.size(); }
vec< int > trail_lim
Definition: Solver.h:193
Size size(void) const
Definition: Vec.h:64

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::detachClause ( CRef  cr,
bool  strict = false 
)
protectedinherited

Definition at line 196 of file Solver.cc.

196  {
197  const Clause& c = ca[cr];
198  assert(c.size() > 1);
199 
200  // Strict or lazy detaching:
201  if (strict){
202  remove(watches[~c[0]], Watcher(cr, c[1]));
203  remove(watches[~c[1]], Watcher(cr, c[0]));
204  }else{
205  watches.smudge(~c[0]);
206  watches.smudge(~c[1]);
207  }
208 
209  if (c.learnt()) num_learnts--, learnts_literals -= c.size();
210  else num_clauses--, clauses_literals -= c.size();
211 }
ClauseAllocator ca
Definition: Solver.h:216
uint64_t num_clauses
Definition: Solver.h:152
unsigned learnt
Definition: SolverTypes.h:143
uint64_t learnts_literals
Definition: Solver.h:152
uint64_t num_learnts
Definition: Solver.h:152
uint64_t clauses_literals
Definition: Solver.h:152
OccLists< Lit, vec< Watcher >, WatcherDeleted, MkIndexLit > watches
Definition: Solver.h:203

+ Here is the caller graph for this function:

static double Minisat::Solver::drand ( double &  seed)
inlinestaticprotectedinherited

Definition at line 288 of file Solver.h.

288  {
289  seed *= 1389796;
290  int q = (int)(seed / 2147483647);
291  seed -= (double)q * 2147483647;
292  return seed / 2147483647; }

+ Here is the caller graph for this function:

bool SimpSolver::eliminate ( bool  turn_off_elim = false)

Definition at line 597 of file SimpSolver.cc.

598 {
599  if (!simplify())
600  return false;
601  else if (!use_simplification)
602  return true;
603 
604  // Main simplification loop:
605  //
606  while (n_touched > 0 || bwdsub_assigns < trail.size() || elim_heap.size() > 0){
607 
609  // printf(" ## (time = %6.2f s) BWD-SUB: queue = %d, trail = %d\n", cpuTime(), subsumption_queue.size(), trail.size() - bwdsub_assigns);
610  if ((subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()) &&
611  !backwardSubsumptionCheck(true)){
612  ok = false; goto cleanup; }
613 
614  // Empty elim_heap and return immediately on user-interrupt:
615  if (asynch_interrupt){
616  assert(bwdsub_assigns == trail.size());
617  assert(subsumption_queue.size() == 0);
618  assert(n_touched == 0);
619  elim_heap.clear();
620  goto cleanup; }
621 
622  // printf(" ## (time = %6.2f s) ELIM: vars = %d\n", cpuTime(), elim_heap.size());
623  for (int cnt = 0; !elim_heap.empty(); cnt++){
624  Var elim = elim_heap.removeMin();
625 
626  if (asynch_interrupt) break;
627 
628  if (isEliminated(elim) || value(elim) != l_Undef) continue;
629 
630  if (verbosity >= 2 && cnt % 100 == 0)
631  printf("elimination left: %10d\r", elim_heap.size());
632 
633  if (use_asymm){
634  // Temporarily freeze variable. Otherwise, it would immediately end up on the queue again:
635  bool was_frozen = frozen[elim];
636  frozen[elim] = true;
637  if (!asymmVar(elim)){
638  ok = false; goto cleanup; }
639  frozen[elim] = was_frozen; }
640 
641  // At this point, the variable may have been set by assymetric branching, so check it
642  // again. Also, don't eliminate frozen variables:
643  if (use_elim && value(elim) == l_Undef && !frozen[elim] && !eliminateVar(elim)){
644  ok = false; goto cleanup; }
645 
647  }
648 
649  assert(subsumption_queue.size() == 0);
650  }
651  cleanup:
652 
653  // If no more simplification is needed, free all simplification-related data structures:
654  if (turn_off_elim){
655  touched .clear(true);
656  occurs .clear(true);
657  n_occ .clear(true);
658  elim_heap.clear(true);
659  subsumption_queue.clear(true);
660 
661  use_simplification = false;
662  remove_satisfied = true;
663  ca.extra_clause_field = false;
664  max_simp_var = nVars();
665 
666  // Force full cleanup (this is safe and desirable since it only happens once):
668  garbageCollect();
669  }else{
670  // Cheaper cleanup:
671  checkGarbage();
672  }
673 
674  if (verbosity >= 1 && elimclauses.size() > 0)
675  printf("| Eliminated clauses: %10.2f Mb |\n",
676  double(elimclauses.size() * sizeof(uint32_t)) / (1024*1024));
677 
678  return ok;
679 }
ClauseAllocator ca
Definition: Solver.h:216
void gatherTouchedClauses()
Definition: SimpSolver.cc:294
bool simplify()
Definition: Solver.cc:643
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
void clear(bool dispose=false)
Definition: IntMap.h:52
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
int size() const
Definition: Queue.h:42
vec< uint32_t > elimclauses
Definition: SimpSolver.h:137
void clear(bool dealloc=false)
Definition: Queue.h:41
const lbool l_Undef((uint8_t) 2)
virtual void garbageCollect()
Definition: SimpSolver.cc:714
int nVars() const
Definition: Solver.h:357
bool eliminateVar(Var v)
Definition: SimpSolver.cc:487
bool asynch_interrupt
Definition: Solver.h:237
void checkGarbage()
Definition: Solver.h:330
void rebuildOrderHeap()
Definition: Solver.cc:625
Heap< Var, ElimLt > elim_heap
Definition: SimpSolver.h:142
Size size(void) const
Definition: Vec.h:64
bool asymmVar(Var v)
Definition: SimpSolver.cc:437
VMap< char > frozen
Definition: SimpSolver.h:144
bool backwardSubsumptionCheck(bool verbose=false)
Definition: SimpSolver.cc:343
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
lbool value(Var x) const
Definition: Solver.h:350
int Var
Definition: SolverTypes.h:43
vec< Lit > trail
Definition: Solver.h:192
double simp_garbage_frac
Definition: SimpSolver.h:94
VMap< char > touched
Definition: SimpSolver.h:138
bool remove_satisfied
Definition: Solver.h:214

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::eliminateVar ( Var  v)
protected

Definition at line 487 of file SimpSolver.cc.

488 {
489  assert(!frozen[v]);
490  assert(!isEliminated(v));
491  assert(value(v) == l_Undef);
492 
493  // Split the occurrences into positive and negative:
494  //
495  const vec<CRef>& cls = occurs.lookup(v);
496  vec<CRef> pos, neg;
497  for (int i = 0; i < cls.size(); i++)
498  (find(ca[cls[i]], mkLit(v)) ? pos : neg).push(cls[i]);
499 
500  // Check wether the increase in number of clauses stays within the allowed ('grow'). Moreover, no
501  // clause must exceed the limit on the maximal clause size (if it is set):
502  //
503  int cnt = 0;
504  int clause_size = 0;
505 
506  for (int i = 0; i < pos.size(); i++)
507  for (int j = 0; j < neg.size(); j++)
508  if (merge(ca[pos[i]], ca[neg[j]], v, clause_size) &&
509  (++cnt > cls.size() + grow || (clause_lim != -1 && clause_size > clause_lim)))
510  return true;
511 
512  // Delete and store old clauses:
513  eliminated[v] = true;
514  setDecisionVar(v, false);
515  eliminated_vars++;
516 
517  if (pos.size() > neg.size()){
518  for (int i = 0; i < neg.size(); i++)
519  mkElimClause(elimclauses, v, ca[neg[i]]);
521  }else{
522  for (int i = 0; i < pos.size(); i++)
523  mkElimClause(elimclauses, v, ca[pos[i]]);
525  }
526 
527  for (int i = 0; i < cls.size(); i++)
528  removeClause(cls[i]);
529 
530  // Produce clauses in cross product:
531  vec<Lit>& resolvent = add_tmp;
532  for (int i = 0; i < pos.size(); i++)
533  for (int j = 0; j < neg.size(); j++)
534  if (merge(ca[pos[i]], ca[neg[j]], v, resolvent) && !addClause_(resolvent))
535  return false;
536 
537  // Free occurs list for this variable:
538  occurs[v].clear(true);
539 
540  // Free watchers lists for this variable, if possible:
541  if (watches[ mkLit(v)].size() == 0) watches[ mkLit(v)].clear(true);
542  if (watches[~mkLit(v)].size() == 0) watches[~mkLit(v)].clear(true);
543 
544  return backwardSubsumptionCheck();
545 }
void removeClause(CRef cr)
Definition: SimpSolver.cc:190
ClauseAllocator ca
Definition: Solver.h:216
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
Lit mkLit(Var var, bool sign=false)
Definition: SolverTypes.h:63
vec< uint32_t > elimclauses
Definition: SimpSolver.h:137
const lbool l_Undef((uint8_t) 2)
void setDecisionVar(Var v, bool b)
Definition: Solver.h:361
bool merge(const Clause &_ps, const Clause &_qs, Var v, vec< Lit > &out_clause)
Definition: SimpSolver.cc:232
VMap< char > eliminated
Definition: SimpSolver.h:146
Size size(void) const
Definition: Vec.h:64
VMap< char > frozen
Definition: SimpSolver.h:144
bool backwardSubsumptionCheck(bool verbose=false)
Definition: SimpSolver.cc:343
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
static void mkElimClause(vec< uint32_t > &elimclauses, Lit x)
Definition: SimpSolver.cc:454
lbool value(Var x) const
Definition: Solver.h:350
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227
static bool find(V &ts, const T &t)
Definition: Alg.h:47
OccLists< Lit, vec< Watcher >, WatcherDeleted, MkIndexLit > watches
Definition: Solver.h:203

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::Solver::enqueue ( Lit  p,
CRef  from = CRef_Undef 
)
inlineprotectedinherited

Definition at line 336 of file Solver.h.

336 { return value(p) != l_Undef ? value(p) != l_False : (uncheckedEnqueue(p, from), true); }
const lbool l_False((uint8_t) 1)
const lbool l_Undef((uint8_t) 2)
lbool value(Var x) const
Definition: Solver.h:350
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SimpSolver::extendModel ( )
protected

Definition at line 580 of file SimpSolver.cc.

581 {
582  int i, j;
583  Lit x;
584 
585  for (i = elimclauses.size()-1; i > 0; i -= j){
586  for (j = elimclauses[i--]; j > 1; j--, i--)
587  if (modelValue(toLit(elimclauses[i])) != l_False)
588  goto next;
589 
590  x = toLit(elimclauses[i]);
591  model[var(x)] = lbool(!sign(x));
592  next:;
593  }
594 }
const lbool l_False((uint8_t) 1)
lbool modelValue(Var x) const
Definition: Solver.h:352
int var(Lit p)
Definition: SolverTypes.h:67
vec< uint32_t > elimclauses
Definition: SimpSolver.h:137
bool sign(Lit p)
Definition: SolverTypes.h:66
Size size(void) const
Definition: Vec.h:64
vec< lbool > model
Definition: Solver.h:122
Lit toLit(int i)
Definition: SolverTypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::SimpSolver::freezeVar ( Var  v)
inline

Definition at line 194 of file SimpSolver.h.

194  {
195  if (!frozen[v]){
196  frozen[v] = 1;
197  frozen_vars.push(v);
198  } }
vec< Var > frozen_vars
Definition: SimpSolver.h:145
void push(void)
Definition: Vec.h:74
VMap< char > frozen
Definition: SimpSolver.h:144

+ Here is the call graph for this function:

void SimpSolver::garbageCollect ( )
virtual

Reimplemented from Minisat::Solver.

Definition at line 714 of file SimpSolver.cc.

715 {
716  // Initialize the next region to a size corresponding to the estimated utilization degree. This
717  // is not precise but should avoid some unnecessary reallocations for the new region:
718  ClauseAllocator to(ca.size() - ca.wasted());
719 
720  to.extra_clause_field = ca.extra_clause_field; // NOTE: this is important to keep (or lose) the extra fields.
721  relocAll(to);
722  Solver::relocAll(to);
723  if (verbosity >= 2)
724  printf("| Garbage collection: %12d bytes => %12d bytes |\n",
726  to.moveTo(ca);
727 }
ClauseAllocator ca
Definition: Solver.h:216
void relocAll(ClauseAllocator &to)
Definition: Solver.cc:1010
uint32_t size() const
Definition: SolverTypes.h:263
void relocAll(ClauseAllocator &to)
Definition: SimpSolver.cc:686
uint32_t wasted() const
Definition: SolverTypes.h:264

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SimpSolver::gatherTouchedClauses ( )
protected

Definition at line 294 of file SimpSolver.cc.

295 {
296  if (n_touched == 0) return;
297 
298  int i,j;
299  for (i = j = 0; i < subsumption_queue.size(); i++)
300  if (ca[subsumption_queue[i]].mark() == 0)
301  ca[subsumption_queue[i]].mark(2);
302 
303  for (i = 0; i < nVars(); i++)
304  if (touched[i]){
305  const vec<CRef>& cs = occurs.lookup(i);
306  for (j = 0; j < cs.size(); j++)
307  if (ca[cs[j]].mark() == 0){
308  subsumption_queue.insert(cs[j]);
309  ca[cs[j]].mark(2);
310  }
311  touched[i] = 0;
312  }
313 
314  for (i = 0; i < subsumption_queue.size(); i++)
315  if (ca[subsumption_queue[i]].mark() == 2)
316  ca[subsumption_queue[i]].mark(0);
317 
318  n_touched = 0;
319 }
ClauseAllocator ca
Definition: Solver.h:216
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
int size() const
Definition: Queue.h:42
void insert(T elem)
Definition: Queue.h:49
int nVars() const
Definition: Solver.h:357
Size size(void) const
Definition: Vec.h:64
VMap< char > touched
Definition: SimpSolver.h:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::implied ( const vec< Lit > &  c)
protected

Definition at line 322 of file SimpSolver.cc.

323 {
324  assert(decisionLevel() == 0);
325 
327  for (int i = 0; i < c.size(); i++)
328  if (value(c[i]) == l_True){
329  cancelUntil(0);
330  return true;
331  }else if (value(c[i]) != l_False){
332  assert(value(c[i]) == l_Undef);
333  uncheckedEnqueue(~c[i]);
334  }
335 
336  bool result = propagate() != CRef_Undef;
337  cancelUntil(0);
338  return result;
339 }
const lbool l_False((uint8_t) 1)
const lbool l_Undef((uint8_t) 2)
void cancelUntil(int level)
Definition: Solver.cc:233
vec< int > trail_lim
Definition: Solver.h:193
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488
vec< Lit > trail
Definition: Solver.h:192
CRef propagate()
Definition: Solver.cc:508

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Solver::implies ( const vec< Lit > &  assumps,
vec< Lit > &  out 
)
inherited

Definition at line 889 of file Solver.cc.

890 {
892  for (int i = 0; i < assumps.size(); i++){
893  Lit a = assumps[i];
894 
895  if (value(a) == l_False){
896  cancelUntil(0);
897  return false;
898  }else if (value(a) == l_Undef)
899  uncheckedEnqueue(a);
900  }
901 
902  unsigned trail_before = trail.size();
903  bool ret = true;
904  if (propagate() == CRef_Undef){
905  out.clear();
906  for (int j = trail_before; j < trail.size(); j++)
907  out.push(trail[j]);
908  }else
909  ret = false;
910 
911  cancelUntil(0);
912  return ret;
913 }
const lbool l_False((uint8_t) 1)
const lbool l_Undef((uint8_t) 2)
void cancelUntil(int level)
Definition: Solver.cc:233
vec< int > trail_lim
Definition: Solver.h:193
const CRef CRef_Undef
Definition: SolverTypes.h:225
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
lbool value(Var x) const
Definition: Solver.h:350
void clear(bool dealloc=false)
Definition: Vec.h:125
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488
vec< Lit > trail
Definition: Solver.h:192
CRef propagate()
Definition: Solver.cc:508

+ Here is the call graph for this function:

void Minisat::Solver::insertVarOrder ( Var  x)
inlineprotectedinherited

Definition at line 306 of file Solver.h.

306  {
307  if (!order_heap.inHeap(x) && decision[x]) order_heap.insert(x); }
Heap< Var, VarOrderLt > order_heap
Definition: Solver.h:205
VMap< char > decision
Definition: Solver.h:200

+ Here is the caller graph for this function:

void Minisat::Solver::interrupt ( )
inlineinherited

Definition at line 371 of file Solver.h.

371 { asynch_interrupt = true; }
bool asynch_interrupt
Definition: Solver.h:237

+ Here is the caller graph for this function:

static int Minisat::Solver::irand ( double &  seed,
int  size 
)
inlinestaticprotectedinherited

Definition at line 295 of file Solver.h.

295  {
296  return (int)(drand(seed) * size); }
static double drand(double &seed)
Definition: Solver.h:288

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::SimpSolver::isEliminated ( Var  v) const
inline

Definition at line 178 of file SimpSolver.h.

178 { return eliminated[v]; }
VMap< char > eliminated
Definition: SimpSolver.h:146

+ Here is the caller graph for this function:

bool Minisat::Solver::isRemoved ( CRef  cr) const
inlineprotectedinherited

Definition at line 344 of file Solver.h.

344 { return ca[cr].mark() == 1; }
ClauseAllocator ca
Definition: Solver.h:216

+ Here is the caller graph for this function:

int Minisat::Solver::level ( Var  x) const
inlineprotectedinherited

Definition at line 304 of file Solver.h.

304 { return vardata[x].level; }
VMap< VarData > vardata
Definition: Solver.h:201

+ Here is the caller graph for this function:

bool Solver::litRedundant ( Lit  p)
protectedinherited

Definition at line 390 of file Solver.cc.

391 {
392  enum { seen_undef = 0, seen_source = 1, seen_removable = 2, seen_failed = 3 };
393  assert(seen[var(p)] == seen_undef || seen[var(p)] == seen_source);
394  assert(reason(var(p)) != CRef_Undef);
395 
396  Clause* c = &ca[reason(var(p))];
398  stack.clear();
399 
400  for (uint32_t i = 1; ; i++){
401  if (i < (uint32_t)c->size()){
402  // Checking 'p'-parents 'l':
403  Lit l = (*c)[i];
404 
405  // Variable at level 0 or previously removable:
406  if (level(var(l)) == 0 || seen[var(l)] == seen_source || seen[var(l)] == seen_removable){
407  continue; }
408 
409  // Check variable can not be removed for some local reason:
410  if (reason(var(l)) == CRef_Undef || seen[var(l)] == seen_failed){
411  stack.push(ShrinkStackElem(0, p));
412  for (int i = 0; i < stack.size(); i++)
413  if (seen[var(stack[i].l)] == seen_undef){
414  seen[var(stack[i].l)] = seen_failed;
415  analyze_toclear.push(stack[i].l);
416  }
417 
418  return false;
419  }
420 
421  // Recursively check 'l':
422  stack.push(ShrinkStackElem(i, p));
423  i = 0;
424  p = l;
425  c = &ca[reason(var(p))];
426  }else{
427  // Finished with current element 'p' and reason 'c':
428  if (seen[var(p)] == seen_undef){
429  seen[var(p)] = seen_removable;
431  }
432 
433  // Terminate with success if stack is empty:
434  if (stack.size() == 0) break;
435 
436  // Continue with top element on stack:
437  i = stack.last().i;
438  p = stack.last().l;
439  c = &ca[reason(var(p))];
440 
441  stack.pop();
442  }
443  }
444 
445  return true;
446 }
ClauseAllocator ca
Definition: Solver.h:216
CRef reason(Var x) const
Definition: Solver.h:303
int level(Var x) const
Definition: Solver.h:304
int var(Lit p)
Definition: SolverTypes.h:67
const T & last(void) const
Definition: Vec.h:84
const CRef CRef_Undef
Definition: SolverTypes.h:225
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
void pop(void)
Definition: Vec.h:78
vec< Lit > analyze_toclear
Definition: Solver.h:226
vec< ShrinkStackElem > analyze_stack
Definition: Solver.h:225
void clear(bool dealloc=false)
Definition: Vec.h:125
VMap< char > seen
Definition: Solver.h:224

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::Solver::locked ( const Clause c) const
inlineprotectedinherited

Definition at line 345 of file Solver.h.

345 { return value(c[0]) == l_True && reason(var(c[0])) != CRef_Undef && ca.lea(reason(var(c[0]))) == &c; }
ClauseAllocator ca
Definition: Solver.h:216
CRef reason(Var x) const
Definition: Solver.h:303
int var(Lit p)
Definition: SolverTypes.h:67
const CRef CRef_Undef
Definition: SolverTypes.h:225
Clause * lea(CRef r)
Definition: SolverTypes.h:269
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::merge ( const Clause _ps,
const Clause _qs,
Var  v,
vec< Lit > &  out_clause 
)
protected

Definition at line 232 of file SimpSolver.cc.

233 {
234  merges++;
235  out_clause.clear();
236 
237  bool ps_smallest = _ps.size() < _qs.size();
238  const Clause& ps = ps_smallest ? _qs : _ps;
239  const Clause& qs = ps_smallest ? _ps : _qs;
240 
241  for (int i = 0; i < qs.size(); i++){
242  if (var(qs[i]) != v){
243  for (int j = 0; j < ps.size(); j++)
244  if (var(ps[j]) == var(qs[i])){
245  if (ps[j] == ~qs[i])
246  return false;
247  else
248  goto next;
249  }
250  out_clause.push(qs[i]);
251  }
252  next:;
253  }
254 
255  for (int i = 0; i < ps.size(); i++)
256  if (var(ps[i]) != v)
257  out_clause.push(ps[i]);
258 
259  return true;
260 }
int var(Lit p)
Definition: SolverTypes.h:67
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::merge ( const Clause _ps,
const Clause _qs,
Var  v,
int &  size 
)
protected

Definition at line 264 of file SimpSolver.cc.

265 {
266  merges++;
267 
268  bool ps_smallest = _ps.size() < _qs.size();
269  const Clause& ps = ps_smallest ? _qs : _ps;
270  const Clause& qs = ps_smallest ? _ps : _qs;
271  const Lit* __ps = (const Lit*)ps;
272  const Lit* __qs = (const Lit*)qs;
273 
274  size = ps.size()-1;
275 
276  for (int i = 0; i < qs.size(); i++){
277  if (var(__qs[i]) != v){
278  for (int j = 0; j < ps.size(); j++)
279  if (var(__ps[j]) == var(__qs[i])){
280  if (__ps[j] == ~__qs[i])
281  return false;
282  else
283  goto next;
284  }
285  size++;
286  }
287  next:;
288  }
289 
290  return true;
291 }
int var(Lit p)
Definition: SolverTypes.h:67

+ Here is the call graph for this function:

static VarData Minisat::Solver::mkVarData ( CRef  cr,
int  l 
)
inlinestaticprotectedinherited

Definition at line 159 of file Solver.h.

159 { VarData d = {cr, l}; return d; }

+ Here is the caller graph for this function:

lbool Minisat::Solver::modelValue ( Var  x) const
inlineinherited

Definition at line 352 of file Solver.h.

352 { return model[x]; }
vec< lbool > model
Definition: Solver.h:122

+ Here is the caller graph for this function:

lbool Minisat::Solver::modelValue ( Lit  p) const
inlineinherited

Definition at line 353 of file Solver.h.

353 { return model[var(p)] ^ sign(p); }
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
vec< lbool > model
Definition: Solver.h:122

+ Here is the call graph for this function:

int Minisat::Solver::nAssigns ( ) const
inlineinherited

Definition at line 354 of file Solver.h.

354 { return trail.size(); }
Size size(void) const
Definition: Vec.h:64
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Minisat::Solver::nClauses ( ) const
inlineinherited

Definition at line 355 of file Solver.h.

355 { return num_clauses; }
uint64_t num_clauses
Definition: Solver.h:152

+ Here is the caller graph for this function:

void Minisat::Solver::newDecisionLevel ( )
inlineprotectedinherited

Definition at line 346 of file Solver.h.

346 { trail_lim.push(trail.size()); }
vec< int > trail_lim
Definition: Solver.h:193
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Var SimpSolver::newVar ( lbool  upol = l_Undef,
bool  dvar = true 
)

Definition at line 79 of file SimpSolver.cc.

79  {
80  Var v = Solver::newVar(upol, dvar);
81 
82  frozen .insert(v, (char)false);
83  eliminated.insert(v, (char)false);
84 
85  if (use_simplification){
86  n_occ .insert( mkLit(v), 0);
87  n_occ .insert(~mkLit(v), 0);
88  occurs .init (v);
89  touched .insert(v, 0);
90  elim_heap .insert(v);
91  }
92  return v; }
void insert(K key, V val, V pad)
Definition: IntMap.h:49
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
Lit mkLit(Var var, bool sign=false)
Definition: SolverTypes.h:63
VMap< char > eliminated
Definition: SimpSolver.h:146
Heap< Var, ElimLt > elim_heap
Definition: SimpSolver.h:142
VMap< char > frozen
Definition: SimpSolver.h:144
Var newVar(lbool upol=l_Undef, bool dvar=true)
Definition: Solver.cc:121
int Var
Definition: SolverTypes.h:43
VMap< char > touched
Definition: SimpSolver.h:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Minisat::Solver::nFreeVars ( ) const
inlineinherited

Definition at line 359 of file Solver.h.

359 { return (int)dec_vars - (trail_lim.size() == 0 ? trail.size() : trail_lim[0]); }
uint64_t dec_vars
Definition: Solver.h:152
vec< int > trail_lim
Definition: Solver.h:193
Size size(void) const
Definition: Vec.h:64
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

int Minisat::Solver::nLearnts ( ) const
inlineinherited

Definition at line 356 of file Solver.h.

356 { return num_learnts; }
uint64_t num_learnts
Definition: Solver.h:152

+ Here is the caller graph for this function:

int Minisat::Solver::nVars ( ) const
inlineinherited

Definition at line 357 of file Solver.h.

357 { return next_var; }

+ Here is the caller graph for this function:

bool Minisat::Solver::okay ( ) const
inlineinherited

Definition at line 388 of file Solver.h.

388 { return ok; }
Lit Solver::pickBranchLit ( )
protectedinherited

Definition at line 251 of file Solver.cc.

252 {
253  Var next = var_Undef;
254 
255  // Random decision:
256  if (drand(random_seed) < random_var_freq && !order_heap.empty()){
257  next = order_heap[irand(random_seed,order_heap.size())];
258  if (value(next) == l_Undef && decision[next])
259  rnd_decisions++; }
260 
261  // Activity based decision:
262  while (next == var_Undef || value(next) != l_Undef || !decision[next])
263  if (order_heap.empty()){
264  next = var_Undef;
265  break;
266  }else
267  next = order_heap.removeMin();
268 
269  // Choose polarity based on different polarity modes (global or per-variable):
270  if (next == var_Undef)
271  return lit_Undef;
272  else if (user_pol[next] != l_Undef)
273  return mkLit(next, user_pol[next] == l_True);
274  else if (rnd_pol)
275  return mkLit(next, drand(random_seed) < 0.5);
276  else
277  return mkLit(next, polarity[next]);
278 }
Lit mkLit(Var var, bool sign=false)
Definition: SolverTypes.h:63
const lbool l_Undef((uint8_t) 2)
const Var var_Undef
Definition: SolverTypes.h:47
double random_var_freq
Definition: Solver.h:131
VMap< char > polarity
Definition: Solver.h:198
VMap< lbool > user_pol
Definition: Solver.h:199
Heap< Var, VarOrderLt > order_heap
Definition: Solver.h:205
static double drand(double &seed)
Definition: Solver.h:288
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
static int irand(double &seed, int size)
Definition: Solver.h:295
int Var
Definition: SolverTypes.h:43
const Lit lit_Undef
Definition: SolverTypes.h:77
uint64_t rnd_decisions
Definition: Solver.h:151
double random_seed
Definition: Solver.h:132
VMap< char > decision
Definition: Solver.h:200
bool rnd_pol
Definition: Solver.h:136

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::printStats ( ) const
inherited

Definition at line 993 of file Solver.cc.

994 {
995  double cpu_time = cpuTime();
996  double mem_used = memUsedPeak();
997  printf("restarts : %" PRIu64 "\n", starts);
998  printf("conflicts : %-12" PRIu64 " (%.0f /sec)\n", conflicts , conflicts /cpu_time);
999  printf("decisions : %-12" PRIu64 " (%4.2f %% random) (%.0f /sec)\n", decisions, (float)rnd_decisions*100 / (float)decisions, decisions /cpu_time);
1000  printf("propagations : %-12" PRIu64 " (%.0f /sec)\n", propagations, propagations/cpu_time);
1001  printf("conflict literals : %-12" PRIu64 " (%4.2f %% deleted)\n", tot_literals, (max_literals - tot_literals)*100 / (double)max_literals);
1002  if (mem_used != 0) printf("Memory used : %.2f MB\n", mem_used);
1003  printf("CPU time : %g s\n", cpu_time);
1004 }
static double cpuTime(void)
Definition: System.h:65
uint64_t starts
Definition: Solver.h:151
uint64_t decisions
Definition: Solver.h:151
uint64_t propagations
Definition: Solver.h:151
uint64_t max_literals
Definition: Solver.h:152
double memUsedPeak(bool strictlyPeak=false)
Definition: System.cc:96
uint64_t rnd_decisions
Definition: Solver.h:151
uint64_t conflicts
Definition: Solver.h:151
uint64_t tot_literals
Definition: Solver.h:152

+ Here is the call graph for this function:

double Solver::progressEstimate ( ) const
protectedinherited

Definition at line 798 of file Solver.cc.

799 {
800  double progress = 0;
801  double F = 1.0 / nVars();
802 
803  for (int i = 0; i <= decisionLevel(); i++){
804  int beg = i == 0 ? 0 : trail_lim[i - 1];
805  int end = i == decisionLevel() ? trail.size() : trail_lim[i];
806  progress += pow(F, i) * (end - beg);
807  }
808 
809  return progress / nVars();
810 }
vec< int > trail_lim
Definition: Solver.h:193
int nVars() const
Definition: Solver.h:357
int decisionLevel() const
Definition: Solver.h:348
Size size(void) const
Definition: Vec.h:64
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CRef Solver::propagate ( )
protectedinherited

Definition at line 508 of file Solver.cc.

509 {
510  CRef confl = CRef_Undef;
511  int num_props = 0;
512 
513  while (qhead < trail.size()){
514  Lit p = trail[qhead++]; // 'p' is enqueued fact to propagate.
515  vec<Watcher>& ws = watches.lookup(p);
516  Watcher *i, *j, *end;
517  num_props++;
518 
519  for (i = j = (Watcher*)ws, end = i + ws.size(); i != end;){
520  // Try to avoid inspecting the clause:
521  Lit blocker = i->blocker;
522  if (value(blocker) == l_True){
523  *j++ = *i++; continue; }
524 
525  // Make sure the false literal is data[1]:
526  CRef cr = i->cref;
527  Clause& c = ca[cr];
528  Lit false_lit = ~p;
529  if (c[0] == false_lit)
530  c[0] = c[1], c[1] = false_lit;
531  assert(c[1] == false_lit);
532  i++;
533 
534  // If 0th watch is true, then clause is already satisfied.
535  Lit first = c[0];
536  Watcher w = Watcher(cr, first);
537  if (first != blocker && value(first) == l_True){
538  *j++ = w; continue; }
539 
540  // Look for new watch:
541  for (int k = 2; k < c.size(); k++)
542  if (value(c[k]) != l_False){
543  c[1] = c[k]; c[k] = false_lit;
544  watches[~c[1]].push(w);
545  goto NextClause; }
546 
547  // Did not find watch -- clause is unit under assignment:
548  *j++ = w;
549  if (value(first) == l_False){
550  confl = cr;
551  qhead = trail.size();
552  // Copy the remaining watches:
553  while (i < end)
554  *j++ = *i++;
555  }else
556  uncheckedEnqueue(first, cr);
557 
558  NextClause:;
559  }
560  ws.shrink(i - j);
561  }
562  propagations += num_props;
563  simpDB_props -= num_props;
564 
565  return confl;
566 }
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:137
const lbool l_False((uint8_t) 1)
ClauseAllocator ca
Definition: Solver.h:216
void shrink(Size nelems)
Definition: Vec.h:65
const CRef CRef_Undef
Definition: SolverTypes.h:225
Size size(void) const
Definition: Vec.h:64
uint64_t propagations
Definition: Solver.h:151
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488
vec< Lit > trail
Definition: Solver.h:192
int64_t simpDB_props
Definition: Solver.h:212
OccLists< Lit, vec< Watcher >, WatcherDeleted, MkIndexLit > watches
Definition: Solver.h:203

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CRef Minisat::Solver::reason ( Var  x) const
inlineprotectedinherited

Definition at line 303 of file Solver.h.

303 { return vardata[x].reason; }
VMap< VarData > vardata
Definition: Solver.h:201

+ Here is the caller graph for this function:

void Solver::rebuildOrderHeap ( )
protectedinherited

Definition at line 625 of file Solver.cc.

626 {
627  vec<Var> vs;
628  for (Var v = 0; v < nVars(); v++)
629  if (decision[v] && value(v) == l_Undef)
630  vs.push(v);
631  order_heap.build(vs);
632 }
const lbool l_Undef((uint8_t) 2)
int nVars() const
Definition: Solver.h:357
void push(void)
Definition: Vec.h:74
Heap< Var, VarOrderLt > order_heap
Definition: Solver.h:205
lbool value(Var x) const
Definition: Solver.h:350
int Var
Definition: SolverTypes.h:43
VMap< char > decision
Definition: Solver.h:200

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::reduceDB ( )
protectedinherited

Definition at line 583 of file Solver.cc.

584 {
585  int i, j;
586  double extra_lim = cla_inc / learnts.size(); // Remove any clause below this activity
587 
589  // Don't delete binary or locked clauses. From the rest, delete clauses from the first half
590  // and clauses with activity smaller than 'extra_lim':
591  for (i = j = 0; i < learnts.size(); i++){
592  Clause& c = ca[learnts[i]];
593  if (c.size() > 2 && !locked(c) && (i < learnts.size() / 2 || c.activity() < extra_lim))
594  removeClause(learnts[i]);
595  else
596  learnts[j++] = learnts[i];
597  }
598  learnts.shrink(i - j);
599  checkGarbage();
600 }
bool locked(const Clause &c) const
Definition: Solver.h:345
ClauseAllocator ca
Definition: Solver.h:216
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:57
double cla_inc
Definition: Solver.h:208
float & activity()
Definition: SolverTypes.h:214
void checkGarbage()
Definition: Solver.h:330
Size size(void) const
Definition: Vec.h:64
void removeClause(CRef cr)
Definition: Solver.cc:214
vec< CRef > learnts
Definition: Solver.h:191

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SimpSolver::releaseVar ( Lit  l)

Definition at line 95 of file SimpSolver.cc.

96 {
97  assert(!isEliminated(var(l)));
98  if (!use_simplification && var(l) >= max_simp_var)
99  // Note: Guarantees that no references to this variable is
100  // left in model extension datastructure. Could be improved!
102  else
103  // Otherwise, don't allow variable to be reused.
105 }
int var(Lit p)
Definition: SolverTypes.h:67
bool addClause(const vec< Lit > &ps)
Definition: Solver.h:337
void releaseVar(Lit l)
Definition: Solver.cc:147
bool isEliminated(Var v) const
Definition: SimpSolver.h:178

+ Here is the call graph for this function:

void SimpSolver::relocAll ( ClauseAllocator to)
protected

Definition at line 686 of file SimpSolver.cc.

687 {
688  if (!use_simplification) return;
689 
690  // All occurs lists:
691  //
692  for (int i = 0; i < nVars(); i++){
693  occurs.clean(i);
694  vec<CRef>& cs = occurs[i];
695  for (int j = 0; j < cs.size(); j++)
696  ca.reloc(cs[j], to);
697  }
698 
699  // Subsumption queue:
700  //
701  for (int i = subsumption_queue.size(); i > 0; i--){
703  if (ca[cr].mark()) continue;
704  ca.reloc(cr, to);
706  }
707 
708  // Temporary clause:
709  //
710  ca.reloc(bwdsub_tmpunit, to);
711 }
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:137
ClauseAllocator ca
Definition: Solver.h:216
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
int size() const
Definition: Queue.h:42
void pop()
Definition: Queue.h:48
void insert(T elem)
Definition: Queue.h:49
int nVars() const
Definition: Solver.h:357
Size size(void) const
Definition: Vec.h:64
void reloc(CRef &cr, ClauseAllocator &to)
Definition: SolverTypes.h:279
T peek() const
Definition: Queue.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SimpSolver::removeClause ( CRef  cr)
protected

Definition at line 190 of file SimpSolver.cc.

191 {
192  const Clause& c = ca[cr];
193 
194  if (use_simplification)
195  for (int i = 0; i < c.size(); i++){
196  n_occ[c[i]]--;
197  updateElimHeap(var(c[i]));
198  occurs.smudge(var(c[i]));
199  }
200 
202 }
ClauseAllocator ca
Definition: Solver.h:216
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
int var(Lit p)
Definition: SolverTypes.h:67
void updateElimHeap(Var v)
Definition: SimpSolver.h:179
void removeClause(CRef cr)
Definition: Solver.cc:214

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::removeSatisfied ( vec< CRef > &  cs)
protectedinherited

Definition at line 603 of file Solver.cc.

604 {
605  int i, j;
606  for (i = j = 0; i < cs.size(); i++){
607  Clause& c = ca[cs[i]];
608  if (satisfied(c))
609  removeClause(cs[i]);
610  else{
611  // Trim clause:
612  assert(value(c[0]) == l_Undef && value(c[1]) == l_Undef);
613  for (int k = 2; k < c.size(); k++)
614  if (value(c[k]) == l_False){
615  c[k--] = c[c.size()-1];
616  c.pop();
617  }
618  cs[j++] = cs[i];
619  }
620  }
621  cs.shrink(i - j);
622 }
const lbool l_False((uint8_t) 1)
ClauseAllocator ca
Definition: Solver.h:216
const lbool l_Undef((uint8_t) 2)
Size size(void) const
Definition: Vec.h:64
void removeClause(CRef cr)
Definition: Solver.cc:214
lbool value(Var x) const
Definition: Solver.h:350
bool satisfied(const Clause &c) const
Definition: Solver.cc:224

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Solver::satisfied ( const Clause c) const
protectedinherited

Definition at line 224 of file Solver.cc.

224  {
225  for (int i = 0; i < c.size(); i++)
226  if (value(c[i]) == l_True)
227  return true;
228  return false; }
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lbool Solver::search ( int  nof_conflicts)
protectedinherited

Definition at line 704 of file Solver.cc.

705 {
706  assert(ok);
707  int backtrack_level;
708  int conflictC = 0;
709  vec<Lit> learnt_clause;
710  starts++;
711 
712  for (;;){
713  CRef confl = propagate();
714  if (confl != CRef_Undef){
715  // CONFLICT
716  conflicts++; conflictC++;
717  if (decisionLevel() == 0) return l_False;
718 
719  learnt_clause.clear();
720  analyze(confl, learnt_clause, backtrack_level);
721  cancelUntil(backtrack_level);
722 
723  if (learnt_clause.size() == 1){
724  uncheckedEnqueue(learnt_clause[0]);
725  }else{
726  CRef cr = ca.alloc(learnt_clause, true);
727  learnts.push(cr);
728  attachClause(cr);
729  claBumpActivity(ca[cr]);
730  uncheckedEnqueue(learnt_clause[0], cr);
731  }
732 
735 
736  if (--learntsize_adjust_cnt == 0){
740 
741  if (verbosity >= 1)
742  printf("| %9d | %7d %8d %8d | %8d %8d %6.0f | %6.3f %% |\n",
743  (int)conflicts,
744  (int)dec_vars - (trail_lim.size() == 0 ? trail.size() : trail_lim[0]), nClauses(), (int)clauses_literals,
746  }
747 
748  }else{
749  // NO CONFLICT
750  if ((nof_conflicts >= 0 && conflictC >= nof_conflicts) || !withinBudget()){
751  // Reached bound on number of conflicts:
753  cancelUntil(0);
754  return l_Undef; }
755 
756  // Simplify the set of problem clauses:
757  if (decisionLevel() == 0 && !simplify())
758  return l_False;
759 
760  if (learnts.size()-nAssigns() >= max_learnts)
761  // Reduce the set of learnt clauses:
762  reduceDB();
763 
764  Lit next = lit_Undef;
765  while (decisionLevel() < assumptions.size()){
766  // Perform user provided assumption:
768  if (value(p) == l_True){
769  // Dummy decision level:
771  }else if (value(p) == l_False){
772  analyzeFinal(~p, conflict);
773  return l_False;
774  }else{
775  next = p;
776  break;
777  }
778  }
779 
780  if (next == lit_Undef){
781  // New variable decision:
782  decisions++;
783  next = pickBranchLit();
784 
785  if (next == lit_Undef)
786  // Model found:
787  return l_True;
788  }
789 
790  // Increase decision level and enqueue 'next'
792  uncheckedEnqueue(next);
793  }
794  }
795 }
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:137
double learntsize_inc
Definition: Solver.h:144
LSet conflict
Definition: Solver.h:123
void reduceDB()
Definition: Solver.cc:583
const lbool l_False((uint8_t) 1)
ClauseAllocator ca
Definition: Solver.h:216
int learntsize_adjust_cnt
Definition: Solver.h:231
bool simplify()
Definition: Solver.cc:643
double learntsize_adjust_inc
Definition: Solver.h:147
bool withinBudget() const
Definition: Solver.h:374
double max_learnts
Definition: Solver.h:229
void claDecayActivity()
Definition: Solver.h:322
void claBumpActivity(Clause &c)
Definition: Solver.h:323
void newDecisionLevel()
Definition: Solver.h:346
uint64_t starts
Definition: Solver.h:151
const lbool l_Undef((uint8_t) 2)
void attachClause(CRef cr)
Definition: Solver.cc:186
void cancelUntil(int level)
Definition: Solver.cc:233
uint64_t dec_vars
Definition: Solver.h:152
vec< int > trail_lim
Definition: Solver.h:193
Lit pickBranchLit()
Definition: Solver.cc:251
uint64_t learnts_literals
Definition: Solver.h:152
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
uint64_t decisions
Definition: Solver.h:151
vec< Lit > assumptions
Definition: Solver.h:194
double progress_estimate
Definition: Solver.h:213
void push(void)
Definition: Vec.h:74
int nAssigns() const
Definition: Solver.h:354
Size size(void) const
Definition: Vec.h:64
uint64_t clauses_literals
Definition: Solver.h:152
int nClauses() const
Definition: Solver.h:355
void analyzeFinal(Lit p, LSet &out_conflict)
Definition: Solver.cc:458
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
void varDecayActivity()
Definition: Solver.h:309
void clear(bool dealloc=false)
Definition: Vec.h:125
CRef alloc(const vec< Lit > &ps, bool learnt=false)
Definition: SolverTypes.h:245
vec< CRef > learnts
Definition: Solver.h:191
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cc:488
const Lit lit_Undef
Definition: SolverTypes.h:77
void analyze(CRef confl, vec< Lit > &out_learnt, int &out_btlevel)
Definition: Solver.cc:298
vec< Lit > trail
Definition: Solver.h:192
int nLearnts() const
Definition: Solver.h:356
double progressEstimate() const
Definition: Solver.cc:798
CRef propagate()
Definition: Solver.cc:508
uint64_t conflicts
Definition: Solver.h:151
double learntsize_adjust_confl
Definition: Solver.h:230

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::setConfBudget ( int64_t  x)
inlineinherited

Definition at line 369 of file Solver.h.

369 { conflict_budget = conflicts + x; }
int64_t conflict_budget
Definition: Solver.h:235
uint64_t conflicts
Definition: Solver.h:151
void Minisat::Solver::setDecisionVar ( Var  v,
bool  b 
)
inlineinherited

Definition at line 361 of file Solver.h.

362 {
363  if ( b && !decision[v]) dec_vars++;
364  else if (!b && decision[v]) dec_vars--;
365 
366  decision[v] = b;
367  insertVarOrder(v);
368 }
void insertVarOrder(Var x)
Definition: Solver.h:306
uint64_t dec_vars
Definition: Solver.h:152
VMap< char > decision
Definition: Solver.h:200

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::SimpSolver::setFrozen ( Var  v,
bool  b 
)
inline

Definition at line 192 of file SimpSolver.h.

192 { frozen[v] = (char)b; if (use_simplification && !b) { updateElimHeap(v); } }
void updateElimHeap(Var v)
Definition: SimpSolver.h:179
VMap< char > frozen
Definition: SimpSolver.h:144

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::setPolarity ( Var  v,
lbool  b 
)
inlineinherited

Definition at line 360 of file Solver.h.

360 { user_pol[v] = b; }
VMap< lbool > user_pol
Definition: Solver.h:199
void Minisat::Solver::setPropBudget ( int64_t  x)
inlineinherited

Definition at line 370 of file Solver.h.

int64_t propagation_budget
Definition: Solver.h:236
uint64_t propagations
Definition: Solver.h:151
bool Solver::simplify ( )
inherited

Definition at line 643 of file Solver.cc.

644 {
645  assert(decisionLevel() == 0);
646 
647  if (!ok || propagate() != CRef_Undef)
648  return ok = false;
649 
650  if (nAssigns() == simpDB_assigns || (simpDB_props > 0))
651  return true;
652 
653  // Remove satisfied clauses:
655  if (remove_satisfied){ // Can be turned off.
657 
658  // TODO: what todo in if 'remove_satisfied' is false?
659 
660  // Remove all released variables from the trail:
661  for (int i = 0; i < released_vars.size(); i++){
662  assert(seen[released_vars[i]] == 0);
663  seen[released_vars[i]] = 1;
664  }
665 
666  int i, j;
667  for (i = j = 0; i < trail.size(); i++)
668  if (seen[var(trail[i])] == 0)
669  trail[j++] = trail[i];
670  trail.shrink(i - j);
671  //printf("trail.size()= %d, qhead = %d\n", trail.size(), qhead);
672  qhead = trail.size();
673 
674  for (int i = 0; i < released_vars.size(); i++)
675  seen[released_vars[i]] = 0;
676 
677  // Released variables are now ready to be reused:
680  }
681  checkGarbage();
683 
685  simpDB_props = clauses_literals + learnts_literals; // (shouldn't depend on stats really, but it will do for now)
686 
687  return true;
688 }
static void append(const vec< T > &from, vec< T > &to)
Definition: Alg.h:79
void shrink(Size nelems)
Definition: Vec.h:65
int var(Lit p)
Definition: SolverTypes.h:67
vec< Var > free_vars
Definition: Solver.h:219
void removeSatisfied(vec< CRef > &cs)
Definition: Solver.cc:603
uint64_t learnts_literals
Definition: Solver.h:152
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
void checkGarbage()
Definition: Solver.h:330
vec< CRef > clauses
Definition: Solver.h:190
void rebuildOrderHeap()
Definition: Solver.cc:625
int nAssigns() const
Definition: Solver.h:354
Size size(void) const
Definition: Vec.h:64
uint64_t clauses_literals
Definition: Solver.h:152
void clear(bool dealloc=false)
Definition: Vec.h:125
int simpDB_assigns
Definition: Solver.h:211
VMap< char > seen
Definition: Solver.h:224
vec< CRef > learnts
Definition: Solver.h:191
vec< Lit > trail
Definition: Solver.h:192
vec< Var > released_vars
Definition: Solver.h:218
int64_t simpDB_props
Definition: Solver.h:212
CRef propagate()
Definition: Solver.cc:508
bool remove_satisfied
Definition: Solver.h:214

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::Solver::solve ( const vec< Lit > &  assumps)
inlineinherited

Definition at line 386 of file Solver.h.

386 { budgetOff(); assumps.copyTo(assumptions); return solve_() == l_True; }
void budgetOff()
Definition: Solver.h:373
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
vec< Lit > assumptions
Definition: Solver.h:194
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841

+ Here is the call graph for this function:

bool Minisat::Solver::solve ( )
inlineinherited

Definition at line 382 of file Solver.h.

382 { budgetOff(); assumptions.clear(); return solve_() == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::Solver::solve ( Lit  p)
inlineinherited

Definition at line 383 of file Solver.h.

383 { budgetOff(); assumptions.clear(); assumptions.push(p); return solve_() == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::SimpSolver::solve ( const vec< Lit > &  assumps,
bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 213 of file SimpSolver.h.

213  {
214  budgetOff(); assumps.copyTo(assumptions); return solve_(do_simp, turn_off_simp) == l_True; }
void budgetOff()
Definition: Solver.h:373
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
vec< Lit > assumptions
Definition: Solver.h:194
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Minisat::Solver::solve ( Lit  p,
Lit  q 
)
inlineinherited

Definition at line 384 of file Solver.h.

384 { budgetOff(); assumptions.clear(); assumptions.push(p); assumptions.push(q); return solve_() == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::Solver::solve ( Lit  p,
Lit  q,
Lit  r 
)
inlineinherited

Definition at line 385 of file Solver.h.

void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::SimpSolver::solve ( bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 209 of file SimpSolver.h.

209 { budgetOff(); assumptions.clear(); return solve_(do_simp, turn_off_simp) == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::SimpSolver::solve ( Lit  p,
bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 210 of file SimpSolver.h.

210 { budgetOff(); assumptions.clear(); assumptions.push(p); return solve_(do_simp, turn_off_simp) == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::SimpSolver::solve ( Lit  p,
Lit  q,
bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 211 of file SimpSolver.h.

211 { budgetOff(); assumptions.clear(); assumptions.push(p); assumptions.push(q); return solve_(do_simp, turn_off_simp) == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

bool Minisat::SimpSolver::solve ( Lit  p,
Lit  q,
Lit  r,
bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 212 of file SimpSolver.h.

212 { budgetOff(); assumptions.clear(); assumptions.push(p); assumptions.push(q); assumptions.push(r); return solve_(do_simp, turn_off_simp) == l_True; }
void budgetOff()
Definition: Solver.h:373
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

lbool SimpSolver::solve_ ( bool  do_simp = true,
bool  turn_off_simp = false 
)
protected

Definition at line 108 of file SimpSolver.cc.

109 {
110  vec<Var> extra_frozen;
111  lbool result = l_True;
112 
113  do_simp &= use_simplification;
114 
115  if (do_simp){
116  // Assumptions must be temporarily frozen to run variable elimination:
117  for (int i = 0; i < assumptions.size(); i++){
118  Var v = var(assumptions[i]);
119 
120  // If an assumption has been eliminated, remember it.
121  assert(!isEliminated(v));
122 
123  if (!frozen[v]){
124  // Freeze and store.
125  setFrozen(v, true);
126  extra_frozen.push(v);
127  } }
128 
129  result = lbool(eliminate(turn_off_simp));
130  }
131 
132  if (result == l_True)
133  result = Solver::solve_();
134  else if (verbosity >= 1)
135  printf("===============================================================================\n");
136 
137  if (result == l_True && extend_model)
138  extendModel();
139 
140  if (do_simp)
141  // Unfreeze the assumptions that were frozen:
142  for (int i = 0; i < extra_frozen.size(); i++)
143  setFrozen(extra_frozen[i], false);
144 
145  return result;
146 }
int var(Lit p)
Definition: SolverTypes.h:67
void setFrozen(Var v, bool b)
Definition: SimpSolver.h:192
vec< Lit > assumptions
Definition: Solver.h:194
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
bool eliminate(bool turn_off_elim=false)
Definition: SimpSolver.cc:597
VMap< char > frozen
Definition: SimpSolver.h:144
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
const lbool l_True((uint8_t) 0)
lbool solve_()
Definition: Solver.cc:841
int Var
Definition: SolverTypes.h:43

+ Here is the call graph for this function:

lbool Solver::solve_ ( )
protectedinherited

Definition at line 841 of file Solver.cc.

842 {
843  model.clear();
844  conflict.clear();
845  if (!ok) return l_False;
846 
847  solves++;
848 
852 
855  lbool status = l_Undef;
856 
857  if (verbosity >= 1){
858  printf("============================[ Search Statistics ]==============================\n");
859  printf("| Conflicts | ORIGINAL | LEARNT | Progress |\n");
860  printf("| | Vars Clauses Literals | Limit Clauses Lit/Cl | |\n");
861  printf("===============================================================================\n");
862  }
863 
864  // Search:
865  int curr_restarts = 0;
866  while (status == l_Undef){
867  double rest_base = luby_restart ? luby(restart_inc, curr_restarts) : pow(restart_inc, curr_restarts);
868  status = search(rest_base * restart_first);
869  if (!withinBudget()) break;
870  curr_restarts++;
871  }
872 
873  if (verbosity >= 1)
874  printf("===============================================================================\n");
875 
876 
877  if (status == l_True){
878  // Extend & copy model:
879  model.growTo(nVars());
880  for (int i = 0; i < nVars(); i++) model[i] = value(i);
881  }else if (status == l_False && conflict.size() == 0)
882  ok = false;
883 
884  cancelUntil(0);
885  return status;
886 }
LSet conflict
Definition: Solver.h:123
const lbool l_False((uint8_t) 1)
int learntsize_adjust_cnt
Definition: Solver.h:231
bool luby_restart
Definition: Solver.h:133
int restart_first
Definition: Solver.h:141
bool withinBudget() const
Definition: Solver.h:374
double max_learnts
Definition: Solver.h:229
double learntsize_factor
Definition: Solver.h:143
int min_learnts_lim
Definition: Solver.h:139
void clear(bool free=false)
Definition: IntMap.h:67
int learntsize_adjust_start_confl
Definition: Solver.h:146
const lbool l_Undef((uint8_t) 2)
lbool search(int nof_conflicts)
Definition: Solver.cc:704
void cancelUntil(int level)
Definition: Solver.cc:233
int nVars() const
Definition: Solver.h:357
static double luby(double y, int x)
Definition: Solver.cc:824
int nClauses() const
Definition: Solver.h:355
vec< lbool > model
Definition: Solver.h:122
const lbool l_True((uint8_t) 0)
lbool value(Var x) const
Definition: Solver.h:350
uint64_t solves
Definition: Solver.h:151
double restart_inc
Definition: Solver.h:142
int size(void) const
Definition: IntMap.h:66
double learntsize_adjust_confl
Definition: Solver.h:230

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lbool Minisat::Solver::solveLimited ( const vec< Lit > &  assumps)
inlineinherited

Definition at line 387 of file Solver.h.

387 { assumps.copyTo(assumptions); return solve_(); }
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
vec< Lit > assumptions
Definition: Solver.h:194
lbool solve_()
Definition: Solver.cc:841

+ Here is the call graph for this function:

lbool Minisat::SimpSolver::solveLimited ( const vec< Lit > &  assumps,
bool  do_simp = true,
bool  turn_off_simp = false 
)
inline

Definition at line 216 of file SimpSolver.h.

216  {
217  assumps.copyTo(assumptions); return solve_(do_simp, turn_off_simp); }
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
vec< Lit > assumptions
Definition: Solver.h:194
lbool solve_()
Definition: Solver.cc:841

+ Here is the call graph for this function:

bool SimpSolver::strengthenClause ( CRef  cr,
Lit  l 
)
protected

Definition at line 205 of file SimpSolver.cc.

206 {
207  Clause& c = ca[cr];
208  assert(decisionLevel() == 0);
209  assert(use_simplification);
210 
211  // FIX: this is too inefficient but would be nice to have (properly implemented)
212  // if (!find(subsumption_queue, &c))
214 
215  if (c.size() == 2){
216  removeClause(cr);
217  c.strengthen(l);
218  }else{
219  detachClause(cr, true);
220  c.strengthen(l);
221  attachClause(cr);
222  remove(occurs[var(l)], cr);
223  n_occ[l]--;
224  updateElimHeap(var(l));
225  }
226 
227  return c.size() == 1 ? enqueue(c[0]) && propagate() == CRef_Undef : true;
228 }
void removeClause(CRef cr)
Definition: SimpSolver.cc:190
ClauseAllocator ca
Definition: Solver.h:216
LMap< int > n_occ
Definition: SimpSolver.h:141
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
int var(Lit p)
Definition: SolverTypes.h:67
void strengthen(Lit p)
Definition: SolverTypes.h:469
Queue< CRef > subsumption_queue
Definition: SimpSolver.h:143
void attachClause(CRef cr)
Definition: Solver.cc:186
void insert(T elem)
Definition: Queue.h:49
void updateElimHeap(Var v)
Definition: SimpSolver.h:179
void detachClause(CRef cr, bool strict=false)
Definition: Solver.cc:196
const CRef CRef_Undef
Definition: SolverTypes.h:225
int decisionLevel() const
Definition: Solver.h:348
bool enqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.h:336
CRef propagate()
Definition: Solver.cc:508

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SimpSolver::substitute ( Var  v,
Lit  x 
)

Definition at line 548 of file SimpSolver.cc.

549 {
550  assert(!frozen[v]);
551  assert(!isEliminated(v));
552  assert(value(v) == l_Undef);
553 
554  if (!ok) return false;
555 
556  eliminated[v] = true;
557  setDecisionVar(v, false);
558  const vec<CRef>& cls = occurs.lookup(v);
559 
560  vec<Lit>& subst_clause = add_tmp;
561  for (int i = 0; i < cls.size(); i++){
562  Clause& c = ca[cls[i]];
563 
564  subst_clause.clear();
565  for (int j = 0; j < c.size(); j++){
566  Lit p = c[j];
567  subst_clause.push(var(p) == v ? x ^ sign(p) : p);
568  }
569 
570  removeClause(cls[i]);
571 
572  if (!addClause_(subst_clause))
573  return ok = false;
574  }
575 
576  return true;
577 }
void removeClause(CRef cr)
Definition: SimpSolver.cc:190
ClauseAllocator ca
Definition: Solver.h:216
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition: SimpSolver.h:140
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
const lbool l_Undef((uint8_t) 2)
void setDecisionVar(Var v, bool b)
Definition: Solver.h:361
VMap< char > eliminated
Definition: SimpSolver.h:146
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
VMap< char > frozen
Definition: SimpSolver.h:144
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
lbool value(Var x) const
Definition: Solver.h:350
void clear(bool dealloc=false)
Definition: Vec.h:125
bool addClause_(vec< Lit > &ps)
Definition: SimpSolver.cc:150
vec< Lit > add_tmp
Definition: Solver.h:227

+ Here is the call graph for this function:

void Minisat::SimpSolver::thaw ( )
inline

Definition at line 200 of file SimpSolver.h.

200  {
201  for (int i = 0; i < frozen_vars.size(); i++){
202  Var v = frozen_vars[i];
203  frozen[v] = 0;
204  if (use_simplification)
205  updateElimHeap(v);
206  }
207  frozen_vars.clear(); }
void updateElimHeap(Var v)
Definition: SimpSolver.h:179
vec< Var > frozen_vars
Definition: SimpSolver.h:145
Size size(void) const
Definition: Vec.h:64
VMap< char > frozen
Definition: SimpSolver.h:144
void clear(bool dealloc=false)
Definition: Vec.h:125
int Var
Definition: SolverTypes.h:43

+ Here is the call graph for this function:

void Solver::toDimacs ( FILE *  f,
const vec< Lit > &  assumps 
)
inherited

Definition at line 951 of file Solver.cc.

952 {
953  // Handle case when solver is in contradictory state:
954  if (!ok){
955  fprintf(f, "p cnf 1 2\n1 0\n-1 0\n");
956  return; }
957 
958  vec<Var> map; Var max = 0;
959 
960  // Cannot use removeClauses here because it is not safe
961  // to deallocate them at this point. Could be improved.
962  int cnt = 0;
963  for (int i = 0; i < clauses.size(); i++)
964  if (!satisfied(ca[clauses[i]]))
965  cnt++;
966 
967  for (int i = 0; i < clauses.size(); i++)
968  if (!satisfied(ca[clauses[i]])){
969  Clause& c = ca[clauses[i]];
970  for (int j = 0; j < c.size(); j++)
971  if (value(c[j]) != l_False)
972  mapVar(var(c[j]), map, max);
973  }
974 
975  // Assumptions are added as unit clauses:
976  cnt += assumps.size();
977 
978  fprintf(f, "p cnf %d %d\n", max, cnt);
979 
980  for (int i = 0; i < assumps.size(); i++){
981  assert(value(assumps[i]) != l_False);
982  fprintf(f, "%s%d 0\n", sign(assumps[i]) ? "-" : "", mapVar(var(assumps[i]), map, max)+1);
983  }
984 
985  for (int i = 0; i < clauses.size(); i++)
986  toDimacs(f, ca[clauses[i]], map, max);
987 
988  if (verbosity > 0)
989  printf("Wrote DIMACS with %d variables and %d clauses.\n", max, cnt);
990 }
const lbool l_False((uint8_t) 1)
ClauseAllocator ca
Definition: Solver.h:216
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
vec< CRef > clauses
Definition: Solver.h:190
Size size(void) const
Definition: Vec.h:64
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951
lbool value(Var x) const
Definition: Solver.h:350
int Var
Definition: SolverTypes.h:43
bool satisfied(const Clause &c) const
Definition: Solver.cc:224
static Var mapVar(Var x, vec< Var > &map, Var &max)
Definition: Solver.cc:920

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Solver::toDimacs ( const char *  file,
const vec< Lit > &  assumps 
)
inherited

Definition at line 941 of file Solver.cc.

942 {
943  FILE* f = fopen(file, "wr");
944  if (f == NULL)
945  fprintf(stderr, "could not open file %s\n", file), exit(1);
946  toDimacs(f, assumps);
947  fclose(f);
948 }
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951
#define NULL

+ Here is the call graph for this function:

void Solver::toDimacs ( FILE *  f,
Clause c,
vec< Var > &  map,
Var max 
)
inherited

Definition at line 930 of file Solver.cc.

931 {
932  if (satisfied(c)) return;
933 
934  for (int i = 0; i < c.size(); i++)
935  if (value(c[i]) != l_False)
936  fprintf(f, "%s%d ", sign(c[i]) ? "-" : "", mapVar(var(c[i]), map, max)+1);
937  fprintf(f, "0\n");
938 }
const lbool l_False((uint8_t) 1)
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
lbool value(Var x) const
Definition: Solver.h:350
bool satisfied(const Clause &c) const
Definition: Solver.cc:224
static Var mapVar(Var x, vec< Var > &map, Var &max)
Definition: Solver.cc:920

+ Here is the call graph for this function:

void Minisat::Solver::toDimacs ( const char *  file)
inlineinherited

Definition at line 396 of file Solver.h.

396 { vec<Lit> as; toDimacs(file, as); }
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951

+ Here is the call graph for this function:

void Minisat::Solver::toDimacs ( const char *  file,
Lit  p 
)
inlineinherited

Definition at line 397 of file Solver.h.

397 { vec<Lit> as; as.push(p); toDimacs(file, as); }
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951

+ Here is the call graph for this function:

void Minisat::Solver::toDimacs ( const char *  file,
Lit  p,
Lit  q 
)
inlineinherited

Definition at line 398 of file Solver.h.

398 { vec<Lit> as; as.push(p); as.push(q); toDimacs(file, as); }
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951

+ Here is the call graph for this function:

void Minisat::Solver::toDimacs ( const char *  file,
Lit  p,
Lit  q,
Lit  r 
)
inlineinherited

Definition at line 399 of file Solver.h.

399 { vec<Lit> as; as.push(p); as.push(q); as.push(r); toDimacs(file, as); }
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cc:951

+ Here is the call graph for this function:

TrailIterator Minisat::Solver::trailBegin ( ) const
inlineinherited

Definition at line 392 of file Solver.h.

392 { return TrailIterator(&trail[0]); }
vec< Lit > trail
Definition: Solver.h:192
TrailIterator Minisat::Solver::trailEnd ( ) const
inlineinherited

Definition at line 393 of file Solver.h.

393  {
394  return TrailIterator(&trail[decisionLevel() == 0 ? trail.size() : trail_lim[0]]); }
vec< int > trail_lim
Definition: Solver.h:193
int decisionLevel() const
Definition: Solver.h:348
Size size(void) const
Definition: Vec.h:64
vec< Lit > trail
Definition: Solver.h:192

+ Here is the call graph for this function:

void Solver::uncheckedEnqueue ( Lit  p,
CRef  from = CRef_Undef 
)
protectedinherited

Definition at line 488 of file Solver.cc.

489 {
490  assert(value(p) == l_Undef);
491  assigns[var(p)] = lbool(!sign(p));
492  vardata[var(p)] = mkVarData(from, decisionLevel());
493  trail.push_(p);
494 }
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
const lbool l_Undef((uint8_t) 2)
int decisionLevel() const
Definition: Solver.h:348
lbool value(Var x) const
Definition: Solver.h:350
VMap< lbool > assigns
Definition: Solver.h:197
void push_(const T &elem)
Definition: Vec.h:77
vec< Lit > trail
Definition: Solver.h:192
VMap< VarData > vardata
Definition: Solver.h:201
static VarData mkVarData(CRef cr, int l)
Definition: Solver.h:159

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::SimpSolver::updateElimHeap ( Var  v)
inlineprotected

Definition at line 179 of file SimpSolver.h.

179  {
180  assert(use_simplification);
181  // if (!frozen[v] && !isEliminated(v) && value(v) == l_Undef)
182  if (elim_heap.inHeap(v) || (!frozen[v] && !isEliminated(v) && value(v) == l_Undef))
183  elim_heap.update(v); }
const lbool l_Undef((uint8_t) 2)
Heap< Var, ElimLt > elim_heap
Definition: SimpSolver.h:142
VMap< char > frozen
Definition: SimpSolver.h:144
bool isEliminated(Var v) const
Definition: SimpSolver.h:178
lbool value(Var x) const
Definition: Solver.h:350

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lbool Minisat::Solver::value ( Var  x) const
inlineinherited

Definition at line 350 of file Solver.h.

350 { return assigns[x]; }
VMap< lbool > assigns
Definition: Solver.h:197

+ Here is the caller graph for this function:

lbool Minisat::Solver::value ( Lit  p) const
inlineinherited

Definition at line 351 of file Solver.h.

351 { return assigns[var(p)] ^ sign(p); }
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66
VMap< lbool > assigns
Definition: Solver.h:197

+ Here is the call graph for this function:

void Minisat::Solver::varBumpActivity ( Var  v,
double  inc 
)
inlineprotectedinherited

Definition at line 311 of file Solver.h.

311  {
312  if ( (activity[v] += inc) > 1e100 ) {
313  // Rescale:
314  for (int i = 0; i < nVars(); i++)
315  activity[i] *= 1e-100;
316  var_inc *= 1e-100; }
317 
318  // Update order_heap with respect to new activity:
319  if (order_heap.inHeap(v))
320  order_heap.decrease(v); }
int nVars() const
Definition: Solver.h:357
Heap< Var, VarOrderLt > order_heap
Definition: Solver.h:205
VMap< double > activity
Definition: Solver.h:196
double var_inc
Definition: Solver.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::Solver::varBumpActivity ( Var  v)
inlineprotectedinherited

Definition at line 310 of file Solver.h.

310 { varBumpActivity(v, var_inc); }
double var_inc
Definition: Solver.h:209
void varBumpActivity(Var v, double inc)
Definition: Solver.h:311

+ Here is the call graph for this function:

void Minisat::Solver::varDecayActivity ( )
inlineprotectedinherited

Definition at line 309 of file Solver.h.

309 { var_inc *= (1 / var_decay); }
double var_decay
Definition: Solver.h:129
double var_inc
Definition: Solver.h:209

+ Here is the caller graph for this function:

bool Minisat::Solver::withinBudget ( ) const
inlineprotectedinherited

Definition at line 374 of file Solver.h.

374  {
375  return !asynch_interrupt &&
376  (conflict_budget < 0 || conflicts < (uint64_t)conflict_budget) &&
377  (propagation_budget < 0 || propagations < (uint64_t)propagation_budget); }
int64_t conflict_budget
Definition: Solver.h:235
bool asynch_interrupt
Definition: Solver.h:237
int64_t propagation_budget
Definition: Solver.h:236
uint64_t propagations
Definition: Solver.h:151
uint64_t conflicts
Definition: Solver.h:151

+ Here is the caller graph for this function:

Field Documentation

VMap<double> Minisat::Solver::activity
protectedinherited

Definition at line 196 of file Solver.h.

vec<Lit> Minisat::Solver::add_tmp
protectedinherited

Definition at line 227 of file Solver.h.

vec<ShrinkStackElem> Minisat::Solver::analyze_stack
protectedinherited

Definition at line 225 of file Solver.h.

vec<Lit> Minisat::Solver::analyze_toclear
protectedinherited

Definition at line 226 of file Solver.h.

VMap<lbool> Minisat::Solver::assigns
protectedinherited

Definition at line 197 of file Solver.h.

vec<Lit> Minisat::Solver::assumptions
protectedinherited

Definition at line 194 of file Solver.h.

int Minisat::SimpSolver::asymm_lits

Definition at line 104 of file SimpSolver.h.

bool Minisat::Solver::asynch_interrupt
protectedinherited

Definition at line 237 of file Solver.h.

int Minisat::SimpSolver::bwdsub_assigns
protected

Definition at line 147 of file SimpSolver.h.

CRef Minisat::SimpSolver::bwdsub_tmpunit
protected

Definition at line 152 of file SimpSolver.h.

ClauseAllocator Minisat::Solver::ca
protectedinherited

Definition at line 216 of file Solver.h.

int Minisat::Solver::ccmin_mode
inherited

Definition at line 134 of file Solver.h.

double Minisat::Solver::cla_inc
protectedinherited

Definition at line 208 of file Solver.h.

double Minisat::Solver::clause_decay
inherited

Definition at line 130 of file Solver.h.

int Minisat::SimpSolver::clause_lim

Definition at line 91 of file SimpSolver.h.

vec<CRef> Minisat::Solver::clauses
protectedinherited

Definition at line 190 of file Solver.h.

uint64_t Minisat::Solver::clauses_literals
inherited

Definition at line 152 of file Solver.h.

LSet Minisat::Solver::conflict
inherited

Definition at line 123 of file Solver.h.

int64_t Minisat::Solver::conflict_budget
protectedinherited

Definition at line 235 of file Solver.h.

uint64_t Minisat::Solver::conflicts
inherited

Definition at line 151 of file Solver.h.

uint64_t Minisat::Solver::dec_vars
inherited

Definition at line 152 of file Solver.h.

VMap<char> Minisat::Solver::decision
protectedinherited

Definition at line 200 of file Solver.h.

uint64_t Minisat::Solver::decisions
inherited

Definition at line 151 of file Solver.h.

Heap<Var,ElimLt> Minisat::SimpSolver::elim_heap
protected

Definition at line 142 of file SimpSolver.h.

vec<uint32_t> Minisat::SimpSolver::elimclauses
protected

Definition at line 137 of file SimpSolver.h.

VMap<char> Minisat::SimpSolver::eliminated
protected

Definition at line 146 of file SimpSolver.h.

int Minisat::SimpSolver::eliminated_vars

Definition at line 105 of file SimpSolver.h.

int Minisat::SimpSolver::elimorder
protected

Definition at line 134 of file SimpSolver.h.

bool Minisat::SimpSolver::extend_model

Definition at line 99 of file SimpSolver.h.

vec<Var> Minisat::Solver::free_vars
protectedinherited

Definition at line 219 of file Solver.h.

VMap<char> Minisat::SimpSolver::frozen
protected

Definition at line 144 of file SimpSolver.h.

vec<Var> Minisat::SimpSolver::frozen_vars
protected

Definition at line 145 of file SimpSolver.h.

double Minisat::Solver::garbage_frac
inherited

Definition at line 138 of file Solver.h.

int Minisat::SimpSolver::grow

Definition at line 90 of file SimpSolver.h.

vec<CRef> Minisat::Solver::learnts
protectedinherited

Definition at line 191 of file Solver.h.

uint64_t Minisat::Solver::learnts_literals
inherited

Definition at line 152 of file Solver.h.

int Minisat::Solver::learntsize_adjust_cnt
protectedinherited

Definition at line 231 of file Solver.h.

double Minisat::Solver::learntsize_adjust_confl
protectedinherited

Definition at line 230 of file Solver.h.

double Minisat::Solver::learntsize_adjust_inc
inherited

Definition at line 147 of file Solver.h.

int Minisat::Solver::learntsize_adjust_start_confl
inherited

Definition at line 146 of file Solver.h.

double Minisat::Solver::learntsize_factor
inherited

Definition at line 143 of file Solver.h.

double Minisat::Solver::learntsize_inc
inherited

Definition at line 144 of file Solver.h.

bool Minisat::Solver::luby_restart
inherited

Definition at line 133 of file Solver.h.

double Minisat::Solver::max_learnts
protectedinherited

Definition at line 229 of file Solver.h.

uint64_t Minisat::Solver::max_literals
inherited

Definition at line 152 of file Solver.h.

Var Minisat::SimpSolver::max_simp_var
protected

Definition at line 136 of file SimpSolver.h.

int Minisat::SimpSolver::merges

Definition at line 103 of file SimpSolver.h.

int Minisat::Solver::min_learnts_lim
inherited

Definition at line 139 of file Solver.h.

vec<lbool> Minisat::Solver::model
inherited

Definition at line 122 of file Solver.h.

LMap<int> Minisat::SimpSolver::n_occ
protected

Definition at line 141 of file SimpSolver.h.

int Minisat::SimpSolver::n_touched
protected

Definition at line 148 of file SimpSolver.h.

Var Minisat::Solver::next_var
protectedinherited

Definition at line 215 of file Solver.h.

uint64_t Minisat::Solver::num_clauses
inherited

Definition at line 152 of file Solver.h.

uint64_t Minisat::Solver::num_learnts
inherited

Definition at line 152 of file Solver.h.

OccLists<Var, vec<CRef>, ClauseDeleted> Minisat::SimpSolver::occurs
protected

Definition at line 140 of file SimpSolver.h.

bool Minisat::Solver::ok
protectedinherited

Definition at line 207 of file Solver.h.

Heap<Var,VarOrderLt> Minisat::Solver::order_heap
protectedinherited

Definition at line 205 of file Solver.h.

int Minisat::Solver::phase_saving
inherited

Definition at line 135 of file Solver.h.

VMap<char> Minisat::Solver::polarity
protectedinherited

Definition at line 198 of file Solver.h.

double Minisat::Solver::progress_estimate
protectedinherited

Definition at line 213 of file Solver.h.

int64_t Minisat::Solver::propagation_budget
protectedinherited

Definition at line 236 of file Solver.h.

uint64_t Minisat::Solver::propagations
inherited

Definition at line 151 of file Solver.h.

int Minisat::Solver::qhead
protectedinherited

Definition at line 210 of file Solver.h.

double Minisat::Solver::random_seed
inherited

Definition at line 132 of file Solver.h.

double Minisat::Solver::random_var_freq
inherited

Definition at line 131 of file Solver.h.

vec<Var> Minisat::Solver::released_vars
protectedinherited

Definition at line 218 of file Solver.h.

bool Minisat::Solver::remove_satisfied
protectedinherited

Definition at line 214 of file Solver.h.

int Minisat::Solver::restart_first
inherited

Definition at line 141 of file Solver.h.

double Minisat::Solver::restart_inc
inherited

Definition at line 142 of file Solver.h.

uint64_t Minisat::Solver::rnd_decisions
inherited

Definition at line 151 of file Solver.h.

bool Minisat::Solver::rnd_init_act
inherited

Definition at line 137 of file Solver.h.

bool Minisat::Solver::rnd_pol
inherited

Definition at line 136 of file Solver.h.

VMap<char> Minisat::Solver::seen
protectedinherited

Definition at line 224 of file Solver.h.

double Minisat::SimpSolver::simp_garbage_frac

Definition at line 94 of file SimpSolver.h.

int Minisat::Solver::simpDB_assigns
protectedinherited

Definition at line 211 of file Solver.h.

int64_t Minisat::Solver::simpDB_props
protectedinherited

Definition at line 212 of file Solver.h.

uint64_t Minisat::Solver::solves
inherited

Definition at line 151 of file Solver.h.

uint64_t Minisat::Solver::starts
inherited

Definition at line 151 of file Solver.h.

int Minisat::SimpSolver::subsumption_lim

Definition at line 93 of file SimpSolver.h.

Queue<CRef> Minisat::SimpSolver::subsumption_queue
protected

Definition at line 143 of file SimpSolver.h.

uint64_t Minisat::Solver::tot_literals
inherited

Definition at line 152 of file Solver.h.

VMap<char> Minisat::SimpSolver::touched
protected

Definition at line 138 of file SimpSolver.h.

vec<Lit> Minisat::Solver::trail
protectedinherited

Definition at line 192 of file Solver.h.

vec<int> Minisat::Solver::trail_lim
protectedinherited

Definition at line 193 of file Solver.h.

bool Minisat::SimpSolver::use_asymm

Definition at line 96 of file SimpSolver.h.

bool Minisat::SimpSolver::use_elim

Definition at line 98 of file SimpSolver.h.

bool Minisat::SimpSolver::use_rcheck

Definition at line 97 of file SimpSolver.h.

bool Minisat::SimpSolver::use_simplification
protected

Definition at line 135 of file SimpSolver.h.

VMap<lbool> Minisat::Solver::user_pol
protectedinherited

Definition at line 199 of file Solver.h.

double Minisat::Solver::var_decay
inherited

Definition at line 129 of file Solver.h.

double Minisat::Solver::var_inc
protectedinherited

Definition at line 209 of file Solver.h.

VMap<VarData> Minisat::Solver::vardata
protectedinherited

Definition at line 201 of file Solver.h.

int Minisat::Solver::verbosity
inherited

Definition at line 128 of file Solver.h.

OccLists<Lit, vec<Watcher>, WatcherDeleted, MkIndexLit> Minisat::Solver::watches
protectedinherited

Definition at line 203 of file Solver.h.


The documentation for this class was generated from the following files: