Package org.sosy_lab.java_smt.api
Interface IntegerFormulaManager
- All Superinterfaces:
NumeralFormulaManager<NumeralFormula.IntegerFormula,NumeralFormula.IntegerFormula>
- All Known Implementing Classes:
DebuggingIntegerFormulaManager
public interface IntegerFormulaManager
extends NumeralFormulaManager<NumeralFormula.IntegerFormula,NumeralFormula.IntegerFormula>
Interface which operates over
NumeralFormula.IntegerFormulas.
Integer formulas always take integral formulas as arguments.
-
Method Summary
Modifier and TypeMethodDescriptiondefault FormulaType<NumeralFormula.IntegerFormula>modularCongruence(NumeralFormula.IntegerFormula number1, NumeralFormula.IntegerFormula number2, long n) Create a term representing the constraintnumber1 == number2 (mod n).modularCongruence(NumeralFormula.IntegerFormula number1, NumeralFormula.IntegerFormula number2, BigInteger n) Create a term representing the constraintnumber1 == number2 (mod n).modulo(NumeralFormula.IntegerFormula numerator, NumeralFormula.IntegerFormula denominator) Create a formula representing the modulo of two operands according to Boute's Euclidean definition.Methods inherited from interface org.sosy_lab.java_smt.api.NumeralFormulaManager
add, distinct, divide, equal, floor, greaterOrEquals, greaterThan, lessOrEquals, lessThan, makeNumber, makeNumber, makeNumber, makeNumber, makeNumber, makeNumber, makeVariable, multiply, negate, subtract, sum
-
Method Details
-
modularCongruence
BooleanFormula modularCongruence(NumeralFormula.IntegerFormula number1, NumeralFormula.IntegerFormula number2, BigInteger n) Create a term representing the constraintnumber1 == number2 (mod n). -
modularCongruence
BooleanFormula modularCongruence(NumeralFormula.IntegerFormula number1, NumeralFormula.IntegerFormula number2, long n) Create a term representing the constraintnumber1 == number2 (mod n). -
modulo
NumeralFormula.IntegerFormula modulo(NumeralFormula.IntegerFormula numerator, NumeralFormula.IntegerFormula denominator) Create a formula representing the modulo of two operands according to Boute's Euclidean definition. The quotient (div numerator denominator) of the internal modulo calculation is floored for positive denominators and rounded up for negative denominators.If the denominator evaluates to zero (modulo-by-zero), either directly as value or indirectly via an additional constraint, then the solver is allowed to choose an arbitrary value for the result of the modulo operation (cf. SMTLIB standard for the division operator in Ints or Reals theory).
Examples:
- 10 % 5 == 0
- 10 % 3 == 1
- 10 % (-3) == 1
- -10 % 5 == 0
- -10 % 3 == 2
- -10 % (-3) == 2
Note: Some solvers, e.g., Yices2, abort with an exception when exploring a modulo-by-zero during the SAT-check. This is not compliant to the SMTLIB standard, but sadly happens.
-
getFormulaType
- Specified by:
getFormulaTypein interfaceNumeralFormulaManager<NumeralFormula.IntegerFormula,NumeralFormula.IntegerFormula>
-