hypothesis = ((Not)formula2).getFormula();
conclusion = formula1;
}
if (hypothesis != null && conclusion != null){
changed.isChanged = true;
return new Implies(hypothesis, conclusion);
}
}
}
// $not($and($formula1,...,$not($formula_n)) -> $implies($and($formula1,...),$formula_n)
if (formula instanceof Not) {
Not not = (Not)formula;
Formula formula1 = not.getFormula();
if (formula1 instanceof And) {
And and = (And)formula1;
Formula formula2 = and.getFormulaList().getLast();
if (formula2 instanceof Not) {
LinkedList<Formula> formulaList = new LinkedList<Formula>();
for (Formula formula3 : and.getFormulaList()){
formulaList.add(formula3);
}
formulaList.pollLast();
Formula hypothesis = null;
if (formulaList.size() == 1){
hypothesis = formulaList.getFirst();
} else {
hypothesis = new And(formulaList);
}
Formula conclusion = ((Not)formula2).getFormula();
changed.isChanged = true;
return new Implies(hypothesis, conclusion);
}
}
}
return formula;
}