Module Process.Solver
module T : Sidekick_core.TERM with type Term.t = Sidekick_base.Term.t and type Term.store = Sidekick_base.Term.store and type Ty.t = Sidekick_base.Ty.t and type Ty.store = Sidekick_base.Ty.storemodule Lit : Sidekick_core.LIT with module T = Ttype proof= Sidekick_base.Proof_stub.t
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module Lit = Lit and type proof = proof and module P = PInternal solver, available to theories.
type solver= ttype term= T.Term.ttype ty= T.Ty.ttype lit= Lit.ttype dproof= proof -> unitDelayed proof. This is used to build a proof step on demand.
module type THEORY = sig ... end
type theory= (module THEORY)A theory that can be used for this particular solver.
type 'a theory_p= (module THEORY with type t = 'a)A theory that can be used for this particular solver, with state of type
'a.
val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?push_level:('th -> unit) -> ?pop_levels:('th -> int -> unit) -> unit -> theoryHelper to create a theory.
module Model : sig ... endModels
module Unknown : sig ... endMain API
val stats : t -> Sidekick_util.Stat.tval tst : t -> T.Term.storeval ty_st : t -> T.Ty.storeval create : ?stat:Sidekick_util.Stat.t -> ?size:[ `Big | `Tiny | `Small ] -> proof:proof -> theories:theory list -> T.Term.store -> T.Ty.store -> unit -> tCreate a new solver.
It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.
- parameter store_proof
if true, proofs from the SAT solver and theories are retained and potentially accessible after
solvereturns UNSAT.
- parameter size
influences the size of initial allocations.
- parameter theories
theories to load from the start. Other theories can be added using
add_theory.
val add_theory : t -> theory -> unitAdd a theory to the solver. This should be called before any call to
solveor toadd_clauseand the likes (otherwise the theory will have a partial view of the problem).
val add_theory_l : t -> theory list -> unitval mk_lit_t : t -> ?sign:bool -> term -> litmk_lit_t _ ~sign treturnslit', wherelit'ispreprocess(lit)andlitis an internal representation of± t.The proof of
|- lit = lit'is directly added to the solver's proof.
val add_clause : t -> lit Sidekick_util.IArray.t -> dproof -> unitadd_clause solver csadds a boolean clause to the solver. Subsequent calls tosolvewill need to satisfy this clause.
val assert_terms : t -> term list -> unitHelper that turns each term into an atom, before adding the result to the solver as an assertion
val assert_term : t -> term -> unitHelper that turns the term into an atom, before adding the result to the solver as a unit clause assertion
type res=|Sat of Model.tSatisfiable
|Unsat of{unsat_core : unit -> lit Iter.t;subset of assumptions responsible for unsat
}Unsatisfiable
|Unknown of Unknown.tUnknown, obtained after a timeout, memory limit, etc.
Result of solving for the current set of clauses
val solve : ?on_exit:(unit -> unit) list -> ?check:bool -> ?on_progress:(t -> unit) -> assumptions:lit list -> t -> ressolve schecks the satisfiability of the clauses added so far tos.- parameter check
if true, the model is checked before returning.
- parameter on_progress
called regularly during solving.
- parameter assumptions
a set of atoms held to be true. The unsat core, if any, will be a subset of
assumptions.
- parameter on_exit
functions to be run before this returns
val pp_stats : t CCFormat.printerPrint some statistics. What it prints exactly is unspecified.