module Make:functor (St:Solver_types.S) ->functor (Th:Plugin_intf.Swith type term = St.term and type formula = St.formula and type proof = St.proof) ->
| Parameters: |
|
Functor to create a solver parametrised by the atomic formulas and a theory.
exception Unsat
exception UndecidedLit
val solve : unit -> unitTry and solves the current set of assumptions.
Unsat if a toplevel conflict is foundval assume : ?tag:int -> St.formula list list -> unitAdd the list of clauses to the current set of assumptions. Modifies the sat solver state in place.
val new_lit : St.term -> unitAdd a new litteral (i.e term) to the solver. This term will be decided on at some point during solving, wether it appears in clauses or not.
val new_atom : St.formula -> unitAdd a new atom (i.e propositional formula) to the solver. This formula will be decided on at some point during solving, wether it appears in clauses or not.
val push : unit -> unitCreate a decision level for local assumptions.
Unsat if a conflict is detected in the current state.val pop : unit -> unitPop a decision level for local assumptions.
val local : St.formula list -> unitAdd local assumptions
val eval : St.formula -> boolReturns the valuation of a formula in the current state of the sat solver.
UndecidedLit if the literal is not decidedval eval_level : St.formula -> bool * intReturn the current assignement of the literals, as well as its decision level. If the level is 0, then it is necessary for the atom to have this value; otherwise it is due to choices that can potentially be backtracked.
UndecidedLit if the literal is not decidedval model : unit -> (St.term * St.term) listReturns the model found if the formula is satisfiable.
val check : unit -> boolCheck the satisfiability of the current model. Only has meaning
if the solver finished proof search and has returned Sat.
module Proof:Res.Swith module St = St
val unsat_conflict : unit -> St.clause optionReturns the unsat clause found at the toplevel, if it exists (i.e if
solve has raised Unsat)
val full_slice : unit -> (St.term, St.formula, St.proof) Plugin_intf.sliceView the current state of the trail as a slice. Mainly useful when the solver has reached a SAT conclusion.
These functions expose some internal data stored by the solver, as such great care should be taken to ensure not to mess with the values returned.
val trail : unit -> St.t Vec.tReturns the current trail. *DO NOT MUTATE*
val hyps : unit -> St.clause Vec.tReturns the vector of assumptions used by the solver. May be slightly different from the clauses assumed because of top-level simplification of clauses. *DO NOT MUTATE*
val temp : unit -> St.clause Vec.tReturns the clauses coreesponding to the local assumptions. All clauses in this vec are assured to be unit clauses. *DO NOT MUTATE*
val history : unit -> St.clause Vec.tReturns the history of learnt clauses, with no guarantees on order. *DO NOT MUTATE*