forked from flerda/MiniSat-ocaml
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathminisat.mli
67 lines (46 loc) · 1.87 KB
/
minisat.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(** For more information http://minisat.se/MiniSat.html
* and in particular to this paper :
* http://minisat.se/downloads/MiniSat.ps.gz
*)
type minisat
(** variables are integers. They should be created with the method new_var *)
type var = int
type lit
(** the value of a literal can be either True, False or Unknown *)
type lbool = True | False | Unknown
type clause = lit array
class solver :
object
val solver : minisat
(** add a clause to the set of problem constraints. A clause is
* a conjunction of positive and negative literals *)
method add_clause : clause -> bool
(** create a new variable *)
method new_var : var
(** Removes already satisfied clauses. *)
method simplify : unit
(** Search for a model without assumptions *)
method solve : bool
(** Search for a model that respects a given set of assumptions. *)
method solve_with_assumption : clause -> bool
(** The value of a variable in the last model. The last call to solve must
have been satisfiable *)
method value_of : var -> lbool
(** If problem is satisfiable, this vector contains the model (if any). *)
method model : lbool array
(** If problem is unsatisfiable (possibly under assumptions),
this vector represent the final conflict clause expressed in the
assumptions. *)
method conflict : clause
(** The current number of variables. *)
(* method nvar : int *)
end
(** convert a value to a string *)
val string_of_lbool : lbool -> string
external mklit : var -> bool -> lit = "minisat_mklit"
(** given a variable, returns a positive literal *)
external pos_lit : var -> lit = "minisat_pos_lit"
(** given a variable, returns a negative literal *)
external neg_lit : var -> lit = "minisat_neg_lit"
external lit_to_var : lit -> var = "minisat_lit_to_var"
external lit_sign : lit -> bool = "minisat_lit_sign"