use of org.logicng.knowledgecompilation.dnnf.datastructures.dtree.MinFillDTreeGenerator in project LogicNG by logic-ng.
the class DnnfFactory method compile.
/**
* Compiles the given formula to a DNNF instance.
* @param formula the formula
* @return the compiled DNNF
*/
public Dnnf compile(final Formula formula) {
final SortedSet<Variable> originalVariables = new TreeSet<>(formula.variables());
final Formula cnf = formula.cnf();
originalVariables.addAll(cnf.variables());
final Formula simplifedFormula = simplifyFormula(cnf);
final DnnfCompiler compiler = new DnnfCompiler(simplifedFormula);
final Formula dnnf = compiler.compile(new MinFillDTreeGenerator());
return new Dnnf(originalVariables, dnnf);
}
Aggregations