private class AdditionSubtraction extends SubRule {
@Override
public boolean matches(Expression expr) {
Addition apb = new Addition(a, b);
Subtraction bmc = new Subtraction(b, c);
return new Subtraction(apb, c).matches(expr) ||
new Addition(a, bmc).matches(expr);
}