예제 #1
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a floating-point zero of sort s.
 /// </summary>        
 /// <param name="s">FloatingPoint sort.</param>   
 /// <param name="negative">indicates whether the result should be negative.</param>
 public FPNum MkFPZero(FPSort s, bool negative)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return new FPNum(this, Native.Z3_mk_fpa_zero(nCtx, s.NativeObject, negative ? 1 : 0));
 }
예제 #2
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <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));
 }
예제 #3
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <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));
 }
예제 #4
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
 /// </summary>
 /// <remarks>
 /// Produces a term that represents the conversion of a bit-vector term bv to a 
 /// floating-point term of sort s. The bit-vector size of bv (m) must be equal 
 /// to ebits+sbits of s. The format of the bit-vector is as defined by the 
 /// IEEE 754-2008 interchange format.
 /// </remarks>
 /// <param name="bv">bit-vector value (of size m).</param>
 /// <param name="s">FloatingPoint sort (ebits+sbits == m)</param>
 public FPExpr MkFPToFP(BitVecExpr bv, FPSort s)
 {
     Contract.Ensures(Contract.Result<FPExpr>() != null);
     return new FPExpr(this, Native.Z3_mk_fpa_to_fp_bv(this.nCtx, bv.NativeObject, s.NativeObject));
 }
예제 #5
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <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));
 }
예제 #6
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
 /// </summary>        
 /// <param name="sgn">the sign.</param>
 /// <param name="sig">the significand.</param>
 /// <param name="exp">the exponent.</param>
 /// <param name="s">FloatingPoint sort.</param>        
 public FPNum MkFPNumeral(bool sgn, Int64 exp, UInt64 sig, FPSort s)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return new FPNum(this, Native.Z3_mk_fpa_numeral_int64_uint64(nCtx, sgn ? 1 : 0, exp, sig, s.NativeObject));
 }
예제 #7
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a numeral of FloatingPoint sort from an int.
 /// </summary>        
 /// <param name="v">numeral value.</param>
 /// <param name="s">FloatingPoint sort.</param>        
 public FPNum MkFPNumeral(int v, FPSort s)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return new FPNum(this, Native.Z3_mk_fpa_numeral_int(nCtx, v, s.NativeObject));
 }
예제 #8
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a NaN of sort s.
 /// </summary>        
 /// <param name="s">FloatingPoint sort.</param>        
 public FPNum MkFPNaN(FPSort s)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return new FPNum(this, Native.Z3_mk_fpa_nan(nCtx, s.NativeObject));
 }
예제 #9
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
 /// </summary>        
 /// <param name="sgn">the sign.</param>        
 /// <param name="exp">the exponent.</param>
 /// <param name="sig">the significand.</param>
 /// <param name="s">FloatingPoint sort.</param>        
 public FPNum MkFP(bool sgn, Int64 exp, UInt64 sig, FPSort s)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return MkFPNumeral(sgn, exp, sig, s);
 }
예제 #10
0
파일: Context.cs 프로젝트: hitmoon/z3
 /// <summary>
 /// Create a numeral of FloatingPoint sort from an int.
 /// </summary>        
 /// <param name="v">numeral value.</param>
 /// <param name="s">FloatingPoint sort.</param>        
 public FPNum MkFP(int v, FPSort s)
 {
     Contract.Ensures(Contract.Result<FPRMExpr>() != null);
     return MkFPNumeral(v, s);
 }