Module Process.Solver

module A : Sidekick_core.TERM_PROOF with type Term.t = Sidekick_base_term.Term.t and type Term.state = Sidekick_base_term.Term.state and type Ty.t = Sidekick_base_term.Ty.t
module CC_A : Sidekick_core.CC_ARG with module A = A
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module A = A and module CC_A = CC_A

Internal solver, available to theories.

module Lit = Solver_internal.Lit
type t
type solver = t
type term = A.Term.t
type ty = A.Ty.t
type lit = Solver_internal.Lit.t
type lemma = A.Proof.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory

module Atom : sig ... end
module Value : sig ... end
module Model : sig ... end
module Unknown : sig ... end
module Proof : sig ... end
type proof = Proof.t

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> A.Term.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> A.Term.state -> unit -> t

Create a new solver.

parameter theories

theories to load from the start.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val mk_atom_lit : t -> lit -> Atom.t
val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t
val add_clause : t -> Atom.t Sidekick_util.IArray.t -> unit
val add_clause_l : t -> Atom.t list -> unit
type res =
| Sat of Model.t
| Unsat of {
proof : proof option;
unsat_core : Atom.t list lazy_t;
}
| Unknown of Unknown.t

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the statement added so far to s

parameter check

if true, the model is checked before returning

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_term_graph : t CCFormat.printer
val pp_stats : t CCFormat.printer