use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method naryNoGoodViolatedDuringAdditionAllTrue.
@Test
public void naryNoGoodViolatedDuringAdditionAllTrue() {
NoGood noGood = new NoGood(fromOldLiterals(1, 2, 3));
assertNull(assignment.assign(1, TRUE));
assertNull(assignment.assign(2, TRUE));
assertNull(assignment.assign(3, TRUE));
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 naryNoGoodViolatedDuringAdditionAllMbt.
@Test
public void naryNoGoodViolatedDuringAdditionAllMbt() {
NoGood noGood = new NoGood(fromOldLiterals(1, 2, 3));
assertNull(assignment.assign(1, MBT));
assertNull(assignment.assign(2, MBT));
assertNull(assignment.assign(3, 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 addedBinaryNoGoodPropagatesTrueFromTrue.
@Test
public void addedBinaryNoGoodPropagatesTrueFromTrue() {
NoGood noGood = headFirst(fromOldLiterals(-11, 12));
assertNull(assignment.choose(12, TRUE));
assertNull(store.add(5, noGood));
store.propagate();
assertEquals(TRUE, assignment.getTruth(11));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method naryNoGoodPropagatesTrueFromTrue.
@Test
public void naryNoGoodPropagatesTrueFromTrue() {
NoGood noGood = headFirst(fromOldLiterals(-1, 2, -3));
assertNull(store.add(10, noGood));
assertNull(assignment.assign(3, FALSE));
store.propagate();
assertNull(assignment.assign(2, TRUE));
store.propagate();
assertEquals(TRUE, assignment.getTruth(1));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateViolatedConstraintHeadless.
@Test
public void propagateViolatedConstraintHeadless() {
NoGood noGood = new NoGood(fromOldLiterals(3, 11, 19));
assertNull(store.add(24, noGood));
assertNull(assignment.assign(3, TRUE));
assertNull(assignment.assign(11, TRUE));
assertNull(assignment.assign(19, TRUE));
ConflictCause conflictCause = store.propagate();
assertFalse(store.didPropagate());
assertNotNull(conflictCause);
assertTrue(antecedentsEquals(noGood.asAntecedent(), conflictCause.getAntecedent()));
}
Aggregations