3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

add ocaml signature for simplifier

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-01-31 18:58:18 -08:00
parent 550619bfcf
commit 4c6d44f974
2 changed files with 66 additions and 0 deletions

View file

@ -1734,6 +1734,34 @@ struct
let interrupt = Z3native.interrupt
end
module Simplifier =
struct
type simplifier = Z3native.simplifier
let gc = Z3native.context_of_simplifier
let mk_simplifier = Z3native.mk_simplifier
let get_num_simplifiers = Z3native.get_num_simplifiers
let get_simplifier_names (ctx:context) =
let n = get_num_simplifiers ctx in
let f i = Z3native.get_simplifier_name ctx i in
mk_list f n
let get_help (x:simplifier) = Z3native.simplifier_get_help (gc x) x
let get_param_descrs (x:simplifier) = Z3native.simplifier_get_param_descrs (gc x) x
let and_then (ctx:context) (t1:simplifier) (t2:simplifier) (ts:simplifier list) =
let f p c = (match p with
| None -> Some c
| Some(x) -> Some (Z3native.simplifier_and_then ctx c x)) in
match (List.fold_left f None ts) with
| None -> Z3native.simplifier_and_then ctx t1 t2
| Some(x) -> let o = Z3native.simplifier_and_then ctx t2 x in
Z3native.simplifier_and_then ctx t1 o
let using_params = Z3native.simplifier_using_params
let with_ = using_params
end
module Statistics =
struct
@ -1868,6 +1896,7 @@ struct
let mk_solver_s ctx logic = mk_solver ctx (Some (Symbol.mk_string ctx logic))
let mk_simple_solver = Z3native.mk_simple_solver
let mk_solver_t = Z3native.mk_solver_from_tactic
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
end

View file

@ -3102,6 +3102,40 @@ sig
val interrupt : context -> unit
end
moduls Simplifier :
sig
type simplifier
(** A string containing a description of parameters accepted by the simplifier. *)
val get_help : simplifier -> string
(** Retrieves parameter descriptions for Simplifiers. *)
val get_param_descrs : simplifier -> Params.ParamDescrs.param_descrs
(** Apply the simplifier to the goal. *)
val apply : simplifier -> Goal.goal -> Params.params option -> ApplyResult.apply_result
(** The number of supported simplifiers. *)
val get_num_simplifiers : context -> int
(** The names of all supported simplifiers. *)
val get_simplifier_names : context -> string list
(** Returns a string containing a description of the simplifier with the given name. *)
val get_simplifier_description : context -> string -> string
(** Creates a new Simplifier. *)
val mk_simplifier : context -> string -> simplifier
(** Create a simplifier that applies one simplifier to a Goal and
then another one to every subgoal produced by the first one. *)
val and_then : context -> simplifier -> simplifier -> simplifier list -> simplifier
(** Create a simplifier that applies a simplifier using the given set of parameters. *)
val using_params : context -> simplifier -> Params.params -> simplifier
end
(** Objects that track statistical information. *)
module Statistics :
sig
@ -3265,6 +3299,9 @@ sig
will always solve each check from scratch. *)
val mk_solver_t : context -> Tactic.tactic -> solver
(** Create a solver with simplifying pre-processing **)
val add_simplifier : context -> solver -> Simplifier.simplifier -> solver
(** Create a clone of the current solver with respect to a context. *)
val translate : solver -> context -> solver