Class DebuggingFloatingPointFormulaManager
- All Implemented Interfaces:
FloatingPointFormulaManager
-
Constructor Summary
ConstructorsConstructorDescriptionDebuggingFloatingPointFormulaManager(FloatingPointFormulaManager pDelegate, org.sosy_lab.java_smt.delegate.debugging.DebuggingAssertions pDebugging) -
Method Summary
Modifier and TypeMethodDescriptionabs(FloatingPointFormula number) add(FloatingPointFormula number1, FloatingPointFormula number2) add(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) assignment(FloatingPointFormula number1, FloatingPointFormula number2) Create a term for assigning one floating-point term to another.castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType) Build aFloatingPointFormulafrom another compatible formula.castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType, FloatingPointRoundingMode pFloatingPointRoundingMode) Build aFloatingPointFormulafrom another compatible formula.<T extends Formula>
TcastTo(FloatingPointFormula source, boolean signed, FormulaType<T> targetType) Build a formula of compatible type from aFloatingPointFormula.<T extends Formula>
TcastTo(FloatingPointFormula source, boolean signed, FormulaType<T> targetType, FloatingPointRoundingMode pFloatingPointRoundingMode) Build a formula of compatible type from aFloatingPointFormula.divide(FloatingPointFormula number1, FloatingPointFormula number2) divide(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) equalWithFPSemantics(FloatingPointFormula number1, FloatingPointFormula number2) Create a term for comparing the equality of two floating-point terms, according to standard floating-point semantics (i.e., NaN != NaN).fromIeeeBitvector(BitvectorFormula number, FormulaType.FloatingPointType pTargetType) Create a formula that interprets the given bitvector as a floating-point value in the IEEE format, according to the given type.greaterOrEquals(FloatingPointFormula number1, FloatingPointFormula number2) greaterThan(FloatingPointFormula number1, FloatingPointFormula number2) isInfinity(FloatingPointFormula number) isNaN(FloatingPointFormula number) isNegative(FloatingPointFormula number) checks whether a formula is negative, including -0.0.isNormal(FloatingPointFormula number) isSubnormal(FloatingPointFormula number) isZero(FloatingPointFormula number) lessOrEquals(FloatingPointFormula number1, FloatingPointFormula number2) lessThan(FloatingPointFormula number1, FloatingPointFormula number2) makeNumber(double n, FormulaType.FloatingPointType type) Creates a floating point formula representing the given double value with the specified type.makeNumber(double n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Creates a floating point formula representing the given double value with the specified type and rounding mode.Creates a floating point formula representing the given string value with the specified type.makeNumber(String n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Creates a floating point formula representing the given string value with the specified type and rounding mode.Creates a floating point formula representing the given BigDecimal value with the specified type.makeNumber(BigDecimal n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Creates a floating point formula representing the given BigDecimal value with the specified type and rounding mode.makeNumber(BigInteger exponent, BigInteger mantissa, boolean signBit, FormulaType.FloatingPointType type) Creates a floating point formula from the given exponent, mantissa, and sign bit with the specified type.Creates a floating point formula representing the given Rational value with the specified type.makeNumber(Rational n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Creates a floating point formula representing the given Rational value with the specified type and rounding mode.makeVariable(String pVar, FormulaType.FloatingPointType type) Creates a variable with exactly the given name.max(FloatingPointFormula number1, FloatingPointFormula number2) min(FloatingPointFormula number1, FloatingPointFormula number2) multiply(FloatingPointFormula number1, FloatingPointFormula number2) multiply(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) negate(FloatingPointFormula number) remainder(FloatingPointFormula dividend, FloatingPointFormula divisor) remainder: x - y * n, where n in Z is nearest to x/y.round(FloatingPointFormula formula, FloatingPointRoundingMode roundingMode) sqrt(FloatingPointFormula number) sqrt(FloatingPointFormula number, FloatingPointRoundingMode roundingMode) subtract(FloatingPointFormula number1, FloatingPointFormula number2) subtract(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) toIeeeBitvector(FloatingPointFormula number) Create a formula that produces a representation of the given floating-point value as a bitvector conforming to the IEEE format.
-
Constructor Details
-
DebuggingFloatingPointFormulaManager
public DebuggingFloatingPointFormulaManager(FloatingPointFormulaManager pDelegate, org.sosy_lab.java_smt.delegate.debugging.DebuggingAssertions pDebugging)
-
-
Method Details
-
makeNumber
Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given double value with the specified type.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
public FloatingPointFormula makeNumber(double n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given double value with the specified type and rounding mode.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given BigDecimal value with the specified type.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
public FloatingPointFormula makeNumber(BigDecimal n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given BigDecimal value with the specified type and rounding mode.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given string value with the specified type.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
public FloatingPointFormula makeNumber(String n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given string value with the specified type and rounding mode.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given Rational value with the specified type.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
public FloatingPointFormula makeNumber(Rational n, FormulaType.FloatingPointType type, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula representing the given Rational value with the specified type and rounding mode.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager
-
makeNumber
public FloatingPointFormula makeNumber(BigInteger exponent, BigInteger mantissa, boolean signBit, FormulaType.FloatingPointType type) Description copied from interface:FloatingPointFormulaManagerCreates a floating point formula from the given exponent, mantissa, and sign bit with the specified type.- Specified by:
makeNumberin interfaceFloatingPointFormulaManager- Parameters:
exponent- the exponent part of the floating point numbermantissa- the mantissa part of the floating point numbersignBit- the sign bit of the floating point number, e.g., true for negative numbers
-
makeVariable
Description copied from interface:FloatingPointFormulaManagerCreates a variable with exactly the given name.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.- Specified by:
makeVariablein interfaceFloatingPointFormulaManager
-
makePlusInfinity
- Specified by:
makePlusInfinityin interfaceFloatingPointFormulaManager
-
makeMinusInfinity
- Specified by:
makeMinusInfinityin interfaceFloatingPointFormulaManager
-
makeNaN
- Specified by:
makeNaNin interfaceFloatingPointFormulaManager
-
castTo
public <T extends Formula> T castTo(FloatingPointFormula source, boolean signed, FormulaType<T> targetType) Description copied from interface:FloatingPointFormulaManagerBuild a formula of compatible type from aFloatingPointFormula. This method uses the default rounding mode.Compatible formula types are all numeral types and (signed/unsigned) 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.
- Specified by:
castToin interfaceFloatingPointFormulaManager- Parameters:
source- the source formula of floating-point typesigned- if aBitvectorFormulais given as target, we additionally use this flag. Otherwise, we ignore it.targetType- the type of the resulting formula
-
castTo
public <T extends Formula> T castTo(FloatingPointFormula source, boolean signed, FormulaType<T> targetType, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerBuild a formula of compatible type from aFloatingPointFormula.Compatible formula types are all numeral types and (signed/unsigned) 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.
- Specified by:
castToin interfaceFloatingPointFormulaManager- Parameters:
source- the source formula of floating-point typesigned- if aBitvectorFormulais given as target, 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.
-
castFrom
public FloatingPointFormula castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType) Description copied from interface:FloatingPointFormulaManagerBuild aFloatingPointFormulafrom another compatible formula. This method uses the default rounding mode.Compatible formula types are all numeral types and (signed/unsigned) 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.
- Specified by:
castFromin interfaceFloatingPointFormulaManager- Parameters:
source- the source formula of compatible typesigned- if aBitvectorFormulais given as source, we additionally use this flag. Otherwise, we ignore it.targetType- the type of the resulting formula
-
castFrom
public FloatingPointFormula castFrom(Formula source, boolean signed, FormulaType.FloatingPointType targetType, FloatingPointRoundingMode pFloatingPointRoundingMode) Description copied from interface:FloatingPointFormulaManagerBuild aFloatingPointFormulafrom another compatible formula.Compatible formula types are all numeral types and (signed/unsigned) 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.
- Specified by:
castFromin interfaceFloatingPointFormulaManager- Parameters:
source- the source formula of compatible typesigned- if aBitvectorFormulais 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.
-
fromIeeeBitvector
public FloatingPointFormula fromIeeeBitvector(BitvectorFormula number, FormulaType.FloatingPointType pTargetType) Description copied from interface:FloatingPointFormulaManagerCreate a formula that interprets the given bitvector as a floating-point value in the IEEE format, according to the given type. The sum of the sizes of exponent and mantissa of the target type plus 1 (for the sign bit) needs to be equal to the size of the bitvector.Note: This method will return a value that is (numerically) far away from the original value. This method is completely different from
FloatingPointFormulaManager.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.- Specified by:
fromIeeeBitvectorin interfaceFloatingPointFormulaManager
-
toIeeeBitvector
Description copied from interface:FloatingPointFormulaManagerCreate a formula that produces a representation of the given floating-point value as a bitvector conforming to the IEEE format. The size of the resulting bitvector is the sum of the sizes of the exponent and mantissa of the input formula plus 1 (for the sign bit).- Specified by:
toIeeeBitvectorin interfaceFloatingPointFormulaManager
-
round
public FloatingPointFormula round(FloatingPointFormula formula, FloatingPointRoundingMode roundingMode) - Specified by:
roundin interfaceFloatingPointFormulaManager
-
negate
- Specified by:
negatein interfaceFloatingPointFormulaManager
-
abs
- Specified by:
absin interfaceFloatingPointFormulaManager
-
max
- Specified by:
maxin interfaceFloatingPointFormulaManager
-
min
- Specified by:
minin interfaceFloatingPointFormulaManager
-
sqrt
- Specified by:
sqrtin interfaceFloatingPointFormulaManager
-
sqrt
public FloatingPointFormula sqrt(FloatingPointFormula number, FloatingPointRoundingMode roundingMode) - Specified by:
sqrtin interfaceFloatingPointFormulaManager
-
add
- Specified by:
addin interfaceFloatingPointFormulaManager
-
add
public FloatingPointFormula add(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) - Specified by:
addin interfaceFloatingPointFormulaManager
-
subtract
- Specified by:
subtractin interfaceFloatingPointFormulaManager
-
subtract
public FloatingPointFormula subtract(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) - Specified by:
subtractin interfaceFloatingPointFormulaManager
-
divide
- Specified by:
dividein interfaceFloatingPointFormulaManager
-
divide
public FloatingPointFormula divide(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) - Specified by:
dividein interfaceFloatingPointFormulaManager
-
multiply
- Specified by:
multiplyin interfaceFloatingPointFormulaManager
-
multiply
public FloatingPointFormula multiply(FloatingPointFormula number1, FloatingPointFormula number2, FloatingPointRoundingMode pFloatingPointRoundingMode) - Specified by:
multiplyin interfaceFloatingPointFormulaManager
-
remainder
Description copied from interface:FloatingPointFormulaManagerremainder: x - y * n, where n in Z is nearest to x/y. The result can be negative even for two positive arguments, e.g. "rem(5, 4) == 1" and "rem(5, 6) == -1", as opposed to integer modulo operators.- Specified by:
remainderin interfaceFloatingPointFormulaManager
-
assignment
Description copied from interface:FloatingPointFormulaManagerCreate a term for assigning one floating-point term to another. This means both terms are considered equal afterwards. This method is the same as the methodequalfor other theories.- Specified by:
assignmentin interfaceFloatingPointFormulaManager
-
equalWithFPSemantics
public BooleanFormula equalWithFPSemantics(FloatingPointFormula number1, FloatingPointFormula number2) Description copied from interface:FloatingPointFormulaManagerCreate a term for comparing the equality of two floating-point terms, according to standard floating-point semantics (i.e., NaN != NaN). Be careful to not use this method when you really needFloatingPointFormulaManager.assignment(FloatingPointFormula, FloatingPointFormula).- Specified by:
equalWithFPSemanticsin interfaceFloatingPointFormulaManager
-
greaterThan
- Specified by:
greaterThanin interfaceFloatingPointFormulaManager
-
greaterOrEquals
- Specified by:
greaterOrEqualsin interfaceFloatingPointFormulaManager
-
lessThan
- Specified by:
lessThanin interfaceFloatingPointFormulaManager
-
lessOrEquals
- Specified by:
lessOrEqualsin interfaceFloatingPointFormulaManager
-
isNaN
- Specified by:
isNaNin interfaceFloatingPointFormulaManager
-
isInfinity
- Specified by:
isInfinityin interfaceFloatingPointFormulaManager
-
isZero
- Specified by:
isZeroin interfaceFloatingPointFormulaManager
-
isNormal
- Specified by:
isNormalin interfaceFloatingPointFormulaManager
-
isSubnormal
- Specified by:
isSubnormalin interfaceFloatingPointFormulaManager
-
isNegative
Description copied from interface:FloatingPointFormulaManagerchecks whether a formula is negative, including -0.0.- Specified by:
isNegativein interfaceFloatingPointFormulaManager
-