mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 20:38:43 +00:00
Add Z3_solver_interrupt to OCaml API (#6976)
This commit is contained in:
parent
91c2139b5d
commit
3af2b36cd7
|
@ -62,6 +62,9 @@ let mk_context (settings:(string * string) list) =
|
|||
Z3native.enable_concurrent_dec_ref res;
|
||||
res
|
||||
|
||||
let interrupt (ctx:context) =
|
||||
Z3native.interrupt ctx
|
||||
|
||||
module Symbol =
|
||||
struct
|
||||
type symbol = Z3native.symbol
|
||||
|
@ -1916,6 +1919,9 @@ struct
|
|||
let add_simplifier = Z3native.solver_add_simplifier
|
||||
let translate x = Z3native.solver_translate (gc x) x
|
||||
let to_string x = Z3native.solver_to_string (gc x) x
|
||||
|
||||
let interrupt (ctx:context) (s:solver) =
|
||||
Z3native.solver_interrupt ctx s
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -48,6 +48,12 @@ type context
|
|||
*)
|
||||
val mk_context : (string * string) list -> context
|
||||
|
||||
(** Interrupt the execution of a Z3 procedure.
|
||||
|
||||
This procedure can be used to interrupt: solvers, simplifiers and tactics.
|
||||
Note: Tactic.interrupt is an alias for this. *)
|
||||
val interrupt: context -> unit
|
||||
|
||||
(** Interaction logging for Z3
|
||||
Interaction logs are used to record calls into the API into a text file.
|
||||
The text file can be replayed using z3. It has to be the same version of z3
|
||||
|
@ -3342,6 +3348,15 @@ sig
|
|||
|
||||
(** A string representation of the solver. *)
|
||||
val to_string : solver -> string
|
||||
|
||||
(** Solver local interrupt.
|
||||
|
||||
Normally you should use Z3_interrupt to cancel solvers because only
|
||||
one solver is enabled concurrently per context.
|
||||
However, per GitHub issue #1006, there are use cases where
|
||||
it is more convenient to cancel a specific solver. Solvers
|
||||
that are not selected for interrupts are left alone.*)
|
||||
val interrupt: context -> solver -> unit
|
||||
end
|
||||
|
||||
(** Fixedpoint solving *)
|
||||
|
|
Loading…
Reference in a new issue