}
/** Simplify the bounds based on the fact that "form is true"; return false if we discover the formula is unsat. */
private final boolean simplify_in (Formula form) {
if (form instanceof NaryFormula) {
NaryFormula f = (NaryFormula)form;
if (f.op() == FormulaOperator.AND) {
for(Iterator<Formula> i = f.iterator(); i.hasNext();) if (!simplify_in(i.next())) return false;
}
}
if (form instanceof BinaryFormula) {
BinaryFormula f = (BinaryFormula)form;
if (f.op() == FormulaOperator.AND) {
return simplify_in(f.left()) && simplify_in(f.right());
}
}
if (form instanceof ComparisonFormula) {
ComparisonFormula f = (ComparisonFormula)form;
if (f.op() == ExprCompOperator.SUBSET) {
if (!simplify_in(f.left(), f.right())) return false;
}
if (f.op() == ExprCompOperator.EQUALS) {
if (!simplify_in(f.left(), f.right())) return false;
if (!simplify_in(f.right(), f.left())) return false;
}
}
return true;
}