@Test(groups="1s", timeOut=60000) public void testPropagate() throws Exception { try { PNG.propagate(2); }catch (ContradictionException c){ Assert.fail(); } Assert.assertEquals(vars[0].getDomainSize(), 3); Assert.assertEquals(vars[1].getDomainSize(), 3); Assert.assertEquals(vars[2].getDomainSize(), 3); TIntList list = new TIntArrayList(); list.add(SatSolver.negated(lits[0])); list.add(lits[2]); PNG.addNogood(list); list.clear(); list.add(SatSolver.negated(lits[2])); list.add(lits[4]); PNG.addNogood(list); vars[0].instantiateTo(0, Cause.Null); try { PNG.propagate(2); }catch (ContradictionException c){ Assert.fail(); } Assert.assertTrue(vars[0].isInstantiatedTo(0)); Assert.assertTrue(vars[1].isInstantiatedTo(0)); Assert.assertTrue(vars[2].isInstantiatedTo(0)); }
@Override public void propagate(int evtmask) throws ContradictionException { initialize(); if (!sat_.ok_) fails(); fp.clear(); sat_.cancelUntil(0); storeEarlyDeductions(); applyEarlyDeductions(); for (int i = 0; i < vars.length; ++i) { doVariableBound(vars[i]); } while (fp.size() > 0) { doVariableBound(fp.pollFirst()); } }
PropNogoods extends Propagator<Variable> { @Override public void propagate(int evtmask) throws ContradictionException { initialize(); if (!sat_.ok_) fails(); fp.clear(); sat_.cancelUntil(0); storeEarlyDeductions(); applyEarlyDeductions(); for (int i = 0; i < vars.length; ++i) { doVariableBound(vars[i]); } while (fp.size() > 0) { doVariableBound(fp.pollFirst()); } } }
PropNogoods extends Propagator<Variable> { @Override public void propagate(int evtmask) throws ContradictionException { initialize(); if (!sat_.ok_) fails(); fp.clear(); sat_.cancelUntil(0); storeEarlyDeductions(); applyEarlyDeductions(); for (int i = 0; i < vars.length; ++i) { doVariableBound(vars[i]); } while (fp.size() > 0) { doVariableBound(fp.pollFirst()); } } PropNogoods(Model model); }
PropNogoods extends Propagator<Variable> { @Override public void propagate(int evtmask) throws ContradictionException { initialize(); if (!sat_.ok_) fails(); fp.clear(); sat_.cancelUntil(0); storeEarlyDeductions(); applyEarlyDeductions(); for (int i = 0; i < vars.length; ++i) { doVariableBound(vars[i]); } while (fp.size() > 0) { doVariableBound(fp.pollFirst()); } } PropNogoods(Model model); @Override void propagate(int evtmask); @Override void propagate(int idxVarInProp, int mask); @Override ESat isEntailed(); void initialize(); int Literal(IntVar ivar, int value, boolean eq); int Literal(SetVar svar, int value, boolean in); @SuppressWarnings("unused") boolean addNogood(int p); @SuppressWarnings("unused") boolean addNogood(TIntList lits); void addLearnt(int... lits); }
PropNogoods extends Propagator<Variable> { @Override public void propagate(int evtmask) throws ContradictionException { initialize(); if (!sat_.ok_) fails(); fp.clear(); sat_.cancelUntil(0); storeEarlyDeductions(); applyEarlyDeductions(); for (int i = 0; i < vars.length; ++i) { doVariableBound(vars[i]); } while (fp.size() > 0) { doVariableBound(fp.pollFirst()); } } PropNogoods(Model model); @Override void propagate(int evtmask); @Override void propagate(int idxVarInProp, int mask); @Override ESat isEntailed(); void initialize(); int Literal(IntVar ivar, int value, boolean eq); int Literal(SetVar svar, int value, boolean in); @SuppressWarnings("unused") boolean addNogood(int p); @SuppressWarnings("unused") boolean addNogood(TIntList lits); void addLearnt(int... lits);  }