/// <summary> /// Translates an ASTVector into a FPRMExpr[] /// </summary> public FPRMExpr[] ToFPRMExprArray() { uint n = Size; FPRMExpr[] res = new FPRMExpr[n]; for (uint i = 0; i < n; i++) { res[i] = (FPRMExpr)Expr.Create(this.Context, this[i].NativeObject); } return(res); }
/// <summary> /// Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort. /// </summary> /// <remarks> /// Produces a term that represents the conversion of sig * 2^exp into a /// floating-point term of sort s. If necessary, the result will be rounded /// according to rounding mode rm. /// </remarks> /// <param name="rm">RoundingMode term.</param> /// <param name="exp">Exponent term of Int sort.</param> /// <param name="sig">Significand term of Real sort.</param> /// <param name="s">FloatingPoint sort.</param> public BitVecExpr MkFPToFP(FPRMExpr rm, IntExpr exp, RealExpr sig, FPSort s) { Contract.Ensures(Contract.Result<BitVecExpr>() != null); return new BitVecExpr(this, Native.Z3_mk_fpa_to_fp_int_real(this.nCtx, rm.NativeObject, exp.NativeObject, sig.NativeObject, s.NativeObject)); }
/// <summary> /// Conversion of a floating-point number to another FloatingPoint sort s. /// </summary> /// <remarks> /// Produces a term that represents the conversion of a floating-point term t to a different /// FloatingPoint sort s. If necessary, rounding according to rm is applied. /// </remarks> /// <param name="s">FloatingPoint sort</param> /// <param name="rm">floating-point rounding mode term</param> /// <param name="t">floating-point term</param> public FPExpr MkFPToFP(FPSort s, FPRMExpr rm, FPExpr t) { Contract.Ensures(Contract.Result<FPExpr>() != null); return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, s.NativeObject, rm.NativeObject, t.NativeObject)); }
/// <summary> /// Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort. /// </summary> /// <remarks> /// Produces a term that represents the conversion of the bit-vector term t into a /// floating-point term of sort s. The bit-vector t is taken to be in signed /// 2's complement format (when signed==true, otherwise unsigned). If necessary, the /// result will be rounded according to rounding mode rm. /// </remarks> /// <param name="rm">RoundingMode term.</param> /// <param name="t">term of bit-vector sort.</param> /// <param name="s">FloatingPoint sort.</param> /// <param name="signed">flag indicating whether t is interpreted as signed or unsigned bit-vector.</param> public FPExpr MkFPToFP(FPRMExpr rm, BitVecExpr t, FPSort s, bool signed) { Contract.Ensures(Contract.Result<FPExpr>() != null); if (signed) return new FPExpr(this, Native.Z3_mk_fpa_to_fp_signed(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject)); else return new FPExpr(this, Native.Z3_mk_fpa_to_fp_unsigned(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject)); }
/// <summary> /// Conversion of a floating-point term into a bit-vector. /// </summary> /// <remarks> /// Produces a term that represents the conversion of the floating-poiunt term t into a /// bit-vector term of size sz in 2's complement format (signed when signed==true). If necessary, /// the result will be rounded according to rounding mode rm. /// </remarks> /// <param name="rm">RoundingMode term.</param> /// <param name="t">FloatingPoint term</param> /// <param name="sz">Size of the resulting bit-vector.</param> /// <param name="signed">Indicates whether the result is a signed or unsigned bit-vector.</param> public BitVecExpr MkFPToBV(FPRMExpr rm, FPExpr t, uint sz, bool signed) { Contract.Ensures(Contract.Result<BitVecExpr>() != null); if (signed) return new BitVecExpr(this, Native.Z3_mk_fpa_to_sbv(this.nCtx, rm.NativeObject, t.NativeObject, sz)); else return new BitVecExpr(this, Native.Z3_mk_fpa_to_ubv(this.nCtx, rm.NativeObject, t.NativeObject, sz)); }
/// <summary> /// Floating-point subtraction /// </summary> /// <param name="rm">rounding mode term</param> /// <param name="t1">floating-point term</param> /// <param name="t2">floating-point term</param> public FPExpr MkFPSub(FPRMExpr rm, FPExpr t1, FPExpr t2) { Contract.Ensures(Contract.Result<FPNum>() != null); return new FPExpr(this, Native.Z3_mk_fpa_sub(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject)); }
/// <summary> /// Floating-point roundToIntegral. Rounds a floating-point number to /// the closest integer, again represented as a floating-point number. /// </summary> /// <param name="rm">term of RoundingMode sort</param> /// <param name="t">floating-point term</param> public FPExpr MkFPRoundToIntegral(FPRMExpr rm, FPExpr t) { Contract.Ensures(Contract.Result<FPNum>() != null); return new FPExpr(this, Native.Z3_mk_fpa_round_to_integral(this.nCtx, rm.NativeObject, t.NativeObject)); }
/// <summary> /// Translates an ASTVector into a FPRMExpr[] /// </summary> public FPRMExpr[] ToFPRMExprArray() { uint n = Size; FPRMExpr[] res = new FPRMExpr[n]; for (uint i = 0; i < n; i++) res[i] = (FPRMExpr)Expr.Create(this.Context, this[i].NativeObject); return res; }