use of at.ac.tuwien.kr.alpha.core.common.NoGood in project Alpha by alpha-asp.
the class NaiveNoGoodStoreTest 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 NaiveNoGoodStoreTest 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 NaiveNoGoodStoreTest method conflictingFact.
@Test
public void conflictingFact() {
final NoGood noGood = fact(fromOldLiterals(-1));
assignment.assign(1, FALSE);
ConflictCause conflictCause = store.add(1, noGood);
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 NaiveNoGoodStoreTest 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 NaiveNoGoodStoreTest 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));
}
Aggregations