3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 17:45:32 +00:00

Added conversion function for Goal to Expr conversion in .NET, Java, ML

This commit is contained in:
Christoph M. Wintersteiger 2015-06-10 13:17:34 +01:00
parent 98f2de3216
commit 004bf1471f
4 changed files with 43 additions and 0 deletions

View file

@ -2199,6 +2199,15 @@ struct
create ctx (Z3native.mk_goal (context_gno ctx) models unsat_cores proofs)
let to_string ( x : goal ) = Z3native.goal_to_string (z3obj_gnc x) (z3obj_gno x)
let as_expr ( x : goal ) =
let n = get_size x in
if n = 0 then
(Boolean.mk_true (z3obj_gc x))
else if n = 1 then
(List.hd (get_formulas x))
else
(Boolean.mk_and (z3obj_gc x) (get_formulas x))
end

View file

@ -2653,6 +2653,9 @@ sig
(** A string representation of the Goal. *)
val to_string : goal -> string
(** Goal to BoolExpr conversion. *)
val as_expr : goal -> Expr.expr
end
(** Models