private static TruthValue isZero(Expression expr) {
if (expr instanceof ANumber) {
return TruthValue.valueOf(((ANumber) expr).isZero());
} else if (expr instanceof Multiplication) {
TruthValue leftIsZero = isZero(((Multiplication) expr).lhs());
TruthValue rightIsZero = isZero(((Multiplication) expr).rhs());
if (leftIsZero == TruthValue.True) {
return TruthValue.True;
} else if (rightIsZero == TruthValue.True) {
return TruthValue.True;