Skip to content

Commit

Permalink
Adds S_with_fresh
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeom committed Jun 6, 2024
1 parent 4bb20f0 commit 723f7f7
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
4 changes: 3 additions & 1 deletion bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ let prove_mode_conv =

let parse_cmdline =
let aux files solver prover_mode debug print_statistics =
let module Mappings = (val mappings_of_solver solver : Mappings_intf.S) in
let module Mappings =
(val mappings_of_solver solver : Mappings_intf.S_with_fresh)
in
Mappings.set_debug debug;
let module Solver =
( val match prover_mode with
Expand Down
2 changes: 1 addition & 1 deletion lib/bitwuzla_mappings.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
(***************************************************************************)

(** @inline *)
include Mappings_intf.S
include Mappings_intf.S_with_fresh
2 changes: 1 addition & 1 deletion lib/colibri2_mappings.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
(* along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(***************************************************************************)

include Mappings_intf.S
include Mappings_intf.S_with_fresh
2 changes: 1 addition & 1 deletion lib/cvc5_mappings.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
(***************************************************************************)

(** @inline *)
include Mappings_intf.S
include Mappings_intf.S_with_fresh
6 changes: 5 additions & 1 deletion lib/mappings.nop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,8 @@ end

module Impl' : M = Impl

include Mappings.Make (Impl)
module Fresh = struct
module Make () = Mappings.Make (Impl)
end

include Fresh.Make ()
8 changes: 8 additions & 0 deletions lib/mappings_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -447,3 +447,11 @@ module type S = sig
val pp_statistics : Format.formatter -> optimize -> unit
end
end

module type S_with_fresh = sig
module Fresh : sig
module Make () : S
end

include S
end
3 changes: 2 additions & 1 deletion lib/solver_dispatcher.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ type solver_type =
| Colibri2_solver
| Bitwuzla_solver

let mappings_of_solver : solver_type -> (module Mappings_intf.S) = function
let mappings_of_solver : solver_type -> (module Mappings_intf.S_with_fresh) =
function
| Z3_solver -> (module Z3_mappings)
| Cvc5_solver -> (module Cvc5_mappings)
| Colibri2_solver -> (module Colibri2_mappings)
Expand Down
6 changes: 1 addition & 5 deletions lib/z3_mappings.mli
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,5 @@
(* along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(***************************************************************************)

module Fresh : sig
module Make () : Mappings_intf.S
end

(** @inline *)
include Mappings_intf.S
include Mappings_intf.S_with_fresh

0 comments on commit 723f7f7

Please sign in to comment.