Search in sources :

Example 1 with FloatingPointFormulaManager

use of org.sosy_lab.java_smt.api.FloatingPointFormulaManager in project java-smt by sosy-lab.

the class UfElimination method makeEqual.

@SuppressWarnings("unchecked")
@CheckReturnValue
private BooleanFormula makeEqual(Formula pLhs, Formula pRhs) {
    BooleanFormula t;
    if (pLhs instanceof BooleanFormula && pRhs instanceof BooleanFormula) {
        t = bfmgr.equivalence((BooleanFormula) pLhs, (BooleanFormula) pRhs);
    } else if (pLhs instanceof IntegerFormula && pRhs instanceof IntegerFormula) {
        t = fmgr.getIntegerFormulaManager().equal((IntegerFormula) pLhs, (IntegerFormula) pRhs);
    } else if (pLhs instanceof StringFormula && pRhs instanceof StringFormula) {
        t = fmgr.getStringFormulaManager().equal((StringFormula) pLhs, (StringFormula) pRhs);
    } else if (pLhs instanceof NumeralFormula && pRhs instanceof NumeralFormula) {
        t = fmgr.getRationalFormulaManager().equal((NumeralFormula) pLhs, (NumeralFormula) pRhs);
    } else if (pLhs instanceof BitvectorFormula) {
        t = fmgr.getBitvectorFormulaManager().equal((BitvectorFormula) pLhs, (BitvectorFormula) pRhs);
    } else if (pLhs instanceof FloatingPointFormula && pRhs instanceof FloatingPointFormula) {
        FloatingPointFormulaManager fpfmgr = fmgr.getFloatingPointFormulaManager();
        t = fpfmgr.equalWithFPSemantics((FloatingPointFormula) pLhs, (FloatingPointFormula) pRhs);
    } else if (pLhs instanceof ArrayFormula<?, ?> && pRhs instanceof ArrayFormula<?, ?>) {
        ArrayFormula<?, ?> lhs = (ArrayFormula<?, ?>) pLhs;
        @SuppressWarnings("rawtypes") ArrayFormula rhs = (ArrayFormula) pRhs;
        t = fmgr.getArrayFormulaManager().equivalence(lhs, rhs);
    } else {
        throw new IllegalArgumentException("Not supported interface");
    }
    return t;
}
Also used : BitvectorFormula(org.sosy_lab.java_smt.api.BitvectorFormula) FloatingPointFormula(org.sosy_lab.java_smt.api.FloatingPointFormula) NumeralFormula(org.sosy_lab.java_smt.api.NumeralFormula) FloatingPointFormulaManager(org.sosy_lab.java_smt.api.FloatingPointFormulaManager) IntegerFormula(org.sosy_lab.java_smt.api.NumeralFormula.IntegerFormula) ArrayFormula(org.sosy_lab.java_smt.api.ArrayFormula) StringFormula(org.sosy_lab.java_smt.api.StringFormula) BooleanFormula(org.sosy_lab.java_smt.api.BooleanFormula) CheckReturnValue(com.google.errorprone.annotations.CheckReturnValue)

Aggregations

CheckReturnValue (com.google.errorprone.annotations.CheckReturnValue)1 ArrayFormula (org.sosy_lab.java_smt.api.ArrayFormula)1 BitvectorFormula (org.sosy_lab.java_smt.api.BitvectorFormula)1 BooleanFormula (org.sosy_lab.java_smt.api.BooleanFormula)1 FloatingPointFormula (org.sosy_lab.java_smt.api.FloatingPointFormula)1 FloatingPointFormulaManager (org.sosy_lab.java_smt.api.FloatingPointFormulaManager)1 NumeralFormula (org.sosy_lab.java_smt.api.NumeralFormula)1 IntegerFormula (org.sosy_lab.java_smt.api.NumeralFormula.IntegerFormula)1 StringFormula (org.sosy_lab.java_smt.api.StringFormula)1