module Dpll_core:State and actions of a MiniSat like DPLL solver.sig..end
type solver
val new_solver : unit -> solver
Dpll_core.satisfied (new_solver ()) Dpll_core.decision_level (new_solver ()) = 0 not (Dpll_core.conflict_detected (new_solver ()))val fresh_variable : solver -> Dpll_literal.Variable.t
val add_clause : solver -> Dpll_literal.Literal.t list -> unitval model : solver -> Dpll_literal.Literal.t list
Dpll_core.satisfied sDpll_core.satisfied sList.length (Dpll_core.model s) = Dpll_core.num_vars sval add_interface_variable : solver -> Dpll_literal.Variable.t -> unitadd_interface_variables s v treats the variable v and its
negation as interface literals.
Dpll_core.is_interface_variable vval is_interface_variable : solver -> Dpll_literal.Variable.t -> boolval decision_level : solver -> intDpll_core.decide in the
current solver state.
0 <= Dpll_core.decision_level sval inference_possible : solver -> boolval get_literal_possible : solver -> boolDpll_core.get_literal since it was
assigned?val conflict_detected : solver -> bool
If a conflict is detected, then either the problem is
unsatisfiable, or it may be resolved by a backjump, or there is
a literal assigned using set_literal that must be explained.
val decision_possible : solver -> boolval backjump_possible : solver -> bool
Dpll_core.conflict_detected s || not(
Dpll_core.backjump_possible s)not (Dpll_core.backjump_possible s &&
Dpll_core.unsatisfiable s)val satisfied : solver -> bool
satisfied s = not (
Dpll_core.conflict_detected s || Dpll_core.decision_possibles ||
Dpll_core.inference_possible s)val unsatisfiable : solver -> bool
not (unsatisfiable s) || (Dpll_core.conflict_detected s)val is_true : solver -> Dpll_literal.Literal.t -> boolval is_decided : solver -> Dpll_literal.Literal.t -> boolval is_inferred : solver -> Dpll_literal.Literal.t -> boolval level : solver -> Dpll_literal.Literal.t -> intval decide : solver -> unit
not (Dpll_core.conflict_detected s) not (Dpll_core.inference_possible s)Dpll_core.decision_possible sDpll_core.decision_level s > 0not (Dpll_core.conflict_detected s)val infer : solver -> unit
not (Dpll_core.conflict_detected s)Dpll_core.inference_possible sval set_literal : solver -> Dpll_literal.Literal.t -> unit
not (Dpll_core.conflict_detected s)val get_literal : solver -> Dpll_literal.Literal.t
Dpll_core.get_literal_possible s Dpll_core.is_true (get_literal s)val set_conflict_clause : solver -> Dpll_literal.Literal.t list -> unitset_conflict_clause ls initializes the conflict clause with
the disjoined literals.
not (Dpll_core.conflict_detected s)List.for_all
(fun l -> Dpll_core.is_true s (Dpll_literal.negation l)) lsDpll_core.conflict_detected sval literal_to_explain : solver -> Dpll_literal.Literal.t
Dpll_core.conflict_detected snot (Dpll_core.unsatisfiable s)not (Dpll_core.backjump_possible s)Dpll_core.is_true s (literal_to_explain s)not (Dpll_core.is_inferred s (literal_to_explain s))not (Dpll_core.is_decided s (literal_to_explain s))val set_literal_explanation : solver -> Dpll_literal.Literal.t list -> unitset_literal_explanation s ls removes Dpll_core.literal_to_explain
from the set of conflict literals using the provided explanation
ls.
Dpll_core.conflict_detected snot (Dpll_core.unsatisfiable s)not (Dpll_core.backjump_possible s)List.mem (Dpll_core.literal_to_explain s) lsList.for_all
(fun l ->
l = (Dpll_core.literal_to_explain s) || is_true s (Dpll_literal.negation l))
lsDpll_core.conflict_detected snot (Dpll_core.unsatisfiable s)val backjump : solver -> unit
Dpll_core.backjump_possible snot (Dpll_core.conflict_detected s) Dpll_core.inference_possible sval forget_some_learned_clauses : solver -> unit
not (Dpll_core.conflict_detected s) not (Dpll_core.conflict_detected s)val restart : solver -> unit
not (Dpll_core.conflict_detected s)not (Dpll_core.conflict_detected s) Dpll_core.decision_level s = 0val num_vars : solver -> intval num_clauses : solver -> intval num_learneds : solver -> intval num_conflicts : solver -> intval num_decisions : solver -> intval num_inferences : solver -> intval num_externally_set : solver -> intDpll_core.set_literal.