3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-21 05:13:39 +00:00
This commit is contained in:
Christoph M. Wintersteiger 2016-03-04 17:07:20 +00:00
parent c9a5676346
commit 61525b9f5e

View file

@ -79,12 +79,10 @@ struct
let mk_string (ctx:context) (s:string) = (Z3native.mk_string_symbol ctx s)
let mk_ints (ctx:context) (names:int list) =
let f elem = mk_int (ctx:context ) elem in
(List.map f names)
List.map (fun x -> mk_int ctx x) names
let mk_strings (ctx:context) (names:string list) =
let f elem = mk_string (ctx:context) elem in
(List.map f names)
List.map (fun x -> mk_string ctx x) names
end
@ -406,8 +404,7 @@ end = struct
| PARAMETER_SORT -> Parameter.P_Srt (Z3native.get_decl_sort_parameter (gc x) x i)
| PARAMETER_AST -> Parameter.P_Ast (Z3native.get_decl_ast_parameter (gc x) x i)
| PARAMETER_FUNC_DECL -> Parameter.P_Fdl (Z3native.get_decl_func_decl_parameter (gc x) x i)
| PARAMETER_RATIONAL -> Parameter.P_Rat (Z3native.get_decl_rational_parameter (gc x) x i)
) in
| PARAMETER_RATIONAL -> Parameter.P_Rat (Z3native.get_decl_rational_parameter (gc x) x i)) in
mk_list f n
let apply (x:func_decl) (args:Expr.expr list) = Expr.expr_of_func_app (gc x) x args
@ -937,7 +934,6 @@ struct
let (_, _, c) = (Z3native.query_constructor (gc x) x (get_num_fields x)) in
let f i = Array.get c i in
mk_list f (Array.length c)
end
module ConstructorList =
@ -970,12 +966,7 @@ struct
mk_list g (Array.length r)
let mk_sorts_s (ctx:context) (names:string list) (c:Constructor.constructor list list) =
mk_sorts ctx
(
let f e = (Symbol.mk_string ctx e) in
List.map f names
)
c
mk_sorts ctx (List.map (fun x -> Symbol.mk_string ctx x) names) c
let get_num_constructors (x:Sort.sort) = Z3native.get_datatype_sort_num_constructors (Sort.gc x) x
@ -995,8 +986,7 @@ struct
let fd = Z3native.get_datatype_sort_constructor (Sort.gc x) x i in
let ds = Z3native.get_domain_size (FuncDecl.gc fd) fd in
let g j = Z3native.get_datatype_sort_constructor_accessor (Sort.gc x) x i j in
mk_list g ds
) in
mk_list g ds) in
mk_list f n
end
@ -1563,8 +1553,7 @@ struct
(List.fold_right
g
(FuncEntry.get_args c)
((if n > 1 then "]" else "") ^ " -> " ^ (Expr.to_string (FuncEntry.get_value c)) ^ ", "))
) in
((if n > 1 then "]" else "") ^ " -> " ^ (Expr.to_string (FuncEntry.get_value c)) ^ ", "))) in
List.fold_right f (get_entries x) ("else -> " ^ (Expr.to_string (get_else x)) ^ "]")
end
@ -1581,7 +1570,6 @@ struct
let get_const_interp_e (x:model) (a:expr) = get_const_interp x (Expr.get_func_decl a)
let rec get_func_interp (x:model) (f:func_decl) =
let sk = sort_kind_of_int (Z3native.get_sort_kind (gc x) (Z3native.get_range (FuncDecl.gc f) f)) in
if (FuncDecl.get_arity f) == 0 then
@ -1769,7 +1757,6 @@ struct
} in
res
let get_key (x:statistics_entry) = x.m_key
let get_int (x:statistics_entry) = x.m_int
let get_float (x:statistics_entry) = x.m_float
@ -1855,8 +1842,7 @@ struct
if ((List.length assumptions) == 0) then
lbool_of_int (Z3native.solver_check (gc x) x)
else
let f x = x in
lbool_of_int (Z3native.solver_check_assumptions (gc x) x (List.length assumptions) (Array.of_list (List.map f assumptions)))
lbool_of_int (Z3native.solver_check_assumptions (gc x) x (List.length assumptions) (Array.of_list assumptions))
in
match r with
| L_TRUE -> SATISFIABLE