Class DebuggingIntegerFormulaManager

    • Constructor Detail

      • DebuggingIntegerFormulaManager

        public DebuggingIntegerFormulaManager​(IntegerFormulaManager pDelegate,
                                              org.sosy_lab.java_smt.delegate.debugging.DebuggingAssertions pDebugging)
    • Method Detail

      • modulo

        public NumeralFormula.IntegerFormula modulo​(NumeralFormula.IntegerFormula numerator,
                                                    NumeralFormula.IntegerFormula denominator)
        Description copied from interface: IntegerFormulaManager
        Create a formula representing the modulo of two operands according to Boute's Euclidean definition (DOI: 10.1145/128861.128862). The quotient (division of numerator by denominator) of the modulo calculation (numerator - quotient * denominator = remainder, with remainder being the result of this operation) 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 version 2.6 for the division operator in Int or Real theory). The details of this are implementation specific and may change solver by solver.

        Examples:

        • modulo(10, 5) == 0
        • modulo(10, 3) == 1
        • modulo(10, -3) == 1
        • modulo(-10, 5) == 0
        • modulo(-10, 3) == 2
        • modulo(-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.

        Specified by:
        modulo in interface IntegerFormulaManager