use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method propagateBinaryMBTTwiceOutofSync.
@Test
public void propagateBinaryMBTTwiceOutofSync() {
store.add(1, new NoGood(fromOldLiterals(-1, 2)));
store.add(2, new NoGood(fromOldLiterals(-3, 1)));
assignment.assign(2, MBT);
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 constraintWithAssignment.
@Test
public void constraintWithAssignment() {
assignment.assign(123, MBT);
assignment.assign(23, TRUE);
store.add(3, new NoGood(fromOldLiterals(-123, 22, 23)));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NoGoodStoreAlphaRoamingTest method binaryNoGoodPropagatesTrueFromFalse.
@Test
public void binaryNoGoodPropagatesTrueFromFalse() {
NoGood noGood = headFirst(fromOldLiterals(-11, -12));
assertNull(store.add(5, noGood));
assertNull(assignment.choose(12, FALSE));
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 binaryNoGoodViolatedDuringAdditionAllTrue.
@Test
public void binaryNoGoodViolatedDuringAdditionAllTrue() {
NoGood noGood = new NoGood(fromOldLiterals(1, 2));
assertNull(assignment.assign(1, TRUE));
assertNull(assignment.assign(2, 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 addedViolatedBinaryNoGoodPropagatesAfterBacktracking.
@Test
public void addedViolatedBinaryNoGoodPropagatesAfterBacktracking() {
NoGood noGood = new NoGood(fromOldLiterals(70, 195));
assertNull(assignment.choose(70, MBT));
assertNull(assignment.choose(195, MBT));
assertNotNull(store.add(3, noGood));
assignment.backtrack();
assertNull(store.add(3, noGood));
store.propagate();
assertEquals(FALSE, assignment.getTruth(195));
}
Aggregations