use of org.logicng.handlers.NumberOfNodesBDDHandler in project LogicNG by logic-ng.
the class LargeBDDTest method testNumberOfNodesHandlerSmall.
@Test
public void testNumberOfNodesHandlerSmall() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
final Formula queens = generator.generate(4);
final BDDKernel kernel = new BDDKernel(f, queens.variables().size(), 10000, 10000);
final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(1000);
final BDD bdd = BDDFactory.build(queens, kernel, handler);
assertThat(handler.aborted()).isFalse();
assertThat(bdd.index()).isNotEqualTo(BDDKernel.BDD_ABORT);
}
use of org.logicng.handlers.NumberOfNodesBDDHandler in project LogicNG by logic-ng.
the class LargeBDDTest method testNumberOfNodesHandler.
@Test
public void testNumberOfNodesHandler() throws ParserException {
final FormulaFactory f = new FormulaFactory();
final Formula formula = f.parse("A <=> ~(B => C & F & G & ~H | A & D & ~E)");
final BDDKernel kernel = new BDDKernel(f, formula.variables().size(), 10000, 10000);
final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(5);
final BDD bdd = BDDFactory.build(formula, kernel, handler);
assertThat(handler.aborted()).isTrue();
assertThat(bdd.index()).isEqualTo(BDDKernel.BDD_ABORT);
}
use of org.logicng.handlers.NumberOfNodesBDDHandler in project LogicNG by logic-ng.
the class LargeBDDTest method testNumberOfNodesHandlerLarge.
@Test
public void testNumberOfNodesHandlerLarge() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
final Formula queens = generator.generate(10);
final BDDKernel kernel = new BDDKernel(f, queens.variables().size(), 10000, 10000);
final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(5);
final BDD bdd = BDDFactory.build(queens, kernel, handler);
assertThat(handler.aborted()).isTrue();
assertThat(bdd.index()).isEqualTo(BDDKernel.BDD_ABORT);
}
Aggregations