abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Solver.h
Go to the documentation of this file.
1 /****************************************************************************************[Solver.h]
2 Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
3 Copyright (c) 2007-2010, Niklas Sorensson
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6 associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute,
8 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in all copies or
12 substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
15 NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
18 OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 **************************************************************************************************/
20 
21 #ifndef Minisat_Solver_h
22 #define Minisat_Solver_h
23 
24 #include "Vec.h"
25 #include "Heap.h"
26 #include "Alg.h"
27 #include "Options.h"
28 #include "SolverTypes.h"
29 
30 
31 namespace Minisat {
32 
33 //=================================================================================================
34 // Solver -- the main class:
35 
36 class Solver {
37 public:
38 
39  // Constructor/Destructor:
40  //
41  Solver();
42  virtual ~Solver();
43 
44  // Problem specification:
45  //
46  Var newVar (bool polarity = true, bool dvar = true); // Add a new variable with parameters specifying variable mode.
47 
48  bool addClause (const vec<Lit>& ps); // Add a clause to the solver.
49  bool addEmptyClause(); // Add the empty clause, making the solver contradictory.
50  bool addClause (Lit p); // Add a unit clause to the solver.
51  bool addClause (Lit p, Lit q); // Add a binary clause to the solver.
52  bool addClause (Lit p, Lit q, Lit r); // Add a ternary clause to the solver.
53  bool addClause_( vec<Lit>& ps); // Add a clause to the solver without making superflous internal copy. Will
54  // change the passed vector 'ps'.
55 
56  // Solving:
57  //
58  bool simplify (); // Removes already satisfied clauses.
59  bool solve (const vec<Lit>& assumps); // Search for a model that respects a given set of assumptions.
60  lbool solveLimited (const vec<Lit>& assumps); // Search for a model that respects a given set of assumptions (With resource constraints).
61  bool solve (); // Search without assumptions.
62  bool solve (Lit p); // Search for a model that respects a single assumption.
63  bool solve (Lit p, Lit q); // Search for a model that respects two assumptions.
64  bool solve (Lit p, Lit q, Lit r); // Search for a model that respects three assumptions.
65  bool okay () const; // FALSE means solver is in a conflicting state
66 
67  void toDimacs (FILE* f, const vec<Lit>& assumps); // Write CNF to file in DIMACS-format.
68  void toDimacs (const char *file, const vec<Lit>& assumps);
69  void toDimacs (FILE* f, Clause& c, vec<Var>& map, Var& max);
70 
71  // Convenience versions of 'toDimacs()':
72  void toDimacs (const char* file);
73  void toDimacs (const char* file, Lit p);
74  void toDimacs (const char* file, Lit p, Lit q);
75  void toDimacs (const char* file, Lit p, Lit q, Lit r);
76 
77  // Variable mode:
78  //
79  void setPolarity (Var v, bool b); // Declare which polarity the decision heuristic should use for a variable. Requires mode 'polarity_user'.
80  void setDecisionVar (Var v, bool b); // Declare if a variable should be eligible for selection in the decision heuristic.
81 
82  // Read state:
83  //
84  lbool value (Var x) const; // The current value of a variable.
85  lbool value (Lit p) const; // The current value of a literal.
86  lbool modelValue (Var x) const; // The value of a variable in the last model. The last call to solve must have been satisfiable.
87  lbool modelValue (Lit p) const; // The value of a literal in the last model. The last call to solve must have been satisfiable.
88  int nAssigns () const; // The current number of assigned literals.
89  int nClauses () const; // The current number of original clauses.
90  int nLearnts () const; // The current number of learnt clauses.
91  int nVars () const; // The current number of variables.
92  int nFreeVars () const;
93 
94  // Resource contraints:
95  //
96  void setConfBudget(int64_t x);
97  void setPropBudget(int64_t x);
98  void budgetOff();
99  void interrupt(); // Trigger a (potentially asynchronous) interruption of the solver.
100  void clearInterrupt(); // Clear interrupt indicator flag.
101 
102  // Memory managment:
103  //
104  virtual void garbageCollect();
105  void checkGarbage(double gf);
106  void checkGarbage();
107 
108  // Extra results: (read-only member variable)
109  //
110  vec<lbool> model; // If problem is satisfiable, this vector contains the model (if any).
111  vec<Lit> conflict; // If problem is unsatisfiable (possibly under assumptions),
112  // this vector represent the final conflict clause expressed in the assumptions.
113 
114  // Mode of operation:
115  //
117  double var_decay;
118  double clause_decay;
120  double random_seed;
122  int ccmin_mode; // Controls conflict clause minimization (0=none, 1=basic, 2=deep).
123  int phase_saving; // Controls the level of phase saving (0=none, 1=limited, 2=full).
124  bool rnd_pol; // Use random polarities for branching heuristics.
125  bool rnd_init_act; // Initialize variable activities with a small random value.
126  double garbage_frac; // The fraction of wasted memory allowed before a garbage collection is triggered.
127 
128  int restart_first; // The initial restart limit. (default 100)
129  double restart_inc; // The factor with which the restart limit is multiplied in each restart. (default 1.5)
130  double learntsize_factor; // The intitial limit for learnt clauses is a factor of the original clauses. (default 1 / 3)
131  double learntsize_inc; // The limit for learnt clauses is multiplied with this factor each restart. (default 1.1)
132 
135 
136  // Statistics: (read-only member variable)
137  //
140 
141 protected:
142 
143  // Helper structures:
144  //
145  struct VarData { CRef reason; int level; };
146  static inline VarData mkVarData(CRef cr, int l){ VarData d = {cr, l}; return d; }
147 
148  struct Watcher {
151  Watcher(CRef cr, Lit p) : cref(cr), blocker(p) {}
152  bool operator==(const Watcher& w) const { return cref == w.cref; }
153  bool operator!=(const Watcher& w) const { return cref != w.cref; }
154  };
155 
157  {
159  WatcherDeleted(const ClauseAllocator& _ca) : ca(_ca) {}
160  bool operator()(const Watcher& w) const { return ca[w.cref].mark() == 1; }
161  };
162 
163  struct VarOrderLt {
165  bool operator () (Var x, Var y) const { return activity[x] > activity[y]; }
166  VarOrderLt(const vec<double>& act) : activity(act) { }
167  };
168 
169  // Solver state:
170  //
171  bool ok; // If FALSE, the constraints are already unsatisfiable. No part of the solver state may be used!
172  vec<CRef> clauses; // List of problem clauses.
173  vec<CRef> learnts; // List of learnt clauses.
174  double cla_inc; // Amount to bump next clause with.
175  vec<double> activity; // A heuristic measurement of the activity of a variable.
176  double var_inc; // Amount to bump next variable with.
178  watches; // 'watches[lit]' is a list of constraints watching 'lit' (will go there if literal becomes true).
179  vec<lbool> assigns; // The current assignments.
180  vec<char> polarity; // The preferred polarity of each variable.
181  vec<char> decision; // Declares if a variable is eligible for selection in the decision heuristic.
182  vec<Lit> trail; // Assignment stack; stores all assigments made in the order they were made.
183  vec<int> trail_lim; // Separator indices for different decision levels in 'trail'.
184  vec<VarData> vardata; // Stores reason and level for each variable.
185  int qhead; // Head of queue (as index into the trail -- no more explicit propagation queue in MiniSat).
186  int simpDB_assigns; // Number of top-level assignments since last execution of 'simplify()'.
187  int64_t simpDB_props; // Remaining number of propagations that must be made before next execution of 'simplify()'.
188  vec<Lit> assumptions; // Current set of assumptions provided to solve by the user.
189  Heap<VarOrderLt> order_heap; // A priority queue of variables ordered with respect to the variable activity.
190  double progress_estimate;// Set by 'search()'.
191  bool remove_satisfied; // Indicates whether possibly inefficient linear scan for satisfied clauses should be performed in 'simplify'.
192 
194 
195  // Temporaries (to reduce allocation overhead). Each variable is prefixed by the method in which it is
196  // used, exept 'seen' wich is used in several places.
197  //
202 
203  double max_learnts;
206 
207  // Resource contraints:
208  //
209  int64_t conflict_budget; // -1 means no budget.
210  int64_t propagation_budget; // -1 means no budget.
212 
213  // Main internal methods:
214  //
215  void insertVarOrder (Var x); // Insert a variable in the decision order priority queue.
216  Lit pickBranchLit (); // Return the next decision variable.
217  void newDecisionLevel (); // Begins a new decision level.
218  void uncheckedEnqueue (Lit p, CRef from = CRef_Undef); // Enqueue a literal. Assumes value of literal is undefined.
219  bool enqueue (Lit p, CRef from = CRef_Undef); // Test if fact 'p' contradicts current state, enqueue otherwise.
220  CRef propagate (); // Perform unit propagation. Returns possibly conflicting clause.
221  void cancelUntil (int level); // Backtrack until a certain level.
222  void analyze (CRef confl, vec<Lit>& out_learnt, int& out_btlevel); // (bt = backtrack)
223  void analyzeFinal (Lit p, vec<Lit>& out_conflict); // COULD THIS BE IMPLEMENTED BY THE ORDINARIY "analyze" BY SOME REASONABLE GENERALIZATION?
224  bool litRedundant (Lit p, uint32_t abstract_levels); // (helper method for 'analyze()')
225  lbool search (int nof_conflicts); // Search for a given number of conflicts.
226  lbool solve_ (); // Main solve method (assumptions given in 'assumptions').
227  void reduceDB (); // Reduce the set of learnt clauses.
228  void removeSatisfied (vec<CRef>& cs); // Shrink 'cs' to contain only non-satisfied clauses.
229  void rebuildOrderHeap ();
230 
231  // Maintaining Variable/Clause activity:
232  //
233  void varDecayActivity (); // Decay all variables with the specified factor. Implemented by increasing the 'bump' value instead.
234  void varBumpActivity (Var v, double inc); // Increase a variable with the current 'bump' value.
235  void varBumpActivity (Var v); // Increase a variable with the current 'bump' value.
236  void claDecayActivity (); // Decay all clauses with the specified factor. Implemented by increasing the 'bump' value instead.
237  void claBumpActivity (Clause& c); // Increase a clause with the current 'bump' value.
238 
239  // Operations on clauses:
240  //
241  void attachClause (CRef cr); // Attach a clause to watcher lists.
242  void detachClause (CRef cr, bool strict = false); // Detach a clause to watcher lists.
243  void removeClause (CRef cr); // Detach and free a clause.
244  bool locked (const Clause& c) const; // Returns TRUE if a clause is a reason for some implication in the current state.
245  bool satisfied (const Clause& c) const; // Returns TRUE if a clause is satisfied in the current state.
246 
247  void relocAll (ClauseAllocator& to);
248 
249  // Misc:
250  //
251  int decisionLevel () const; // Gives the current decisionlevel.
252  uint32_t abstractLevel (Var x) const; // Used to represent an abstraction of sets of decision levels.
253  CRef reason (Var x) const;
254  int level (Var x) const;
255  double progressEstimate () const; // DELETE THIS ?? IT'S NOT VERY USEFUL ...
256  bool withinBudget () const;
257 
258  // Static helpers:
259  //
260 
261  // Returns a random float 0 <= x < 1. Seed must never be 0.
262  static inline double drand(double& seed) {
263  seed *= 1389796;
264  int q = (int)(seed / 2147483647);
265  seed -= (double)q * 2147483647;
266  return seed / 2147483647; }
267 
268  // Returns a random integer 0 <= x < size. Seed must never be 0.
269  static inline int irand(double& seed, int size) {
270  return (int)(drand(seed) * size); }
271 };
272 
273 
274 //=================================================================================================
275 // Implementation of inline methods:
276 
277 inline CRef Solver::reason(Var x) const { return vardata[x].reason; }
278 inline int Solver::level (Var x) const { return vardata[x].level; }
279 
280 inline void Solver::insertVarOrder(Var x) {
281  if (!order_heap.inHeap(x) && decision[x]) order_heap.insert(x); }
282 
283 inline void Solver::varDecayActivity() { var_inc *= (1 / var_decay); }
285 inline void Solver::varBumpActivity(Var v, double inc) {
286  if ( (activity[v] += inc) > 1e100 ) {
287  // Rescale:
288  for (int i = 0; i < nVars(); i++)
289  activity[i] *= 1e-100;
290  var_inc *= 1e-100; }
291 
292  // Update order_heap with respect to new activity:
293  if (order_heap.inHeap(v))
294  order_heap.decrease(v); }
295 
296 inline void Solver::claDecayActivity() { cla_inc *= (1 / clause_decay); }
297 inline void Solver::claBumpActivity (Clause& c) {
298  if ( (c.activity() += cla_inc) > 1e20 ) {
299  // Rescale:
300  for (int i = 0; i < learnts.size(); i++)
301  ca[learnts[i]].activity() *= (float)1e-20;
302  cla_inc *= 1e-20; } }
303 
305 inline void Solver::checkGarbage(double gf){
306  if (ca.wasted() > ca.size() * gf)
307  garbageCollect(); }
308 
309 // NOTE: enqueue does not set the ok flag! (only public methods do)
310 inline bool Solver::enqueue (Lit p, CRef from) { return value(p) != l_Undef ? value(p) != l_False : (uncheckedEnqueue(p, from), true); }
311 inline bool Solver::addClause (const vec<Lit>& ps) { ps.copyTo(add_tmp); return addClause_(add_tmp); }
312 inline bool Solver::addEmptyClause () { add_tmp.clear(); return addClause_(add_tmp); }
313 inline bool Solver::addClause (Lit p) { add_tmp.clear(); add_tmp.push(p); return addClause_(add_tmp); }
314 inline bool Solver::addClause (Lit p, Lit q) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); return addClause_(add_tmp); }
315 inline bool Solver::addClause (Lit p, Lit q, Lit r) { add_tmp.clear(); add_tmp.push(p); add_tmp.push(q); add_tmp.push(r); return addClause_(add_tmp); }
316 inline bool Solver::locked (const Clause& c) const { return value(c[0]) == l_True && reason(var(c[0])) != CRef_Undef && ca.lea(reason(var(c[0]))) == &c; }
317 inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); }
318 
319 inline int Solver::decisionLevel () const { return trail_lim.size(); }
320 inline uint32_t Solver::abstractLevel (Var x) const { return 1 << (level(x) & 31); }
321 inline lbool Solver::value (Var x) const { return assigns[x]; }
322 inline lbool Solver::value (Lit p) const { return assigns[var(p)] ^ sign(p); }
323 inline lbool Solver::modelValue (Var x) const { return model[x]; }
324 inline lbool Solver::modelValue (Lit p) const { return model[var(p)] ^ sign(p); }
325 inline int Solver::nAssigns () const { return trail.size(); }
326 inline int Solver::nClauses () const { return clauses.size(); }
327 inline int Solver::nLearnts () const { return learnts.size(); }
328 inline int Solver::nVars () const { return vardata.size(); }
329 inline int Solver::nFreeVars () const { return (int)dec_vars - (trail_lim.size() == 0 ? trail.size() : trail_lim[0]); }
330 inline void Solver::setPolarity (Var v, bool b) { polarity[v] = b; }
331 inline void Solver::setDecisionVar(Var v, bool b)
332 {
333  if ( b && !decision[v]) dec_vars++;
334  else if (!b && decision[v]) dec_vars--;
335 
336  decision[v] = b;
337  insertVarOrder(v);
338 }
339 inline void Solver::setConfBudget(int64_t x){ conflict_budget = conflicts + x; }
340 inline void Solver::setPropBudget(int64_t x){ propagation_budget = propagations + x; }
341 inline void Solver::interrupt(){ asynch_interrupt = true; }
342 inline void Solver::clearInterrupt(){ asynch_interrupt = false; }
344 inline bool Solver::withinBudget() const {
345  return !asynch_interrupt &&
346  (conflict_budget < 0 || conflicts < (uint64_t)conflict_budget) &&
347  (propagation_budget < 0 || propagations < (uint64_t)propagation_budget); }
348 
349 // FIXME: after the introduction of asynchronous interrruptions the solve-versions that return a
350 // pure bool do not give a safe interface. Either interrupts must be possible to turn off here, or
351 // all calls to solve must return an 'lbool'. I'm not yet sure which I prefer.
352 inline bool Solver::solve () { budgetOff(); assumptions.clear(); return solve_() == l_True; }
353 inline bool Solver::solve (Lit p) { budgetOff(); assumptions.clear(); assumptions.push(p); return solve_() == l_True; }
354 inline bool Solver::solve (Lit p, Lit q) { budgetOff(); assumptions.clear(); assumptions.push(p); assumptions.push(q); return solve_() == l_True; }
355 inline bool Solver::solve (Lit p, Lit q, Lit r) { budgetOff(); assumptions.clear(); assumptions.push(p); assumptions.push(q); assumptions.push(r); return solve_() == l_True; }
356 inline bool Solver::solve (const vec<Lit>& assumps){ budgetOff(); assumps.copyTo(assumptions); return solve_() == l_True; }
357 inline lbool Solver::solveLimited (const vec<Lit>& assumps){ assumps.copyTo(assumptions); return solve_(); }
358 inline bool Solver::okay () const { return ok; }
359 
360 inline void Solver::toDimacs (const char* file){ vec<Lit> as; toDimacs(file, as); }
361 inline void Solver::toDimacs (const char* file, Lit p){ vec<Lit> as; as.push(p); toDimacs(file, as); }
362 inline void Solver::toDimacs (const char* file, Lit p, Lit q){ vec<Lit> as; as.push(p); as.push(q); toDimacs(file, as); }
363 inline void Solver::toDimacs (const char* file, Lit p, Lit q, Lit r){ vec<Lit> as; as.push(p); as.push(q); as.push(r); toDimacs(file, as); }
364 
365 
366 //=================================================================================================
367 // Debug etc:
368 
369 
370 //=================================================================================================
371 }
372 
373 #endif
uint32_t size() const
Definition: Alloc.h:56
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:120
uint32_t wasted() const
Definition: Alloc.h:57
void setConfBudget(int64_t x)
Definition: Solver.h:339
double clause_decay
Definition: Solver.h:118
double learntsize_inc
Definition: Solver.h:131
bool okay() const
Definition: Solver.h:358
void interrupt()
Definition: Solver.h:341
bool locked(const Clause &c) const
Definition: Solver.h:316
void reduceDB()
Definition: Solver.cpp:525
ClauseAllocator ca
Definition: Solver.h:193
void budgetOff()
Definition: Solver.h:343
int learntsize_adjust_cnt
Definition: Solver.h:205
bool luby_restart
Definition: Solver.h:121
bool simplify()
Definition: Solver.cpp:577
CRef reason(Var x) const
Definition: Solver.h:277
int level(Var x) const
Definition: Solver.h:278
void relocAll(ClauseAllocator &to)
Definition: Solver.cpp:876
bool operator()(const Watcher &w) const
Definition: Solver.h:160
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void setPropBudget(int64_t x)
Definition: Solver.h:340
lbool modelValue(Var x) const
Definition: Solver.h:323
int restart_first
Definition: Solver.h:128
#define l_Undef
Definition: SolverTypes.h:86
double learntsize_adjust_inc
Definition: Solver.h:134
bool withinBudget() const
Definition: Solver.h:344
int var(Lit p)
Definition: SolverTypes.h:62
Watcher(CRef cr, Lit p)
Definition: Solver.h:151
double max_learnts
Definition: Solver.h:203
void claDecayActivity()
Definition: Solver.h:296
double learntsize_factor
Definition: Solver.h:130
void setPolarity(Var v, bool b)
Definition: Solver.h:330
void claBumpActivity(Clause &c)
Definition: Solver.h:297
int ccmin_mode
Definition: Solver.h:122
void map()
vec< Lit > conflict
Definition: Solver.h:111
vec< char > polarity
Definition: Solver.h:180
double cla_inc
Definition: Solver.h:174
#define l_True
Definition: SolverTypes.h:84
void newDecisionLevel()
Definition: Solver.h:317
bool addClause(const vec< Lit > &ps)
Definition: Solver.h:311
int learntsize_adjust_start_confl
Definition: Solver.h:133
bool sign(Lit p)
Definition: SolverTypes.h:61
uint64_t starts
Definition: Solver.h:138
bool operator!=(const Watcher &w) const
Definition: Solver.h:153
int64_t conflict_budget
Definition: Solver.h:209
void attachClause(CRef cr)
Definition: Solver.cpp:162
lbool search(int nof_conflicts)
Definition: Solver.cpp:614
void setDecisionVar(Var v, bool b)
Definition: Solver.h:331
vec< Lit > analyze_stack
Definition: Solver.h:199
void cancelUntil(int level)
Definition: Solver.cpp:207
void insertVarOrder(Var x)
Definition: Solver.h:280
void copyTo(vec< T > &copy) const
Definition: Vec.h:90
void detachClause(CRef cr, bool strict=false)
Definition: Solver.cpp:171
void removeSatisfied(vec< CRef > &cs)
Definition: Solver.cpp:545
uint64_t dec_vars
Definition: Solver.h:139
void push(void)
Definition: Vec.h:73
vec< int > trail_lim
Definition: Solver.h:183
int nVars() const
Definition: Solver.h:328
int size(void) const
Definition: Vec.h:63
void clearInterrupt()
Definition: Solver.h:342
float & activity()
Definition: SolverTypes.h:181
bool litRedundant(Lit p, uint32_t abstract_levels)
Definition: Solver.cpp:361
Clause * lea(Ref r)
Definition: SolverTypes.h:224
lbool solveLimited(const vec< Lit > &assumps)
Definition: Solver.h:357
int nFreeVars() const
Definition: Solver.h:329
Lit pickBranchLit()
Definition: Solver.cpp:225
uint64_t learnts_literals
Definition: Solver.h:139
const CRef CRef_Undef
Definition: SolverTypes.h:193
int decisionLevel() const
Definition: Solver.h:319
bool asynch_interrupt
Definition: Solver.h:211
uint64_t decisions
Definition: Solver.h:138
vec< Lit > assumptions
Definition: Solver.h:188
void checkGarbage()
Definition: Solver.h:304
vec< char > seen
Definition: Solver.h:198
double random_var_freq
Definition: Solver.h:119
vec< CRef > clauses
Definition: Solver.h:172
void rebuildOrderHeap()
Definition: Solver.cpp:559
double progress_estimate
Definition: Solver.h:190
static double max
Definition: cuddSubsetHB.c:134
int nAssigns() const
Definition: Solver.h:325
static int size
Definition: cuddSign.c:86
bool addClause_(vec< Lit > &ps)
Definition: Solver.cpp:132
vec< VarData > vardata
Definition: Solver.h:184
uint64_t clauses_literals
Definition: Solver.h:139
double garbage_frac
Definition: Solver.h:126
int phase_saving
Definition: Solver.h:123
bool rnd_init_act
Definition: Solver.h:125
int nClauses() const
Definition: Solver.h:326
const vec< double > & activity
Definition: Solver.h:164
const ClauseAllocator & ca
Definition: Solver.h:158
int64_t propagation_budget
Definition: Solver.h:210
bool operator()(Var x, Var y) const
Definition: Solver.h:165
void removeClause(CRef cr)
Definition: Solver.cpp:188
vec< Lit > analyze_toclear
Definition: Solver.h:200
void toDimacs(FILE *f, const vec< Lit > &assumps)
Definition: Solver.cpp:831
vec< lbool > model
Definition: Solver.h:110
static double drand(double &seed)
Definition: Solver.h:262
uint64_t propagations
Definition: Solver.h:138
vec< double > activity
Definition: Solver.h:175
OccLists< Lit, vec< Watcher >, WatcherDeleted > watches
Definition: Solver.h:178
VarOrderLt(const vec< double > &act)
Definition: Solver.h:166
lbool value(Var x) const
Definition: Solver.h:321
lbool solve_()
Definition: Solver.cpp:751
void varDecayActivity()
Definition: Solver.h:283
int simpDB_assigns
Definition: Solver.h:186
virtual void garbageCollect()
Definition: Solver.cpp:913
bool addEmptyClause()
Definition: Solver.h:312
vec< CRef > learnts
Definition: Solver.h:173
double var_decay
Definition: Solver.h:117
static int irand(double &seed, int size)
Definition: Solver.h:269
uint64_t solves
Definition: Solver.h:138
#define l_False
Definition: SolverTypes.h:85
int Var
Definition: SolverTypes.h:42
vec< Lit > add_tmp
Definition: Solver.h:201
double restart_inc
Definition: Solver.h:129
Var newVar(bool polarity=true, bool dvar=true)
Definition: Solver.cpp:114
virtual ~Solver()
Definition: Solver.cpp:102
void analyzeFinal(Lit p, vec< Lit > &out_conflict)
Definition: Solver.cpp:399
bool enqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.h:310
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition: Solver.cpp:429
bool operator==(const Watcher &w) const
Definition: Solver.h:152
uint32_t abstractLevel(Var x) const
Definition: Solver.h:320
void analyze(CRef confl, vec< Lit > &out_learnt, int &out_btlevel)
Definition: Solver.cpp:264
vec< Lit > trail
Definition: Solver.h:182
uint64_t max_literals
Definition: Solver.h:139
vec< char > decision
Definition: Solver.h:181
int nLearnts() const
Definition: Solver.h:327
bool satisfied(const Clause &c) const
Definition: Solver.cpp:198
double progressEstimate() const
Definition: Solver.cpp:708
WatcherDeleted(const ClauseAllocator &_ca)
Definition: Solver.h:159
int64_t simpDB_props
Definition: Solver.h:187
CRef propagate()
Definition: Solver.cpp:449
double var_inc
Definition: Solver.h:176
void varBumpActivity(Var v, double inc)
Definition: Solver.h:285
Heap< VarOrderLt > order_heap
Definition: Solver.h:189
bool solve()
Definition: Solver.h:352
vec< lbool > assigns
Definition: Solver.h:179
static VarData mkVarData(CRef cr, int l)
Definition: Solver.h:146
uint64_t rnd_decisions
Definition: Solver.h:138
double random_seed
Definition: Solver.h:120
uint64_t conflicts
Definition: Solver.h:138
uint64_t tot_literals
Definition: Solver.h:139
bool remove_satisfied
Definition: Solver.h:191
double learntsize_adjust_confl
Definition: Solver.h:204
bool rnd_pol
Definition: Solver.h:124