abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
satSolver.h
Go to the documentation of this file.
1 /**************************************************************************************************
2 MiniSat -- Copyright (c) 2005, Niklas Sorensson
3 http://www.cs.chalmers.se/Cs/Research/FormalMethods/MiniSat/
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 // Modified to compile with MS Visual Studio 6.0 by Alan Mishchenko
21 
22 #ifndef ABC__sat__bsat__satSolver_h
23 #define ABC__sat__bsat__satSolver_h
24 
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <assert.h>
30 
31 #include "satVec.h"
32 #include "satClause.h"
33 
35 
36 //#define USE_FLOAT_ACTIVITY
37 
38 //=================================================================================================
39 // Public interface:
40 
41 struct sat_solver_t;
42 typedef struct sat_solver_t sat_solver;
43 
44 extern sat_solver* sat_solver_new(void);
45 extern void sat_solver_delete(sat_solver* s);
46 
47 extern int sat_solver_addclause(sat_solver* s, lit* begin, lit* end);
48 extern int sat_solver_clause_new(sat_solver* s, lit* begin, lit* end, int learnt);
49 extern int sat_solver_simplify(sat_solver* s);
50 extern int sat_solver_solve(sat_solver* s, lit* begin, lit* end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal);
51 extern void sat_solver_restart( sat_solver* s );
52 extern void sat_solver_rollback( sat_solver* s );
53 
54 extern int sat_solver_nvars(sat_solver* s);
55 extern int sat_solver_nclauses(sat_solver* s);
56 extern int sat_solver_nconflicts(sat_solver* s);
57 extern double sat_solver_memory(sat_solver* s);
59 
60 extern void sat_solver_setnvars(sat_solver* s,int n);
61 extern int sat_solver_get_var_value(sat_solver* s, int v);
62 
63 
64 extern void Sat_SolverWriteDimacs( sat_solver * p, char * pFileName, lit* assumptionsBegin, lit* assumptionsEnd, int incrementVars );
65 extern void Sat_SolverPrintStats( FILE * pFile, sat_solver * p );
66 extern int * Sat_SolverGetModel( sat_solver * p, int * pVars, int nVars );
67 extern void Sat_SolverDoubleClauses( sat_solver * p, int iVar );
68 
69 // trace recording
70 extern void Sat_SolverTraceStart( sat_solver * pSat, char * pName );
71 extern void Sat_SolverTraceStop( sat_solver * pSat );
72 extern void Sat_SolverTraceWrite( sat_solver * pSat, int * pBeg, int * pEnd, int fRoot );
73 
74 // clause storage
75 extern void sat_solver_store_alloc( sat_solver * s );
76 extern void sat_solver_store_write( sat_solver * s, char * pFileName );
77 extern void sat_solver_store_free( sat_solver * s );
78 extern void sat_solver_store_mark_roots( sat_solver * s );
80 extern void * sat_solver_store_release( sat_solver * s );
81 
82 //=================================================================================================
83 // Solver representation:
84 
85 //struct clause_t;
86 //typedef struct clause_t clause;
87 
88 struct varinfo_t;
89 typedef struct varinfo_t varinfo;
90 
92 {
93  int size; // nof variables
94  int cap; // size of varmaps
95  int qhead; // Head index of queue.
96  int qtail; // Tail index of queue.
97 
98  // clauses
100  int hLearnts; // the first learnt clause
101  int hBinary; // the special binary clause
103  veci* wlists; // watcher lists
104  veci act_clas; // contain clause activities
105 
106  // rollback
107  int iVarPivot; // the pivot for variables
108  int iTrailPivot; // the pivot for trail
109  int hProofPivot; // the pivot for proof records
110 
111  // activities
112 #ifdef USE_FLOAT_ACTIVITY
113  double var_inc; // Amount to bump next variable with.
114  double var_decay; // INVERSE decay factor for variable activity: stores 1/decay.
115  float cla_inc; // Amount to bump next clause with.
116  float cla_decay; // INVERSE decay factor for clause activity: stores 1/decay.
117  double* activity; // A heuristic measurement of the activity of a variable.
118 #else
119  int var_inc; // Amount to bump next variable with.
120  int var_inc2; // Amount to bump next variable with.
121  int cla_inc; // Amount to bump next clause with.
122  unsigned* activity; // A heuristic measurement of the activity of a variable.
123  unsigned* activity2; // backup variable activity
124 #endif
125  char * pFreqs; // how many times this variable was assigned a value
126  int nVarUsed;
127 
128 // varinfo * vi; // variable information
129  int* levels; //
130  char* assigns; // Current values of variables.
131  char* polarity; //
132  char* tags; //
133  char* loads; //
134 
135  int* orderpos; // Index in variable order.
136  int* reasons; //
138  veci tagged; // (contains: var)
139  veci stack; // (contains: var)
140 
141  veci order; // Variable order. (heap) (contains: var)
142  veci trail_lim; // Separator indices for different decision levels in 'trail'. (contains: int)
143 // veci model; // If problem is solved, this vector contains the model (contains: lbool).
144  int * model; // If problem is solved, this vector contains the model (contains: lbool).
145  veci conf_final; // If problem is unsatisfiable (possibly under assumptions),
146  // this vector represent the final conflict clause expressed in the assumptions.
147 
148  int root_level; // Level of first proper decision.
149  int simpdb_assigns;// Number of top-level assignments at last 'simplifyDB()'.
150  int simpdb_props; // Number of propagations before next 'simplifyDB()'.
151  double random_seed;
153  int verbosity; // Verbosity level. 0=silent, 1=some progress report, 2=everything
154  int fVerbose;
155 
157  int nLearntMax; // max number of learned clauses
158  int nLearntStart; // starting learned clause limit
159  int nLearntDelta; // delta of learned clause limit
160  int nLearntRatio; // ratio percentage of learned clauses
161  int nDBreduces; // number of DB reductions
162 
163  ABC_INT64_T nConfLimit; // external limit on the number of conflicts
164  ABC_INT64_T nInsLimit; // external limit on the number of implications
165  abctime nRuntimeLimit; // external limit on runtime
166 
167  veci act_vars; // variables whose activity has changed
168  double* factors; // the activity factors
169  int nRestarts; // the number of local restarts
170  int nCalls; // the number of local restarts
171  int nCalls2; // the number of local restarts
172  veci unit_lits; // variables whose activity has changed
173  veci pivot_vars; // pivot variables
174 
175  int fSkipSimplify; // set to one to skip simplification of the clause database
176  int fNotUseRandom; // do not allow random decisions with a fixed probability
177 
178  int * pGlobalVars; // for experiments with global vars during interpolation
179  // clause store
180  void * pStore;
181  int fSolved;
182 
183  // trace recording
184  FILE * pFile;
185  int nClauses;
186  int nRoots;
187 
188  veci temp_clause; // temporary storage for a CNF clause
189 
190  // CNF loading
191  void * pCnfMan; // external CNF manager
192  int(*pCnfFunc)(void * p, int); // external callback
193 };
194 
195 static inline clause * clause_read( sat_solver * s, cla h )
196 {
197  return Sat_MemClauseHand( &s->Mem, h );
198 }
199 
200 static int sat_solver_var_value( sat_solver* s, int v )
201 {
202  assert( v >= 0 && v < s->size );
203  return (int)(s->model[v] == l_True);
204 }
205 static int sat_solver_var_literal( sat_solver* s, int v )
206 {
207  assert( v >= 0 && v < s->size );
208  return toLitCond( v, s->model[v] != l_True );
209 }
211 {
212  int i;
213  for (i = 0; i < s->size; i++)
214  s->activity[i] = 0;
215  s->var_inc = 1;
216 }
218 {
219  if ( s->qtail != s->qhead )
220  {
221  int RetValue = sat_solver_simplify(s);
222  assert( RetValue != 0 );
223  (void) RetValue;
224  }
225 }
226 
227 static int sat_solver_final(sat_solver* s, int ** ppArray)
228 {
229  *ppArray = s->conf_final.ptr;
230  return s->conf_final.size;
231 }
232 
234 {
235  abctime nRuntimeLimit = s->nRuntimeLimit;
236  s->nRuntimeLimit = Limit;
237  return nRuntimeLimit;
238 }
239 
240 static int sat_solver_set_random(sat_solver* s, int fNotUseRandom)
241 {
242  int fNotUseRandomOld = s->fNotUseRandom;
243  s->fNotUseRandom = fNotUseRandom;
244  return fNotUseRandomOld;
245 }
246 
247 static inline void sat_solver_bookmark(sat_solver* s)
248 {
249  assert( s->qhead == s->qtail );
250  s->iVarPivot = s->size;
251  s->iTrailPivot = s->qhead;
252  Sat_MemBookMark( &s->Mem );
253  if ( s->activity2 )
254  {
255  s->var_inc2 = s->var_inc;
256  memcpy( s->activity2, s->activity, sizeof(unsigned) * s->iVarPivot );
257  }
258 }
259 static inline void sat_solver_set_pivot_variables( sat_solver* s, int * pPivots, int nPivots )
260 {
261  s->pivot_vars.cap = nPivots;
262  s->pivot_vars.size = nPivots;
263  s->pivot_vars.ptr = pPivots;
264 }
266 {
267  int i, nVars = 0;
268  for ( i = 0; i < s->size; i++ )
269  if ( s->pFreqs[i] )
270  {
271  s->pFreqs[i] = 0;
272  nVars++;
273  }
274  return nVars;
275 }
276 
277 static inline int sat_solver_add_const( sat_solver * pSat, int iVar, int fCompl )
278 {
279  lit Lits[1];
280  int Cid;
281  assert( iVar >= 0 );
282 
283  Lits[0] = toLitCond( iVar, fCompl );
284  Cid = sat_solver_addclause( pSat, Lits, Lits + 1 );
285  assert( Cid );
286  return 1;
287 }
288 static inline int sat_solver_add_buffer( sat_solver * pSat, int iVarA, int iVarB, int fCompl )
289 {
290  lit Lits[2];
291  int Cid;
292  assert( iVarA >= 0 && iVarB >= 0 );
293 
294  Lits[0] = toLitCond( iVarA, 0 );
295  Lits[1] = toLitCond( iVarB, !fCompl );
296  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
297  assert( Cid );
298 
299  Lits[0] = toLitCond( iVarA, 1 );
300  Lits[1] = toLitCond( iVarB, fCompl );
301  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
302  assert( Cid );
303  return 2;
304 }
305 static inline int sat_solver_add_buffer_enable( sat_solver * pSat, int iVarA, int iVarB, int iVarEn, int fCompl )
306 {
307  lit Lits[3];
308  int Cid;
309  assert( iVarA >= 0 && iVarB >= 0 && iVarEn >= 0 );
310 
311  Lits[0] = toLitCond( iVarA, 0 );
312  Lits[1] = toLitCond( iVarB, !fCompl );
313  Lits[2] = toLitCond( iVarEn, 1 );
314  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
315  assert( Cid );
316 
317  Lits[0] = toLitCond( iVarA, 1 );
318  Lits[1] = toLitCond( iVarB, fCompl );
319  Lits[2] = toLitCond( iVarEn, 1 );
320  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
321  assert( Cid );
322  return 2;
323 }
324 static inline int sat_solver_add_and( sat_solver * pSat, int iVar, int iVar0, int iVar1, int fCompl0, int fCompl1, int fCompl )
325 {
326  lit Lits[3];
327  int Cid;
328 
329  Lits[0] = toLitCond( iVar, !fCompl );
330  Lits[1] = toLitCond( iVar0, fCompl0 );
331  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
332  assert( Cid );
333 
334  Lits[0] = toLitCond( iVar, !fCompl );
335  Lits[1] = toLitCond( iVar1, fCompl1 );
336  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
337  assert( Cid );
338 
339  Lits[0] = toLitCond( iVar, fCompl );
340  Lits[1] = toLitCond( iVar0, !fCompl0 );
341  Lits[2] = toLitCond( iVar1, !fCompl1 );
342  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
343  assert( Cid );
344  return 3;
345 }
346 static inline int sat_solver_add_xor( sat_solver * pSat, int iVarA, int iVarB, int iVarC, int fCompl )
347 {
348  lit Lits[3];
349  int Cid;
350  assert( iVarA >= 0 && iVarB >= 0 && iVarC >= 0 );
351 
352  Lits[0] = toLitCond( iVarA, !fCompl );
353  Lits[1] = toLitCond( iVarB, 1 );
354  Lits[2] = toLitCond( iVarC, 1 );
355  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
356  assert( Cid );
357 
358  Lits[0] = toLitCond( iVarA, !fCompl );
359  Lits[1] = toLitCond( iVarB, 0 );
360  Lits[2] = toLitCond( iVarC, 0 );
361  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
362  assert( Cid );
363 
364  Lits[0] = toLitCond( iVarA, fCompl );
365  Lits[1] = toLitCond( iVarB, 1 );
366  Lits[2] = toLitCond( iVarC, 0 );
367  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
368  assert( Cid );
369 
370  Lits[0] = toLitCond( iVarA, fCompl );
371  Lits[1] = toLitCond( iVarB, 0 );
372  Lits[2] = toLitCond( iVarC, 1 );
373  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
374  assert( Cid );
375  return 4;
376 }
377 static inline int sat_solver_add_mux( sat_solver * pSat, int iVarC, int iVarT, int iVarE, int iVarZ )
378 {
379  lit Lits[3];
380  int Cid;
381  assert( iVarC >= 0 && iVarT >= 0 && iVarE >= 0 && iVarZ >= 0 );
382 
383  Lits[0] = toLitCond( iVarC, 1 );
384  Lits[1] = toLitCond( iVarT, 1 );
385  Lits[2] = toLitCond( iVarZ, 0 );
386  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
387  assert( Cid );
388 
389  Lits[0] = toLitCond( iVarC, 1 );
390  Lits[1] = toLitCond( iVarT, 0 );
391  Lits[2] = toLitCond( iVarZ, 1 );
392  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
393  assert( Cid );
394 
395  Lits[0] = toLitCond( iVarC, 0 );
396  Lits[1] = toLitCond( iVarE, 1 );
397  Lits[2] = toLitCond( iVarZ, 0 );
398  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
399  assert( Cid );
400 
401  Lits[0] = toLitCond( iVarC, 0 );
402  Lits[1] = toLitCond( iVarE, 0 );
403  Lits[2] = toLitCond( iVarZ, 1 );
404  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
405  assert( Cid );
406 
407  if ( iVarT == iVarE )
408  return 4;
409 
410  Lits[0] = toLitCond( iVarT, 0 );
411  Lits[1] = toLitCond( iVarE, 0 );
412  Lits[2] = toLitCond( iVarZ, 1 );
413  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
414  assert( Cid );
415 
416  Lits[0] = toLitCond( iVarT, 1 );
417  Lits[1] = toLitCond( iVarE, 1 );
418  Lits[2] = toLitCond( iVarZ, 0 );
419  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
420  assert( Cid );
421  return 6;
422 }
423 static inline int sat_solver_add_mux41( sat_solver * pSat, int iVarC0, int iVarC1, int iVarD0, int iVarD1, int iVarD2, int iVarD3, int iVarZ )
424 {
425  lit Lits[4];
426  int Cid;
427  assert( iVarC0 >= 0 && iVarC1 >= 0 && iVarD0 >= 0 && iVarD1 >= 0 && iVarD2 >= 0 && iVarD3 >= 0 && iVarZ >= 0 );
428 
429  Lits[0] = toLitCond( iVarD0, 1 );
430  Lits[1] = toLitCond( iVarC0, 0 );
431  Lits[2] = toLitCond( iVarC1, 0 );
432  Lits[3] = toLitCond( iVarZ, 0 );
433  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
434  assert( Cid );
435 
436  Lits[0] = toLitCond( iVarD1, 1 );
437  Lits[1] = toLitCond( iVarC0, 1 );
438  Lits[2] = toLitCond( iVarC1, 0 );
439  Lits[3] = toLitCond( iVarZ, 0 );
440  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
441  assert( Cid );
442 
443  Lits[0] = toLitCond( iVarD2, 1 );
444  Lits[1] = toLitCond( iVarC0, 0 );
445  Lits[2] = toLitCond( iVarC1, 1 );
446  Lits[3] = toLitCond( iVarZ, 0 );
447  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
448  assert( Cid );
449 
450  Lits[0] = toLitCond( iVarD3, 1 );
451  Lits[1] = toLitCond( iVarC0, 1 );
452  Lits[2] = toLitCond( iVarC1, 1 );
453  Lits[3] = toLitCond( iVarZ, 0 );
454  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
455  assert( Cid );
456 
457 
458  Lits[0] = toLitCond( iVarD0, 0 );
459  Lits[1] = toLitCond( iVarC0, 0 );
460  Lits[2] = toLitCond( iVarC1, 0 );
461  Lits[3] = toLitCond( iVarZ, 1 );
462  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
463  assert( Cid );
464 
465  Lits[0] = toLitCond( iVarD1, 0 );
466  Lits[1] = toLitCond( iVarC0, 1 );
467  Lits[2] = toLitCond( iVarC1, 0 );
468  Lits[3] = toLitCond( iVarZ, 1 );
469  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
470  assert( Cid );
471 
472  Lits[0] = toLitCond( iVarD2, 0 );
473  Lits[1] = toLitCond( iVarC0, 0 );
474  Lits[2] = toLitCond( iVarC1, 1 );
475  Lits[3] = toLitCond( iVarZ, 1 );
476  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
477  assert( Cid );
478 
479  Lits[0] = toLitCond( iVarD3, 0 );
480  Lits[1] = toLitCond( iVarC0, 1 );
481  Lits[2] = toLitCond( iVarC1, 1 );
482  Lits[3] = toLitCond( iVarZ, 1 );
483  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
484  assert( Cid );
485  return 8;
486 }
487 static inline int sat_solver_add_xor_and( sat_solver * pSat, int iVarF, int iVarA, int iVarB, int iVarC )
488 {
489  // F = (a (+) b) * c
490  lit Lits[4];
491  int Cid;
492  assert( iVarF >= 0 && iVarA >= 0 && iVarB >= 0 && iVarC >= 0 );
493 
494  Lits[0] = toLitCond( iVarF, 1 );
495  Lits[1] = toLitCond( iVarA, 1 );
496  Lits[2] = toLitCond( iVarB, 1 );
497  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
498  assert( Cid );
499 
500  Lits[0] = toLitCond( iVarF, 1 );
501  Lits[1] = toLitCond( iVarA, 0 );
502  Lits[2] = toLitCond( iVarB, 0 );
503  Cid = sat_solver_addclause( pSat, Lits, Lits + 3 );
504  assert( Cid );
505 
506  Lits[0] = toLitCond( iVarF, 1 );
507  Lits[1] = toLitCond( iVarC, 0 );
508  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
509  assert( Cid );
510 
511  Lits[0] = toLitCond( iVarF, 0 );
512  Lits[1] = toLitCond( iVarA, 1 );
513  Lits[2] = toLitCond( iVarB, 0 );
514  Lits[3] = toLitCond( iVarC, 1 );
515  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
516  assert( Cid );
517 
518  Lits[0] = toLitCond( iVarF, 0 );
519  Lits[1] = toLitCond( iVarA, 0 );
520  Lits[2] = toLitCond( iVarB, 1 );
521  Lits[3] = toLitCond( iVarC, 1 );
522  Cid = sat_solver_addclause( pSat, Lits, Lits + 4 );
523  assert( Cid );
524  return 5;
525 }
526 static inline int sat_solver_add_constraint( sat_solver * pSat, int iVar, int iVar2, int fCompl )
527 {
528  lit Lits[2];
529  int Cid;
530  assert( iVar >= 0 );
531 
532  Lits[0] = toLitCond( iVar, fCompl );
533  Lits[1] = toLitCond( iVar2, 0 );
534  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
535  assert( Cid );
536 
537  Lits[0] = toLitCond( iVar, fCompl );
538  Lits[1] = toLitCond( iVar2, 1 );
539  Cid = sat_solver_addclause( pSat, Lits, Lits + 2 );
540  assert( Cid );
541  return 2;
542 }
543 
544 
546 
547 #endif
void * sat_solver_store_release(sat_solver *s)
Definition: satSolver.c:1949
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Definition: satSolver.h:233
int fSkipSimplify
Definition: satSolver.h:175
int * model
Definition: satSolver.h:144
void sat_solver_restart(sat_solver *s)
Definition: satSolver.c:1186
veci act_vars
Definition: satSolver.h:167
int sat_solver_nclauses(sat_solver *s)
Definition: satSolver.c:1902
FILE * pFile
Definition: satSolver.h:184
int sat_solver_nconflicts(sat_solver *s)
Definition: satSolver.c:1908
int * ptr
Definition: satVec.h:34
veci unit_lits
Definition: satSolver.h:172
veci * wlists
Definition: satSolver.h:103
static Llb_Mgr_t * p
Definition: llb3Image.c:950
unsigned * activity
Definition: satSolver.h:122
static int sat_solver_add_mux(sat_solver *pSat, int iVarC, int iVarT, int iVarE, int iVarZ)
Definition: satSolver.h:377
int * reasons
Definition: satSolver.h:136
static void sat_solver_bookmark(sat_solver *s)
Definition: satSolver.h:247
double random_seed
Definition: satSolver.h:151
int sat_solver_get_var_value(sat_solver *s, int v)
Definition: satSolver.c:117
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
Sat_Mem_t Mem
Definition: satSolver.h:99
veci temp_clause
Definition: satSolver.h:188
static void sat_solver_compress(sat_solver *s)
Definition: satSolver.h:217
static int sat_solver_add_xor_and(sat_solver *pSat, int iVarF, int iVarA, int iVarB, int iVarC)
Definition: satSolver.h:487
double sat_solver_memory(sat_solver *s)
Definition: satSolver.c:1236
int root_level
Definition: satSolver.h:148
ABC_INT64_T nInsLimit
Definition: satSolver.h:164
static void sat_solver_set_pivot_variables(sat_solver *s, int *pPivots, int nPivots)
Definition: satSolver.h:259
void * pStore
Definition: satSolver.h:180
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
int hProofPivot
Definition: satSolver.h:109
static int sat_solver_set_random(sat_solver *s, int fNotUseRandom)
Definition: satSolver.h:240
char * memcpy()
char * tags
Definition: satSolver.h:132
Definition: satVec.h:31
#define l_True
Definition: SolverTypes.h:84
veci act_clas
Definition: satSolver.h:104
void sat_solver_store_mark_roots(sat_solver *s)
Definition: satSolver.c:1939
static int sat_solver_add_xor(sat_solver *pSat, int iVarA, int iVarB, int iVarC, int fCompl)
Definition: satSolver.h:346
void Sat_SolverTraceStart(sat_solver *pSat, char *pName)
DECLARATIONS ///.
Definition: satTrace.c:53
void sat_solver_store_alloc(sat_solver *s)
Definition: satSolver.c:1916
char * polarity
Definition: satSolver.h:131
stats_t stats
Definition: satSolver.h:156
char * assigns
Definition: satSolver.h:130
int fNotUseRandom
Definition: satSolver.h:176
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
int cla
Definition: satVec.h:131
int nDBreduces
Definition: satSolver.h:161
int lit
Definition: satVec.h:130
static int sat_solver_add_buffer(sat_solver *pSat, int iVarA, int iVarB, int fCompl)
Definition: satSolver.h:288
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
Definition: satSolver.c:1492
static int sat_solver_final(sat_solver *s, int **ppArray)
Definition: satSolver.h:227
static int sat_solver_add_constraint(sat_solver *pSat, int iVar, int iVar2, int fCompl)
Definition: satSolver.h:526
static int sat_solver_add_const(sat_solver *pSat, int iVar, int fCompl)
Definition: satSolver.h:277
double * factors
Definition: satSolver.h:168
char * loads
Definition: satSolver.h:133
int nLearntDelta
Definition: satSolver.h:159
int * orderpos
Definition: satSolver.h:135
char * pFreqs
Definition: satSolver.h:125
int nLearntMax
Definition: satSolver.h:157
void sat_solver_store_mark_clauses_a(sat_solver *s)
Definition: satSolver.c:1944
int * pGlobalVars
Definition: satSolver.h:178
void sat_solver_store_write(sat_solver *s, char *pFileName)
Definition: satSolver.c:1922
veci conf_final
Definition: satSolver.h:145
unsigned * activity2
Definition: satSolver.h:123
static lit toLitCond(int v, int c)
Definition: satVec.h:143
void * pCnfMan
Definition: satSolver.h:191
void sat_solver_store_free(sat_solver *s)
Definition: satSolver.c:1927
void sat_solver_setnvars(sat_solver *s, int n)
Definition: satSolver.c:1072
static void sat_solver_act_var_clear(sat_solver *s)
Definition: satSolver.h:210
abctime nRuntimeLimit
Definition: satSolver.h:165
static int size
Definition: cuddSign.c:86
int sat_solver_nvars(sat_solver *s)
Definition: satSolver.c:1896
void Sat_SolverWriteDimacs(sat_solver *p, char *pFileName, lit *assumptionsBegin, lit *assumptionsEnd, int incrementVars)
Definition: satUtil.c:71
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
int simpdb_assigns
Definition: satSolver.h:149
void Sat_SolverTraceWrite(sat_solver *pSat, int *pBeg, int *pEnd, int fRoot)
Definition: satTrace.c:95
veci trail_lim
Definition: satSolver.h:142
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int cap
Definition: satVec.h:32
clause * binary
Definition: satSolver.h:102
int nLearntRatio
Definition: satSolver.h:160
ABC_INT64_T nConfLimit
Definition: satSolver.h:163
int nLearntStart
Definition: satSolver.h:158
static clause * Sat_MemClauseHand(Sat_Mem_t *p, cla h)
Definition: satClause.h:98
lit * trail
Definition: satSolver.h:137
int iTrailPivot
Definition: satSolver.h:108
static int sat_solver_count_usedvars(sat_solver *s)
Definition: satSolver.h:265
int(* pCnfFunc)(void *p, int)
Definition: satSolver.h:192
void sat_solver_rollback(sat_solver *s)
Definition: satSolver.c:1401
int sat_solver_clause_new(sat_solver *s, lit *begin, lit *end, int learnt)
Definition: satSolver.c:402
int sat_solver_count_assigned(sat_solver *s)
Definition: satSolver.c:609
veci pivot_vars
Definition: satSolver.h:173
static int sat_solver_var_literal(sat_solver *s, int v)
Definition: satSolver.h:205
static clause * clause_read(sat_solver *s, cla h)
Definition: satSolver.h:195
int size
Definition: satVec.h:33
int * levels
Definition: satSolver.h:129
#define assert(ex)
Definition: util_old.h:213
sat_solver * sat_solver_new(void)
Definition: satSolver.c:1001
int simpdb_props
Definition: satSolver.h:150
static int sat_solver_add_buffer_enable(sat_solver *pSat, int iVarA, int iVarB, int iVarEn, int fCompl)
Definition: satSolver.h:305
void Sat_SolverPrintStats(FILE *pFile, sat_solver *p)
Definition: satUtil.c:188
ABC_INT64_T abctime
Definition: abc_global.h:278
double progress_estimate
Definition: satSolver.h:152
static int sat_solver_add_mux41(sat_solver *pSat, int iVarC0, int iVarC1, int iVarD0, int iVarD1, int iVarD2, int iVarD3, int iVarZ)
Definition: satSolver.h:423
int sat_solver_simplify(sat_solver *s)
Definition: satSolver.c:1276
static void Sat_MemBookMark(Sat_Mem_t *p)
Definition: satClause.h:249
int * Sat_SolverGetModel(sat_solver *p, int *pVars, int nVars)
Definition: satUtil.c:266
void Sat_SolverDoubleClauses(sat_solver *p, int iVar)
Definition: satUtil.c:308
void Sat_SolverTraceStop(sat_solver *pSat)
Definition: satTrace.c:73
static int sat_solver_add_and(sat_solver *pSat, int iVar, int iVar0, int iVar1, int fCompl0, int fCompl1, int fCompl)
Definition: satSolver.h:324