mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 12:28:44 +00:00
Eliminated FPRMNum classes
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
71912830f1
commit
46e236487b
|
@ -3456,91 +3456,91 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRoundNearestTiesToEven()
|
||||
public FPRMExpr MkFPRoundNearestTiesToEven()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_round_nearest_ties_to_even(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_round_nearest_ties_to_even(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRNE()
|
||||
public FPRMExpr MkFPRNE()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_rne(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_rne(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRoundNearestTiesToAway()
|
||||
public FPRMExpr MkFPRoundNearestTiesToAway()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_round_nearest_ties_to_away(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_round_nearest_ties_to_away(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRNA()
|
||||
public FPRMExpr MkFPRNA()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_rna(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_rna(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRoundTowardPositive()
|
||||
public FPRMExpr MkFPRoundTowardPositive()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_positive(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_round_toward_positive(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRTP()
|
||||
public FPRMExpr MkFPRTP()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_rtp(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_rtp(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRoundTowardNegative()
|
||||
public FPRMExpr MkFPRoundTowardNegative()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_negative(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_round_toward_negative(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRTN()
|
||||
public FPRMExpr MkFPRTN()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_rtn(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_rtn(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRoundTowardZero()
|
||||
public FPRMExpr MkFPRoundTowardZero()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_zero(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_round_toward_zero(nCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
|
||||
/// </summary>
|
||||
public FPRMNum MkFPRTZ()
|
||||
public FPRMExpr MkFPRTZ()
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
return new FPRMNum(this, Native.Z3_mk_fpa_rtz(nCtx));
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPRMExpr(this, Native.Z3_mk_fpa_rtz(nCtx));
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
@ -3637,7 +3637,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNaN(FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_nan(nCtx, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3648,7 +3648,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="negative">indicates whether the result should be negative.</param>
|
||||
public FPNum MkFPInf(FPSort s, bool negative)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_inf(nCtx, s.NativeObject, negative ? 1 : 0));
|
||||
}
|
||||
|
||||
|
@ -3659,7 +3659,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="negative">indicates whether the result should be negative.</param>
|
||||
public FPNum MkFPZero(FPSort s, bool negative)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_zero(nCtx, s.NativeObject, negative ? 1 : 0));
|
||||
}
|
||||
|
||||
|
@ -3670,7 +3670,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNumeral(float v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_numeral_float(nCtx, v, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3681,7 +3681,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNumeral(double v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_numeral_double(nCtx, v, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3692,7 +3692,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNumeral(int v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_numeral_int(nCtx, v, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3705,7 +3705,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNumeral(bool sgn, uint sig, int exp, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_numeral_uint_int(nCtx, sgn ? 1 : 0, sig, exp, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3718,7 +3718,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFPNumeral(bool sgn, UInt64 sig, Int64 exp, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return new FPNum(this, Native.Z3_mk_fpa_numeral_uint64_int64(nCtx, sgn ? 1 : 0, sig, exp, s.NativeObject));
|
||||
}
|
||||
|
||||
|
@ -3729,7 +3729,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFP(float v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return MkFPNumeral(v, s);
|
||||
}
|
||||
|
||||
|
@ -3740,7 +3740,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFP(double v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return MkFPNumeral(v, s);
|
||||
}
|
||||
|
||||
|
@ -3751,7 +3751,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFP(int v, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return MkFPNumeral(v, s);
|
||||
}
|
||||
|
||||
|
@ -3764,7 +3764,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFP(bool sgn, uint sig, int exp, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return MkFPNumeral(sgn, sig, exp, s);
|
||||
}
|
||||
|
||||
|
@ -3777,7 +3777,7 @@ namespace Microsoft.Z3
|
|||
/// <param name="s">FloatingPoint sort.</param>
|
||||
public FPNum MkFP(bool sgn, UInt64 sig, Int64 exp, FPSort s)
|
||||
{
|
||||
Contract.Ensures(Contract.Result<FPRMNum>() != null);
|
||||
Contract.Ensures(Contract.Result<FPRMExpr>() != null);
|
||||
return MkFPNumeral(sgn, sig, exp, s);
|
||||
}
|
||||
|
||||
|
|
|
@ -1475,57 +1475,57 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRoundNearestTiesToEven{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
public bool IsFPRMRoundNearestTiesToEven{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRoundNearestTiesToAway{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
public bool IsFPRMRoundNearestTiesToAway{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRoundTowardNegative{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
public bool IsFPRMRoundTowardNegative{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRoundTowardPositive{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
public bool IsFPRMRoundTowardPositive{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRoundTowardZero{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
public bool IsFPRMRoundTowardZero{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRNE{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
public bool IsFPRMExprRNE{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
public bool IsFPRMExprRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRTN { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
public bool IsFPRMExprRTN { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRTP { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
public bool IsFPRMExprRTP { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool IsFPRMNumRTZ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
public bool IsFPRMExprRTZ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is a floating-point rounding mode numeral
|
||||
/// </summary>
|
||||
public bool IsFPRMNum {
|
||||
public bool IsFPRMExpr {
|
||||
get {
|
||||
return IsApp &&
|
||||
(FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY||
|
||||
|
@ -1809,7 +1809,7 @@ namespace Microsoft.Z3
|
|||
case Z3_sort_kind.Z3_REAL_SORT: return new RatNum(ctx, obj);
|
||||
case Z3_sort_kind.Z3_BV_SORT: return new BitVecNum(ctx, obj);
|
||||
case Z3_sort_kind.Z3_FLOATING_POINT_SORT: return new FPNum(ctx, obj);
|
||||
case Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new FPRMNum(ctx, obj);
|
||||
case Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new FPRMExpr(ctx, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,56 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public class FPRMExpr : Expr
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool isRoundNearestTiesToEven { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool isRNE { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool isRoundNearestTiesToAway { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool isRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool isRoundTowardPositive { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool isRTP { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool isRoundTowardNegative { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool isRTN { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool isRoundTowardZero { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool isRTZ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
#region Internal
|
||||
/// <summary> Constructor for FPRMExpr </summary>
|
||||
internal FPRMExpr(Context ctx, IntPtr obj)
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2013 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
FPRMNum.cs
|
||||
|
||||
Abstract:
|
||||
|
||||
Z3 Managed API: Floating Point Rounding Mode Numerals
|
||||
|
||||
Author:
|
||||
|
||||
Christoph Wintersteiger (cwinter) 2013-06-10
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
namespace Microsoft.Z3
|
||||
{
|
||||
/// <summary>
|
||||
/// FloatingPoint RoundingMode Numerals
|
||||
/// </summary>
|
||||
[ContractVerification(true)]
|
||||
public class FPRMNum : FPRMExpr
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool isRoundNearestTiesToEven { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||
/// </summary>
|
||||
public bool isRNE { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool isRoundNearestTiesToAway { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||
/// </summary>
|
||||
public bool isRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool isRoundTowardPositive { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardPositive
|
||||
/// </summary>
|
||||
public bool isRTP { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool isRoundTowardNegative { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||
/// </summary>
|
||||
public bool isRTN { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_NEGATIVE; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool isRoundTowardZero { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardZero
|
||||
/// </summary>
|
||||
public bool isRTZ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO; } }
|
||||
|
||||
#region Internal
|
||||
internal FPRMNum(Context ctx, IntPtr obj)
|
||||
: base(ctx, obj)
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of the numeral.
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return Native.Z3_get_numeral_string(Context.nCtx, NativeObject);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2865,90 +2865,90 @@ public class Context extends IDisposable
|
|||
* Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
* @throws Z3Exception on error
|
||||
**/
|
||||
public FPRMNum mkFPRoundNearestTiesToEven() throws Z3Exception
|
||||
public FPRMExpr mkFPRoundNearestTiesToEven() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRoundNearestTiesToEven(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRoundNearestTiesToEven(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRNE() throws Z3Exception
|
||||
public FPRMExpr mkFPRNE() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRne(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRne(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRoundNearestTiesToAway() throws Z3Exception
|
||||
public FPRMExpr mkFPRoundNearestTiesToAway() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRoundNearestTiesToAway(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRoundNearestTiesToAway(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRNA() throws Z3Exception
|
||||
public FPRMExpr mkFPRNA() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRna(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRna(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRoundTowardPositive() throws Z3Exception
|
||||
public FPRMExpr mkFPRoundTowardPositive() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRoundTowardPositive(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRoundTowardPositive(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRTP() throws Z3Exception
|
||||
public FPRMExpr mkFPRTP() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRtp(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRtp(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRoundTowardNegative() throws Z3Exception
|
||||
public FPRMExpr mkFPRoundTowardNegative() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRoundTowardNegative(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRoundTowardNegative(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRTN() throws Z3Exception
|
||||
public FPRMExpr mkFPRTN() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRtn(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRtn(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRoundTowardZero() throws Z3Exception
|
||||
public FPRMExpr mkFPRoundTowardZero() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRoundTowardZero(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRoundTowardZero(nCtx()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
public FPRMNum mkFPRTZ() throws Z3Exception
|
||||
public FPRMExpr mkFPRTZ() throws Z3Exception
|
||||
{
|
||||
return new FPRMNum(this, Native.mkFpaRtz(nCtx()));
|
||||
return new FPRMExpr(this, Native.mkFpaRtz(nCtx()));
|
||||
}
|
||||
|
||||
/** FloatingPoint Sorts **/
|
||||
|
|
|
@ -2140,8 +2140,6 @@ public class Expr extends AST
|
|||
return new BitVecNum(ctx, obj);
|
||||
case Z3_FLOATING_POINT_SORT:
|
||||
return new FPNum(ctx, obj);
|
||||
case Z3_ROUNDING_MODE_SORT:
|
||||
return new FPRMNum(ctx, obj);
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue