use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method conflictingBinary.
@Test
public void conflictingBinary() {
final NoGood noGood = new NoGood(fromOldLiterals(1, 2));
assignment.assign(1, TRUE);
assignment.assign(2, TRUE);
ConflictCause conflictCause = store.add(1, noGood);
assertTrue(antecedentsEquals(noGood.asAntecedent(), conflictCause.getAntecedent()));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateBinaryMBTTwice.
@Test
public void propagateBinaryMBTTwice() {
assignment.assign(2, MBT);
store.add(1, new NoGood(fromOldLiterals(-1, 2)));
store.add(2, new NoGood(fromOldLiterals(-3, 1)));
store.propagate();
assertEquals(MBT, assignment.getTruth(1));
assertEquals(MBT, assignment.getTruth(3));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method binaryNoGoodViolatedDuringAdditionAllMbt.
@Test
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 at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method single.
@Test
public void single() {
store.add(1, new NoGood(fromOldLiterals(-1)));
store.propagate();
assertEquals(MBT, assignment.getTruth(1));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateViolatedConstraint.
@Test
public void propagateViolatedConstraint() {
NoGood noGood = headFirst(fromOldLiterals(-3, -2, -1));
assertNull(store.add(1, noGood));
assertNull(assignment.assign(1, FALSE));
assertNull(assignment.assign(2, FALSE));
assertNull(assignment.assign(3, FALSE));
ConflictCause conflictCause = store.propagate();
assertNotNull(conflictCause);
assertFalse(store.didPropagate());
assertTrue(antecedentsEquals(noGood.asAntecedent(), conflictCause.getAntecedent()));
}
Aggregations