mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-09 20:55:39 -05:00
Removed solver_types module in solver.Make functor
This commit is contained in:
parent
2b2631b1c3
commit
73c9082b3a
4 changed files with 17 additions and 15 deletions
|
|
@ -16,8 +16,8 @@ module type S = sig
|
||||||
(** Learn and build proofs for the clause in the vector. Clauses in the vector should be in the order they were learned. *)
|
(** Learn and build proofs for the clause in the vector. Clauses in the vector should be in the order they were learned. *)
|
||||||
|
|
||||||
val assert_can_prove_unsat : clause -> unit
|
val assert_can_prove_unsat : clause -> unit
|
||||||
(** [prove_unsat c] tries and prove the empty clause from [c]. [c] may be a learnt clause not yet proved.
|
(** [assert_can_prove_unsat c] tries and prove the empty clause from [c]. [c] may be a learnt clause not yet proved.
|
||||||
@raise Cannot if it is impossible. *)
|
@raise Insuficient_hyps if it is impossible. *)
|
||||||
|
|
||||||
type proof_node = {
|
type proof_node = {
|
||||||
conclusion : clause;
|
conclusion : clause;
|
||||||
|
|
@ -30,7 +30,9 @@ module type S = sig
|
||||||
| Resolution of proof * proof * atom
|
| Resolution of proof * proof * atom
|
||||||
|
|
||||||
val prove_unsat : clause -> proof
|
val prove_unsat : clause -> proof
|
||||||
(** Given a conflict clause [c], returns a proof of the empty clause. *)
|
(** Given a conflict clause [c], returns a proof of the empty clause. Same as [assert_can_prove_unsat] but returns
|
||||||
|
the proof if it succeeds.
|
||||||
|
@raise Insuficient_hyps if it does not succeed. *)
|
||||||
|
|
||||||
val unsat_core : proof -> clause list
|
val unsat_core : proof -> clause list
|
||||||
(** Returns the unsat_core of the given proof, i.e the lists of conclusions of all leafs of the proof. *)
|
(** Returns the unsat_core of the given proof, i.e the lists of conclusions of all leafs of the proof. *)
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,6 @@ end
|
||||||
|
|
||||||
module Tseitin = Tseitin.Make(Fsat)
|
module Tseitin = Tseitin.Make(Fsat)
|
||||||
|
|
||||||
module Stypes = Solver_types.Make(Fsat)
|
|
||||||
|
|
||||||
module Tsat = struct
|
module Tsat = struct
|
||||||
(* We don't have anything to do since the SAT Solver already
|
(* We don't have anything to do since the SAT Solver already
|
||||||
* does propagation and conflict detection *)
|
* does propagation and conflict detection *)
|
||||||
|
|
@ -84,12 +82,12 @@ module Tsat = struct
|
||||||
end
|
end
|
||||||
|
|
||||||
module Make(Dummy : sig end) = struct
|
module Make(Dummy : sig end) = struct
|
||||||
module SatSolver = Solver.Make(Fsat)(Stypes)(Tsat)
|
module SatSolver = Solver.Make(Fsat)(Tsat)
|
||||||
|
|
||||||
exception Bad_atom
|
exception Bad_atom
|
||||||
|
|
||||||
type atom = Fsat.t
|
type atom = Fsat.t
|
||||||
type clause = Stypes.clause
|
type clause = SatSolver.St.clause
|
||||||
type proof = SatSolver.Proof.proof
|
type proof = SatSolver.Proof.proof
|
||||||
|
|
||||||
type res =
|
type res =
|
||||||
|
|
@ -141,7 +139,7 @@ module Make(Dummy : sig end) = struct
|
||||||
let unsat_core = SatSolver.Proof.unsat_core
|
let unsat_core = SatSolver.Proof.unsat_core
|
||||||
|
|
||||||
let print_atom = Fsat.print
|
let print_atom = Fsat.print
|
||||||
let print_clause = Stypes.print_clause
|
let print_clause = SatSolver.St.print_clause
|
||||||
let print_proof = SatSolver.Proof.print_dot
|
let print_proof = SatSolver.Proof.print_dot
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,13 @@
|
||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
module Make (F : Formula_intf.S)
|
module Make (F : Formula_intf.S)
|
||||||
(St : Solver_types.S with type formula = F.t)
|
|
||||||
(Th : Theory_intf.S with type formula = F.t) = struct
|
(Th : Theory_intf.S with type formula = F.t) = struct
|
||||||
|
|
||||||
open St
|
module St = Solver_types.Make(F)
|
||||||
module Proof = Res.Make(St)(Th)
|
module Proof = Res.Make(St)(Th)
|
||||||
|
|
||||||
|
open St
|
||||||
|
|
||||||
exception Sat
|
exception Sat
|
||||||
exception Unsat
|
exception Unsat
|
||||||
exception Restart
|
exception Restart
|
||||||
|
|
|
||||||
|
|
@ -12,18 +12,19 @@
|
||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
module Make (F : Formula_intf.S)
|
module Make (F : Formula_intf.S)
|
||||||
(St : Solver_types.S with type formula = F.t)
|
(Th : Theory_intf.S with type formula = F.t) : sig
|
||||||
(Th : Theory_intf.S with type formula = F.t) :
|
|
||||||
sig
|
|
||||||
(** Functor to create a SMT Solver parametrised by the atomic
|
(** Functor to create a SMT Solver parametrised by the atomic
|
||||||
formulas and a theory. *)
|
formulas and a theory. *)
|
||||||
|
|
||||||
exception Unsat
|
exception Unsat
|
||||||
|
|
||||||
|
module St : Solver_types.S with
|
||||||
|
type formula = F.t
|
||||||
|
|
||||||
module Proof : Res.S with
|
module Proof : Res.S with
|
||||||
type atom = St.atom and
|
type atom = St.atom and
|
||||||
type clause = St.clause and
|
type clause = St.clause and
|
||||||
type lemma = Th.proof
|
type lemma = Th.proof
|
||||||
|
|
||||||
val solve : unit -> unit
|
val solve : unit -> unit
|
||||||
(** Try and solves the current set of assumptions.
|
(** Try and solves the current set of assumptions.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue