mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
FPA API: bugfixes and examples for .NET and Java
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
fa26e2423e
commit
0faf329054
5 changed files with 165 additions and 48 deletions
|
@ -649,23 +649,21 @@ extern "C" {
|
|||
Z3_CATCH_RETURN(0);
|
||||
}
|
||||
|
||||
unsigned int Z3_API Z3_mk_fpa_get_ebits(Z3_context c, Z3_sort s) {
|
||||
unsigned Z3_API Z3_fpa_get_ebits(Z3_context c, Z3_sort s) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_mk_fpa_get_ebits(c, s);
|
||||
LOG_Z3_fpa_get_ebits(c, s);
|
||||
RESET_ERROR_CODE();
|
||||
api::context * ctx = mk_c(c);
|
||||
unsigned r = ctx->float_util().get_ebits(to_sort(s));
|
||||
RETURN_Z3(r);
|
||||
CHECK_NON_NULL(s, 0);
|
||||
return mk_c(c)->float_util().get_ebits(to_sort(s));
|
||||
Z3_CATCH_RETURN(0);
|
||||
}
|
||||
|
||||
unsigned Z3_API Z3_mk_fpa_get_sbits(Z3_context c, Z3_sort s) {
|
||||
unsigned Z3_API Z3_fpa_get_sbits(Z3_context c, Z3_sort s) {
|
||||
Z3_TRY;
|
||||
LOG_Z3_mk_fpa_get_sbits(c, s);
|
||||
LOG_Z3_fpa_get_ebits(c, s);
|
||||
RESET_ERROR_CODE();
|
||||
api::context * ctx = mk_c(c);
|
||||
unsigned r = ctx->float_util().get_sbits(to_sort(s));
|
||||
RETURN_Z3(r);
|
||||
CHECK_NON_NULL(s, 0);
|
||||
return mk_c(c)->float_util().get_sbits(to_sort(s));
|
||||
Z3_CATCH_RETURN(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -3895,7 +3895,7 @@ namespace Microsoft.Z3
|
|||
/// the closest integer, again represented as a floating-point number.
|
||||
/// </summary>
|
||||
/// <param name="rm">term of RoundingMode sort</param>
|
||||
/// <param name="t2">floating-point term</param>
|
||||
/// <param name="t">floating-point term</param>
|
||||
public FPExpr MkFPRoundToIntegral(FPRMExpr rm, FPExpr t)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPNum>() != null);
|
||||
|
|
|
@ -1791,6 +1791,10 @@ public class Expr extends AST
|
|||
return new RatNum(ctx, obj);
|
||||
case Z3_BV_SORT:
|
||||
return new BitVecNum(ctx, obj);
|
||||
case Z3_FLOATING_POINT_SORT:
|
||||
return new FPNum(ctx, obj);
|
||||
case Z3_FLOATING_POINT_ROUNDING_MODE_SORT:
|
||||
return new FPRMNum(ctx, obj);
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
|
@ -1809,6 +1813,10 @@ public class Expr extends AST
|
|||
return new ArrayExpr(ctx, obj);
|
||||
case Z3_DATATYPE_SORT:
|
||||
return new DatatypeExpr(ctx, obj);
|
||||
case Z3_FLOATING_POINT_SORT:
|
||||
return new FPExpr(ctx, obj);
|
||||
case Z3_FLOATING_POINT_ROUNDING_MODE_SORT:
|
||||
return new FPRMExpr(ctx, obj);
|
||||
default: ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue