use of org.junit.jupiter.api.Disabled in project Alpha by alpha-asp.
the class NaiveNoGoodStoreTest method binaryNoGoodViolatedDuringAdditionAllMbt.
@Test
@Disabled("Checks for conflict detection in add.")
public void binaryNoGoodViolatedDuringAdditionAllMbt() {
NoGood noGood = new NoGood(fromOldLiterals(1, 2));
assertNull(assignment.assign(1, MBT));
assertNull(assignment.assign(2, MBT));
ConflictCause conflictCause = store.add(11, noGood);
assertNotNull(conflictCause);
assertNotNull(conflictCause.getAntecedent());
}
use of org.junit.jupiter.api.Disabled in project Alpha by alpha-asp.
the class GroundConflictNoGoodLearnerTest method subCurrentDLPropagationWithChoiceCauseOfConflict.
@Test
@Disabled("TrailAssignment no longer propagates at lower decision level.")
public void subCurrentDLPropagationWithChoiceCauseOfConflict() {
GroundConflictNoGoodLearner learner = new GroundConflictNoGoodLearner(assignment, atomStore);
NoGood n1 = new NoGood(fromOldLiterals(1, -2));
NoGood n2 = new NoGood(fromOldLiterals(2, 3));
store.add(10, n1);
assignment.choose(1, ThriceTruth.TRUE);
assignment.choose(3, ThriceTruth.TRUE);
store.propagate();
assertEquals(ThriceTruth.MBT, assignment.get(2).getTruth());
assertEquals(1, assignment.get(2).getDecisionLevel());
ConflictCause conflictCause = store.add(11, n2);
assertNotNull(conflictCause);
assertNotNull(conflictCause.getAntecedent());
GroundConflictNoGoodLearner.ConflictAnalysisResult conflictAnalysisResult = learner.analyzeConflictingNoGood(conflictCause.getAntecedent());
assertNull(conflictAnalysisResult.learnedNoGood);
assertEquals(2, conflictAnalysisResult.backjumpLevel);
}
use of org.junit.jupiter.api.Disabled in project Alpha by alpha-asp.
the class AlphaImplTest method withExternalInvocationCounted1.
@Test
@Disabled("External atom has state, which is not allowed. Caching of calls makes the number of invocations wrong.")
public void withExternalInvocationCounted1() throws Exception {
Alpha system = new AlphaImpl();
InputConfig cfg = InputConfig.forString("a :- &isOne[1], &isOne[1].");
cfg.addPredicateMethod("isOne", Externals.processPredicateMethod(this.getClass().getMethod("isOne", int.class)));
ASPCore2Program prog = system.readProgram(cfg);
int before = invocations;
Set<AnswerSet> actual = system.solve(prog).collect(Collectors.toSet());
int after = invocations;
assertEquals(2, after - before);
Set<AnswerSet> expected = new HashSet<>(singletonList(new AnswerSetBuilder().predicate("a").build()));
assertEquals(expected, actual);
}
use of org.junit.jupiter.api.Disabled in project Alpha by alpha-asp.
the class AlphaImplTest method withExternalInvocationCounted3.
@Test
@Disabled("External atom has state, which is not allowed. Caching of calls makes the number of invocations wrong.")
public void withExternalInvocationCounted3() throws Exception {
Alpha system = new AlphaImpl();
InputConfig cfg = InputConfig.forString("a :- &isOne[1], not &isOne[2].");
cfg.addPredicateMethod("isOne", Externals.processPredicateMethod(this.getClass().getMethod("isOne", int.class)));
ASPCore2Program prog = system.readProgram(cfg);
int before = invocations;
Set<AnswerSet> actual = system.solve(prog).collect(Collectors.toSet());
int after = invocations;
assertEquals(1, after - before);
Set<AnswerSet> expected = new HashSet<>(singletonList(new AnswerSetBuilder().predicate("a").build()));
assertEquals(expected, actual);
}
use of org.junit.jupiter.api.Disabled in project Alpha by alpha-asp.
the class AlphaImplTest method withExternalInvocationCounted2.
@Test
@Disabled("External atom has state, which is not allowed. Caching of calls makes the number of invocations wrong.")
public void withExternalInvocationCounted2() throws Exception {
Alpha system = new AlphaImpl();
InputConfig cfg = InputConfig.forString("a. b :- &isOne[1], &isOne[2].");
cfg.addPredicateMethod("isOne", Externals.processPredicateMethod(this.getClass().getMethod("isOne", int.class)));
ASPCore2Program prog = system.readProgram(cfg);
int before = invocations;
Set<AnswerSet> actual = system.solve(prog).collect(Collectors.toSet());
int after = invocations;
assertEquals(2, after - before);
Set<AnswerSet> expected = new HashSet<>(singletonList(new AnswerSetBuilder().predicate("a").build()));
assertEquals(expected, actual);
}
Aggregations