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 -> unit
val model : solver -> Dpll_literal.Literal.t list
Dpll_core.satisfied
s
Dpll_core.satisfied
s
List.length (
Dpll_core.model
s) =
Dpll_core.num_vars
s
val add_interface_variable : solver -> Dpll_literal.Variable.t -> unit
add_interface_variables s v
treats the variable v
and its
negation as interface literals.
Dpll_core.is_interface_variable
v
val is_interface_variable : solver -> Dpll_literal.Variable.t -> bool
val decision_level : solver -> int
Dpll_core.decide
in the
current solver state.
0 <=
Dpll_core.decision_level
s
val inference_possible : solver -> bool
val get_literal_possible : solver -> bool
Dpll_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 -> bool
val 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_possible
s ||
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 -> bool
val is_decided : solver -> Dpll_literal.Literal.t -> bool
val is_inferred : solver -> Dpll_literal.Literal.t -> bool
val level : solver -> Dpll_literal.Literal.t -> int
val decide : solver -> unit
not (
Dpll_core.conflict_detected
s)
not (
Dpll_core.inference_possible
s)
Dpll_core.decision_possible
s
Dpll_core.decision_level
s > 0
not (
Dpll_core.conflict_detected
s)
val infer : solver -> unit
not (
Dpll_core.conflict_detected
s)
Dpll_core.inference_possible
s
val 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 -> unit
set_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)) ls
Dpll_core.conflict_detected
s
val literal_to_explain : solver -> Dpll_literal.Literal.t
Dpll_core.conflict_detected
s
not (
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 -> unit
set_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
s
not (
Dpll_core.unsatisfiable
s)
not (
Dpll_core.backjump_possible
s)
List.mem (
Dpll_core.literal_to_explain
s) ls
List.for_all
(fun l ->
l = (
Dpll_core.literal_to_explain
s) || is_true s (Dpll_literal.negation l))
ls
Dpll_core.conflict_detected
s
not (
Dpll_core.unsatisfiable
s)
val backjump : solver -> unit
Dpll_core.backjump_possible
s
not (
Dpll_core.conflict_detected
s)
Dpll_core.inference_possible
s
val 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 = 0
val num_vars : solver -> int
val num_clauses : solver -> int
val num_learneds : solver -> int
val num_conflicts : solver -> int
val num_decisions : solver -> int
val num_inferences : solver -> int
val num_externally_set : solver -> int
Dpll_core.set_literal
.