3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 03:15:50 +00:00

Added accessors to extract sign/exponent/significand BV numerals from FP numerals.

This commit is contained in:
Christoph M. Wintersteiger 2016-09-16 16:48:22 +01:00
parent 5716eaafed
commit 6b474adc8a
7 changed files with 246 additions and 5 deletions

View file

@ -21,6 +21,33 @@ package com.microsoft.z3;
*/
public class FPNum extends FPExpr
{
/**
* The sign of a floating-point numeral as a bit-vector expression
* Remarks: NaN's do not have a bit-vector sign, so they are invalid arguments.
* @throws Z3Exception
*/
public BitVecExpr getBVSign() {
return new BitVecExpr(getContext(), Native.fpaGetNumeralSignBv(getContext().nCtx(), getNativeObject()));
}
/**
* The exponent of a floating-point numeral as a bit-vector expression
* Remarks: +oo, -oo, and NaN's do not have a bit-vector exponent, so they are invalid arguments.
* @throws Z3Exception
*/
public BitVecExpr getBVExponent() {
return new BitVecExpr(getContext(), Native.fpaGetNumeralExponentBv(getContext().nCtx(), getNativeObject()));
}
/**
* The significand of a floating-point numeral as a bit-vector expression
* Remarks: +oo, -oo, and NaN's do not have a bit-vector significand, so they are invalid arguments.
* @throws Z3Exception
*/
public BitVecExpr getBVSignificand() {
return new BitVecExpr(getContext(), Native.fpaGetNumeralSignificandBv(getContext().nCtx(), getNativeObject()));
}
/**
* Retrieves the sign of a floating-point literal
* Remarks: returns true if the numeral is negative