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) 2008, Niklas Sorensson
3  2008, Koen Claessen
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 ABC__sat__lsat__solver_h
22 #define ABC__sat__lsat__solver_h
23 
24 
26 
27 
28 // SolverTypes:
29 //
30 typedef struct solver_t solver;
31 typedef int solver_Var;
32 typedef int solver_Lit;
33 typedef int solver_lbool;
34 
35 // Constants: (can these be made inline-able?)
36 //
37 
38 extern const solver_lbool solver_l_True;
39 extern const solver_lbool solver_l_False;
40 extern const solver_lbool solver_l_Undef;
41 
42 
43 solver* solver_new (void);
44 void solver_delete (solver* s);
45 
48 
52 
55 
56 int solver_addClause (solver *s, int len, solver_Lit *ps);
60 
61 int solver_simplify (solver *s);
62 
63 int solver_solve (solver *s, int len, solver_Lit *ps);
64 void solver_solve_begin (solver *s);
67 
68 int solver_okay (solver *s);
69 
70 void solver_setPolarity (solver *s, solver_Var v, int b);
71 void solver_setDecisionVar (solver *s, solver_Var v, int b);
72 
76 
79 
82 
83 int solver_num_assigns (solver *s);
84 int solver_num_clauses (solver *s);
85 int solver_num_learnts (solver *s);
86 int solver_num_vars (solver *s);
88 
91 
92 // Setters:
93 
94 void solver_set_verbosity (solver *s, int v);
95 
96 // Getters:
97 
99 
100 /* TODO
101 
102  // Mode of operation:
103  //
104  int verbosity;
105  double var_decay;
106  double clause_decay;
107  double random_var_freq;
108  double random_seed;
109  double restart_luby_start; // The factor with which the values of the luby sequence is multiplied to get the restart (default 100)
110  double restart_luby_inc; // The constant that the luby sequence uses powers of (default 2)
111  int expensive_ccmin; // FIXME: describe.
112  int rnd_pol; // FIXME: describe.
113 
114  int restart_first; // The initial restart limit. (default 100)
115  double restart_inc; // The factor with which the restart limit is multiplied in each restart. (default 1.5)
116  double learntsize_factor; // The intitial limit for learnt clauses is a factor of the original clauses. (default 1 / 3)
117  double learntsize_inc; // The limit for learnt clauses is multiplied with this factor each restart. (default 1.1)
118 
119  int learntsize_adjust_start_confl;
120  double learntsize_adjust_inc;
121 
122  // Statistics: (read-only member variable)
123  //
124  uint64_t starts, decisions, rnd_decisions, propagations, conflicts;
125  uint64_t dec_vars, clauses_literals, learnts_literals, max_literals, tot_literals;
126 */
127 
128 
129 
131 
132 #endif
solver * solver_new(void)
void solver_solve_begin(solver *s)
void solver_addClause_begin(solver *s)
solver_lbool solver_modelValue_Lit(solver *s, solver_Lit p)
solver_lbool solver_modelValue_Var(solver *s, solver_Var x)
void solver_delete(solver *s)
int solver_num_learnts(solver *s)
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int solver_addClause(solver *s, int len, solver_Lit *ps)
const solver_lbool solver_l_Undef
int solver_okay(solver *s)
int solver_conflict_len(solver *s)
solver_lbool solver_value_Var(solver *s, solver_Var x)
int solver_Lit
Definition: solver.h:32
const solver_lbool solver_l_True
solver_Lit solver_newLit(solver *s)
solver_Lit solver_negate(solver_Lit p)
solver_Var solver_newVar(solver *s)
bool sign(Lit p)
Definition: SolverTypes.h:61
int solver_addClause_commit(solver *s)
int solver_Var
Definition: solver.h:31
solver_lbool solver_get_l_True(void)
solver_lbool solver_value_Lit(solver *s, solver_Lit p)
int solver_num_clauses(solver *s)
void solver_set_verbosity(solver *s, int v)
int solver_num_assigns(solver *s)
void solver_setPolarity(solver *s, solver_Var v, int b)
int solver_simplify(solver *s)
typedefABC_NAMESPACE_HEADER_START struct solver_t solver
Definition: solver.h:30
int solver_sign(solver_Lit p)
int solver_num_vars(solver *s)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
void solver_addClause_addLit(solver *s, solver_Lit p)
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
solver_Lit solver_mkLit_args(solver_Var x, int sign)
solver_lbool solver_get_l_Undef(void)
int solver_lbool
Definition: solver.h:33
void solver_solve_addLit(solver *s, solver_Lit p)
int solver_solve_commit(solver *s)
int solver_num_freeVars(solver *s)
void solver_setDecisionVar(solver *s, solver_Var v, int b)
int solver_solve(solver *s, int len, solver_Lit *ps)
solver_Lit solver_conflict_nthLit(solver *s, int i)
const solver_lbool solver_l_False
solver_Var solver_var(solver_Lit p)
solver_lbool solver_get_l_False(void)
int solver_num_conflicts(solver *s)
solver_Lit solver_mkLit(solver_Var x)