use of org.logicng.propositions.StandardProposition 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.propositions.StandardProposition in project LogicNG by logic-ng.
the class MUSGenerationTest method testSATFormulaSetDeletionBasedMUS.
@Test
public void testSATFormulaSetDeletionBasedMUS() {
final MUSGeneration mus = new MUSGeneration();
final StandardProposition proposition = new StandardProposition(this.f.variable("a"));
assertThatThrownBy(() -> mus.computeMUS(Collections.singletonList(proposition), this.f, MUSConfig.builder().algorithm(MUSConfig.Algorithm.DELETION).build())).isInstanceOf(IllegalArgumentException.class);
}
use of org.logicng.propositions.StandardProposition in project LogicNG by logic-ng.
the class MUSGenerationTest method testSATFormulaSetPlainInsertionBasedMUS.
@Test
public void testSATFormulaSetPlainInsertionBasedMUS() {
final MUSGeneration mus = new MUSGeneration();
final StandardProposition proposition = new StandardProposition(this.f.variable("a"));
assertThatThrownBy(() -> mus.computeMUS(Collections.singletonList(proposition), this.f, MUSConfig.builder().algorithm(MUSConfig.Algorithm.PLAIN_INSERTION).build())).isInstanceOf(IllegalArgumentException.class);
}
use of org.logicng.propositions.StandardProposition 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.propositions.StandardProposition in project LogicNG by logic-ng.
the class MUSGenerationTest method generatePGPropositions.
private List<StandardProposition> generatePGPropositions(final int n) {
final List<StandardProposition> result = new ArrayList<>();
final Formula pgf = this.pg.generate(n);
for (final Formula f : pgf) {
result.add(new StandardProposition(f));
}
return result;
}
Aggregations