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;
}