List<IExpression> formulas = new ArrayList<IExpression>();
// TODO: Parent
formulas.add((IExpression) conjunct.accept(this, null));
formulas.add((IExpression) disjunct.accept(this, null));
Conjunction temp = new Conjunction();
temp.exprs.addAll(formulas);
andFormulas.add(temp);
}
// Or(And(Fi G1) ... And(Fi Gm))
Disjunction orFormula = new Disjunction();
orFormula.exprs.addAll(andFormulas);
// normalize(Or(And(Fi G1) ... And(Fi Gm)))
// TODO: Parent
newConjuncts
.add((IExpression) orFormula.accept(this, null));
hasChanged = true;
i++;
} else {
// TODO: Parent
newConjuncts.add((IExpression) conjunct.accept(this, null));
}
}
}
if (hasChanged) {
if (newConjuncts.size() > 1) {
// normalize(And(...)) is either an atomic, an or formula or a
// and formula.
// TODO: Parent
Conjunction conj = new Conjunction();
conj.exprs.addAll(newConjuncts);
return (IExpression) conj.accept(this, null);
} else {
// Either an atomic formula or an or formula.
return newConjuncts.get(0);
}
}