use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NaiveNoGoodStoreTest method naryNoGoodViolatedDuringAdditionAllTrue.
@Test
@Disabled("Checks for conflict detection in add.")
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 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 at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NaiveNoGoodStoreTest 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();
assertNotNull(conflictCause);
assertFalse(store.didPropagate());
assertTrue(antecedentsEquals(noGood.asAntecedent(), conflictCause.getAntecedent()));
}
use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NaiveNoGoodStoreTest 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 NaiveNoGoodStoreTest 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());
}
Aggregations