&& (lhs.isConstant() || LinearEquation.isLinear(lhs, x) || lhsIsQuadratic));
}
private static boolean isQuadratic(Expression expr, Variable x) {
NaturalNumber two = Naturals.getInstance().create(2);
ExpressionPattern pattern = new PolynomialTermPattern(x, 2);
if (pattern.matches(expr)) {
return true;
} else if (expr instanceof Negation) {
return isQuadratic(((Negation) expr).getChild(), x);
} else if (expr instanceof Division) {
Expression lhs = ((Division) expr).lhs();