3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-20 21:03:39 +00:00

Bugfix for ML API

This commit is contained in:
Christoph M. Wintersteiger 2015-12-07 14:42:40 +00:00
parent cfc25b5094
commit 2a0bbad524

View file

@ -813,16 +813,26 @@ end = struct
let s = Z3native.get_sort (context_gno ctx) no in let s = Z3native.get_sort (context_gno ctx) no in
let sk = (sort_kind_of_int (Z3native.get_sort_kind (context_gno ctx) s)) in let sk = (sort_kind_of_int (Z3native.get_sort_kind (context_gno ctx) s)) in
if (Z3native.is_algebraic_number (context_gno ctx) no) then if (Z3native.is_algebraic_number (context_gno ctx) no) then
Expr(z3_native_object_of_ast_ptr ctx no) Expr(z3_native_object_of_ast_ptr ctx no)
else else
if (Z3native.is_numeral_ast (context_gno ctx) no) then if (Z3native.is_numeral_ast (context_gno ctx) no) then
if (sk == INT_SORT || sk == REAL_SORT || sk == BV_SORT || match sk with
sk == FLOATING_POINT_SORT || sk == ROUNDING_MODE_SORT) then | REAL_SORT
Expr(z3_native_object_of_ast_ptr ctx no) | BOOL_SORT
else | ARRAY_SORT
raise (Z3native.Exception "Unsupported numeral object") | BV_SORT
else | ROUNDING_MODE_SORT
Expr(z3_native_object_of_ast_ptr ctx no) | RELATION_SORT
| UNINTERPRETED_SORT
| FLOATING_POINT_SORT
| INT_SORT
| DATATYPE_SORT
| FINITE_DOMAIN_SORT ->
Expr(z3_native_object_of_ast_ptr ctx no)
| _ ->
raise (Z3native.Exception "Unsupported numeral object")
else
Expr(z3_native_object_of_ast_ptr ctx no)
let expr_of_ast a = let expr_of_ast a =
let q = (Z3enums.ast_kind_of_int (Z3native.get_ast_kind (z3obj_gnc a) (z3obj_gno a))) in let q = (Z3enums.ast_kind_of_int (Z3native.get_ast_kind (z3obj_gnc a) (z3obj_gno a))) in