File tree Expand file tree Collapse file tree 7 files changed +16
-17
lines changed
Expand file tree Collapse file tree 7 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,6 @@ module Z3 :
143143 val get_sat_model :
144144 ?symbols:Symbol.t list ->
145145 t -> Expr.Set.t -> [ `Model of Model.t | `Unknown | `Unsat ]
146- val cache_hits : unit -> int
147- val cache_misses : unit -> int
148146 end
149147# let solver = Z3.create ();;
150148val solver : Z3.t = <abstr>
Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ module Z3 :
5252 ?symbols:Smtml.Symbol.t list ->
5353 t ->
5454 Smtml.Expr.Set.t -> [ `Model of Smtml.Model.t | `Unknown | `Unsat ]
55- val cache_hits : unit -> int
56- val cache_misses : unit -> int
5755 end
5856# let solver = Z3.create ();;
5957val solver : Z3.t = <abstr>
Original file line number Diff line number Diff line change @@ -224,8 +224,7 @@ module M = struct
224224 let interrupt _ =
225225 Fmt. failwith " Altergo_mappings: interrupt is not implemented"
226226
227- let get_statistics _ =
228- Fmt. failwith " Altergo_mappings: get_statistics is not implemented"
227+ let get_statistics _ = Statistics.Map. empty
229228
230229 let pp_statistics _fmt _solver = ()
231230 end
Original file line number Diff line number Diff line change @@ -552,8 +552,7 @@ module Fresh_bitwuzla (B : Bitwuzla_cxx.S) : M = struct
552552 (* does nothing *)
553553 ()
554554
555- let get_statistics _ =
556- Fmt. failwith " Bitwuzla_mappings: Solver.get_statistics not implemented"
555+ let get_statistics _ = Statistics.Map. empty
557556
558557 let pp_statistics fmt solver = Solver. pp_statistics fmt solver
559558 end
Original file line number Diff line number Diff line change @@ -206,8 +206,7 @@ module M = struct
206206
207207 let interrupt _ = ()
208208
209- let get_statistics _ =
210- Fmt. failwith " Colibri2_mappings: Solver.get_statistics not implemented"
209+ let get_statistics _ = Statistics.Map. empty
211210
212211 let pp_statistics _fmt _solver = ()
213212 end
Original file line number Diff line number Diff line change @@ -561,11 +561,9 @@ module Fresh_cvc5 () = struct
561561
562562 let interrupt _ = ()
563563
564- let get_statistics _ =
565- Fmt. failwith " Cvc5_mappings: Solver.get_statistics not implemented!"
564+ let get_statistics _ = Statistics.Map. empty
566565
567- let pp_statistics _ =
568- Fmt. failwith " Cvc5_mappings: Solver.pp_statistics not implemented!"
566+ let pp_statistics _ _ = ()
569567 end
570568
571569 (* Not supported *)
Original file line number Diff line number Diff line change @@ -44,12 +44,20 @@ module Make (M : Mappings_intf.S_with_fresh) = struct
4444 let solver = Cached. create ~logic: LIA () in
4545 let x = Infix. symbol " x" Ty_int in
4646 let c = Infix. (Int. (x > = int 0 )) in
47- assert (Cached. cache_hits () = 0 );
47+ let get_stat key =
48+ let stats = Cached. get_statistics solver in
49+ let stat = Statistics.Map. find_opt key stats in
50+ match stat with
51+ (* we're using this for cache hitrate so it's always `Int *)
52+ | Some (`Int s ) -> s
53+ | _ -> Fmt. failwith " %s should exist and be an int in stats" key
54+ in
55+ assert (get_stat " cache hits" = 0 );
4856 assert_sat (Cached. check_set solver @@ Expr.Set. singleton c);
4957 assert_sat (Cached. check_set solver @@ Expr.Set. singleton c);
5058 assert_sat (Cached. check_set solver @@ Expr.Set. singleton c);
51- assert (Cached. cache_misses () = 1 );
52- assert (Cached. cache_hits () = 2 )
59+ assert (get_stat " cache misses " = 1 );
60+ assert (get_stat " cache hits " = 2 )
5361
5462 let test_cache_get_model _ =
5563 let open Infix in
You can’t perform that action at this time.
0 commit comments