use of org.logicng.handlers.BoundedSatHandler in project LogicNG by logic-ng.
the class BackboneGenerationTest method testCancellationPoints.
@Test
public void testCancellationPoints() throws IOException {
final FormulaFactory f = new FormulaFactory();
final List<Formula> formulas = DimacsReader.readCNF("src/test/resources/sat/term1_gr_rcs_w4.shuffled.cnf", f);
for (int numStarts = 0; numStarts < 10; numStarts++) {
final SATHandler handler = new BoundedSatHandler(numStarts);
final Backbone result = BackboneGeneration.compute(formulas, FormulaHelper.variables(formulas), BackboneType.POSITIVE_AND_NEGATIVE, handler);
assertThat(handler.aborted()).isTrue();
assertThat(result).isNull();
}
}
use of org.logicng.handlers.BoundedSatHandler in project LogicNG by logic-ng.
the class MUSGenerationTest method testCancellationPoints.
@Test
public void testCancellationPoints() throws IOException {
final MUSGeneration mus = new MUSGeneration();
final List<StandardProposition> propositions = DimacsReader.readCNF("src/test/resources/sat/unsat/bf0432-007.cnf", f).stream().map(StandardProposition::new).collect(Collectors.toList());
final List<MUSConfig.Algorithm> algorithms = Arrays.asList(MUSConfig.Algorithm.DELETION, MUSConfig.Algorithm.PLAIN_INSERTION);
for (final MUSConfig.Algorithm algorithm : algorithms) {
for (int numStarts = 0; numStarts < 10; numStarts++) {
final SATHandler handler = new BoundedSatHandler(numStarts);
final MUSConfig config = MUSConfig.builder().handler(handler).algorithm(algorithm).build();
final UNSATCore<StandardProposition> result = mus.computeMUS(propositions, f, config);
assertThat(handler.aborted()).isTrue();
assertThat(result).isNull();
}
}
}
use of org.logicng.handlers.BoundedSatHandler in project LogicNG by logic-ng.
the class MUSGenerationTest method testDeletionBasedCancellationPoints.
@Test
public void testDeletionBasedCancellationPoints() throws IOException {
final MUSGeneration mus = new MUSGeneration();
final List<StandardProposition> propositions = DimacsReader.readCNF("src/test/resources/sat/too_large_gr_rcs_w5.shuffled.cnf", f).stream().map(StandardProposition::new).collect(Collectors.toList());
for (int numStarts = 0; numStarts < 20; numStarts++) {
final SATHandler handler = new BoundedSatHandler(numStarts);
final MUSConfig config = MUSConfig.builder().handler(handler).algorithm(MUSConfig.Algorithm.PLAIN_INSERTION).build();
final UNSATCore<StandardProposition> result = mus.computeMUS(propositions, f, config);
assertThat(handler.aborted()).isTrue();
assertThat(result).isNull();
}
}
use of org.logicng.handlers.BoundedSatHandler in project LogicNG by logic-ng.
the class PrimeImplicantReductionTest method testCancellationPoints.
@Test
public void testCancellationPoints() throws ParserException, IOException {
final Formula formula = FormulaReader.readPseudoBooleanFormula("src/test/resources/formulas/large_formula.txt", this.f);
for (int numStarts = 0; numStarts < 20; numStarts++) {
final SATHandler handler = new BoundedSatHandler(numStarts);
testFormula(formula, handler, true);
}
}
use of org.logicng.handlers.BoundedSatHandler in project LogicNG by logic-ng.
the class PrimeImplicateReductionTest method testCancellationPoints.
@Test
public void testCancellationPoints() throws ParserException, IOException {
final Formula formula = FormulaReader.readPseudoBooleanFormula("src/test/resources/formulas/large_formula.txt", this.f);
for (int numStarts = 0; numStarts < 20; numStarts++) {
final SATHandler handler = new BoundedSatHandler(numStarts);
testFormula(formula, handler, true);
}
}
Aggregations