}
private static Formula insertOr(Formula formula, Changed changed) throws DliException {
// $not($and(list_formula)) -> $or(not(list_formula))
if (formula instanceof Not) {
Not not = (Not)formula;
Formula formula1 = not.getFormula();
if (formula1 instanceof And) {
And and = (And)not.getFormula();
LinkedList<Formula> formulaList = new LinkedList<Formula>();
int nrNot = 0;
for (Formula formula2 : and.getFormulaList()){
if (formula2 instanceof Not) {
nrNot++;
formulaList.add(((Not)formula2).getFormula());
} else {
nrNot--;
formulaList.add(new Not(formula2));
}
}
if (nrNot > 0) {
Or or = new Or(formulaList);
changed.isChanged = true;