use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateViolatedConstraintHeadlessMbt.
@Test
public void propagateViolatedConstraintHeadlessMbt() {
NoGood noGood = new NoGood(fromOldLiterals(3, 11, 19));
assertNull(store.add(24, noGood));
assertNull(assignment.assign(3, MBT));
assertNull(assignment.assign(11, MBT));
assertNull(assignment.assign(19, MBT));
ConflictCause conflictCause = store.propagate();
assertFalse(store.didPropagate());
assertNotNull(conflictCause);
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 conflictingNary.
@Test
public void conflictingNary() {
final NoGood noGood = new NoGood(fromOldLiterals(1, 2, 3));
assignment.assign(1, TRUE);
assignment.assign(2, TRUE);
assignment.assign(3, 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 neverViolatedNoGood.
@Test
public void neverViolatedNoGood() {
NoGood noGood = new NoGood(fromOldLiterals(-44, 10, 13, 44));
assertNull(store.add(80, noGood));
assertNull(assignment.assign(10, TRUE));
assertNull(assignment.assign(13, TRUE));
assertNull(assignment.assign(44, FALSE));
assertNull(store.propagate());
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateNaryMBT.
@Test
public void propagateNaryMBT() {
final NoGood noGood = headFirst(fromOldLiterals(-1, 2, 3));
assignment.assign(2, MBT);
assignment.assign(3, MBT);
store.add(1, noGood);
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 addedBinaryNoGoodPropagatesTrueFromFalse.
@Test
public void addedBinaryNoGoodPropagatesTrueFromFalse() {
NoGood noGood = headFirst(fromOldLiterals(-11, -12));
assertNull(assignment.choose(12, FALSE));
assertNull(store.add(5, noGood));
assertEquals(TRUE, assignment.getTruth(11));
}
Aggregations