if (expr instanceof Relation) {
TupleSet ans = findUpper ? bounds.upperBound((Relation)expr) : bounds.lowerBound((Relation)expr);
if (ans!=null) return makeMutable ? ans.clone() : ans;
}
else if (expr instanceof BinaryExpression) {
BinaryExpression b = (BinaryExpression)expr;
if (b.op() == ExprOperator.UNION) {
TupleSet left = query(findUpper, b.left(), true);
TupleSet right = query(findUpper, b.right(), false);
left.addAll(right);
return left;
}
}
throw new ErrorFatal("Unknown expression encountered during bounds computation: "+expr);