Search in sources :

Example 1 with BExprUn

use of com.dat3m.dartagnan.expression.BExprUn in project Dat3M by hernanponcedeleon.

the class RemoveDeadCondJumps method mutuallyExclusiveIfs.

private boolean mutuallyExclusiveIfs(CondJump jump, Event e) {
    if (!(e instanceof CondJump)) {
        return false;
    }
    CondJump jump2 = (CondJump) e;
    if (jump.getGuard() instanceof BExprUn && ((BExprUn) jump.getGuard()).getInner().equals(jump2.getGuard()) || jump2.getGuard() instanceof BExprUn && ((BExprUn) jump2.getGuard()).getInner().equals(jump.getGuard())) {
        return true;
    }
    if (jump.getGuard() instanceof Atom && jump2.getGuard() instanceof Atom) {
        Atom a1 = (Atom) jump.getGuard();
        Atom a2 = (Atom) jump2.getGuard();
        return a1.getOp().inverted() == a2.getOp() && a1.getLHS().equals(a2.getLHS()) && a1.getRHS().equals(a2.getRHS());
    }
    return false;
}
Also used : BExprUn(com.dat3m.dartagnan.expression.BExprUn) CondJump(com.dat3m.dartagnan.program.event.core.CondJump) Atom(com.dat3m.dartagnan.expression.Atom)

Aggregations

Atom (com.dat3m.dartagnan.expression.Atom)1 BExprUn (com.dat3m.dartagnan.expression.BExprUn)1 CondJump (com.dat3m.dartagnan.program.event.core.CondJump)1