public interface FloatingPointFormulaManager
Most operations are overloaded: there is an option of either using the default rounding mode
(set via the option solver.floatingPointRoundingMode), or providing the rounding mode
explicitly.
FloatingPointFormula makeNumber(double n, FormulaType.FloatingPointType type)
FloatingPointFormula makeNumber(double n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula makeNumber(BigDecimal n, FormulaType.FloatingPointType type)
FloatingPointFormula makeNumber(BigDecimal n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula makeNumber(String n, FormulaType.FloatingPointType type)
FloatingPointFormula makeNumber(String n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula makeNumber(Rational n, FormulaType.FloatingPointType type)
FloatingPointFormula makeNumber(Rational n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula makeVariable(String pVar, FormulaType.FloatingPointType type)
Please make sure that the given name is valid in SMT-LIB2. Take a look at FormulaManager.isValidName(java.lang.String) for further information.
This method does not quote or unquote the given name, but uses the plain name "AS IS".
Formula.toString() can return a different String than the given one.
FloatingPointFormula makePlusInfinity(FormulaType.FloatingPointType type)
FloatingPointFormula makeMinusInfinity(FormulaType.FloatingPointType type)
FloatingPointFormula makeNaN(FormulaType.FloatingPointType type)
<T extends Formula> T castTo(FloatingPointFormula number, FormulaType<T> targetType)
<T extends Formula> T castTo(FloatingPointFormula number, FormulaType<T> targetType, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType)
FloatingPointFormula from another compatible formula. This method uses the
default rounding mode.
Compatible formula types are all numeral types and bitvector types. It is also possible to cast a floating-point number into another floating-point type. We do not support casting from boolean or array types. We try to keep an exact representation, however fall back to rounding if needed.
source - the source formula of compatible typesigned - if a BitvectorFormula is given as source, we additionally use this flag.
Otherwise we ignore it.targetType - the type of the resulting formulaIllegalArgumentException - if an incompatible type is used, e.g. a BooleanFormula
cannot be cast to FloatingPointFormula.FloatingPointFormula castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula from another compatible formula.
Compatible formula types are all numeral types and bitvector types. It is also possible to cast a floating-point number into another floating-point type. We do not support casting from boolean or array types. We try to keep an exact representation, however fall back to rounding if needed.
source - the source formula of compatible typesigned - if a BitvectorFormula is given as source, we additionally use this flag.
Otherwise we ignore it.targetType - the type of the resulting formulapFloatingPointRoundingMode - if rounding is needed, we apply the rounding mode.IllegalArgumentException - if an incompatible type is used, e.g. a BooleanFormula
cannot be cast to FloatingPointFormula.FloatingPointFormula fromIeeeBitvector(BitvectorFormula number, FormulaType.FloatingPointType pTargetType)
Note: This method will return a value that is (numerically) far away from the original
value. This method is completely different from castFrom(org.sosy_lab.java_smt.api.Formula, boolean, org.sosy_lab.java_smt.api.FormulaType.FloatingPointType), which will produce a
floating-point value close to the numeral value.
BitvectorFormula toIeeeBitvector(FloatingPointFormula number)
FloatingPointFormula round(FloatingPointFormula formula, FloatingPointRoundingMode roundingMode)
FloatingPointFormula negate(FloatingPointFormula number)
FloatingPointFormula add(FloatingPointFormula number1, FloatingPointFormula number2)
FloatingPointFormula add(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula subtract(FloatingPointFormula number1, FloatingPointFormula number2)
FloatingPointFormula subtract(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula divide(FloatingPointFormula number1, FloatingPointFormula number2)
FloatingPointFormula divide(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode)
FloatingPointFormula multiply(FloatingPointFormula number1, FloatingPointFormula number2)
FloatingPointFormula multiply(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode)
BooleanFormula assignment(FloatingPointFormula number1, FloatingPointFormula number2)
equal for other
theories.BooleanFormula equalWithFPSemantics(FloatingPointFormula number1, FloatingPointFormula number2)
assignment(FloatingPointFormula, FloatingPointFormula).BooleanFormula greaterThan(FloatingPointFormula number1, FloatingPointFormula number2)
BooleanFormula greaterOrEquals(FloatingPointFormula number1, FloatingPointFormula number2)
BooleanFormula lessThan(FloatingPointFormula number1, FloatingPointFormula number2)
BooleanFormula lessOrEquals(FloatingPointFormula number1, FloatingPointFormula number2)
BooleanFormula isNaN(FloatingPointFormula number)
BooleanFormula isInfinity(FloatingPointFormula number)
BooleanFormula isZero(FloatingPointFormula number)
BooleanFormula isNormal(FloatingPointFormula number)
BooleanFormula isSubnormal(FloatingPointFormula number)
BooleanFormula isNegative(FloatingPointFormula number)