Module Process.Solver
module T : Sidekick_core.TERM with type Term.t = Sidekick_base.Term.t and type Term.state = Sidekick_base.Term.state and type Ty.t = Sidekick_base.Ty.t and type Ty.state = Sidekick_base.Ty.statemodule P : Sidekick_core.PROOF with type term = T.Term.tmodule Lit : Sidekick_core.LIT with module T = Tmodule Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = LitInternal solver, available to theories.
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 Atom : sig ... end
module Model : sig ... endModels
module Unknown : sig ... endMain API
val stats : t -> Sidekick_util.Stat.tval tst : t -> T.Term.stateval ty_st : t -> T.Ty.stateval create : ?stat:Sidekick_util.Stat.t -> ?size:[ `Big | `Tiny | `Small ] -> ?store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> 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_atom_lit : t -> lit -> Atom.t * P.tmk_atom_lit _ litreturnsatom, prwhereatomis an internal atom for the solver, andpris a proof of|- lit = atom
val mk_atom_t : t -> ?sign:bool -> term -> Atom.t * P.tmk_atom_t _ ~sign treturnsatom, prwhereatomis an internal representation of± t, andpris a proof of|- atom = (± t)
val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unitadd_clause solver csadds a boolean clause to the solver. Subsequent calls tosolvewill need to satisfy this clause.
module Pre_proof : sig ... end
type res=|Sat of Model.tSatisfiable
|Unsat of{proof : Pre_proof.t option lazy_t;proof of unsat
unsat_core : Atom.t list lazy_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:Atom.t 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.