Skip to content

Commit b1721d3

Browse files
committed
Add a was_interrupted ref that indicates if Solver.interrupt was called on a solver or not
1 parent df9679f commit b1721d3

File tree

7 files changed

+18
-1
lines changed

7 files changed

+18
-1
lines changed

src/smtml/altergo_mappings.default.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ module M = struct
5151
let caches_consts = false
5252

5353
let is_available = true
54+
55+
let was_interrupted = ref false
5456
end
5557

5658
type handle

src/smtml/bitwuzla_mappings.default.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module Fresh_bitwuzla (B : Bitwuzla_cxx.S) : M = struct
1313
let caches_consts = false
1414

1515
let is_available = true
16+
17+
let was_interrupted = ref false
1618
end
1719

1820
type ty = Sort.t

src/smtml/colibri2_mappings.default.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module M = struct
2929
let caches_consts = false
3030

3131
let is_available = true
32+
33+
let was_interrupted = ref false
3234
end
3335

3436
type handle

src/smtml/cvc5_mappings.default.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module Fresh_cvc5 () = struct
1212
let caches_consts = false
1313

1414
let is_available = true
15+
16+
let was_interrupted = ref false
1517
end
1618

1719
type ty = Sort.sort

src/smtml/mappings.nop.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module Nop = struct
1010
let caches_consts = false
1111

1212
let is_available = false
13+
14+
let was_interrupted = ref false
1315
end
1416

1517
type ty = [ `Ty ]

src/smtml/mappings_intf.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ module type M = sig
100100

101101
(** [caches_consts] indicates whether the solver caches constants. *)
102102
val caches_consts : bool
103+
104+
(** [was_interrupted] indicates if the solver was interrupted. *)
105+
val was_interrupted : bool ref
103106
end
104107

105108
(** {2 Type Handling} *)

src/smtml/z3_mappings.default.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module M = struct
1414
let caches_consts = true
1515

1616
let is_available = true
17+
18+
let was_interrupted = ref false
1719
end
1820

1921
type ty = Z3.Sort.sort
@@ -602,7 +604,9 @@ module M = struct
602604
Z3.Simplifier.and_then ctx simplify solver_eqs then_
603605
|> Z3.Solver.add_simplifier ctx solver
604606

605-
let interrupt () = Z3.Tactic.interrupt ctx
607+
let interrupt () =
608+
Internals.was_interrupted := true;
609+
Z3.Tactic.interrupt ctx
606610

607611
let get_statistics solver =
608612
get_statistics (Z3.Solver.get_statistics solver)

0 commit comments

Comments
 (0)