@Test(groups="1s", timeOut=60000) public void testIsEntailed2() throws Exception { Assert.assertEquals(PNG.isEntailed(), ESat.UNDEFINED); }
@Override public ESat isEntailed() { if (vars.length == 0) return ESat.TRUE; if (isCompletelyInstantiated()) { boolean OK = true; int var, val; long value; boolean sign, eq; for (int k : sat_.implies_.keys()) { sign = sign(negated(k)); var = var(k); Variable avar = vars[lit2pos[var]]; value = lit2val[var]; eq = iseq(value); val = ivalue(value); if (VariableUtils.isInt(avar)) { IntVar ivar = (IntVar) avar; if ((eq && sign != ivar.contains(val)) || (!eq && sign != ivar.getUB() <= val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else if (VariableUtils.isSet(avar)) { SetVar svar = (SetVar) avar; if (eq && sign != svar.getLB().contains(val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else { throw new UnsupportedOperationException("Unknown case"); } } OK &= clauseEntailed(sat_.clauses); OK &= clauseEntailed(sat_.learnts); return ESat.eval(OK); } return ESat.UNDEFINED; }
PropNogoods extends Propagator<Variable> { @Override public ESat isEntailed() { if (vars.length == 0) return ESat.TRUE; if (isCompletelyInstantiated()) { boolean OK = true; int var, val; long value; boolean sign, eq; for (int k : sat_.implies_.keys()) { sign = sign(negated(k)); var = var(k); Variable avar = vars[lit2pos[var]]; value = lit2val[var]; eq = iseq(value); val = ivalue(value); if (VariableUtils.isInt(avar)) { IntVar ivar = (IntVar) avar; if ((eq && sign != ivar.contains(val)) || (!eq && sign != ivar.getUB() <= val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else if (VariableUtils.isSet(avar)) { SetVar svar = (SetVar) avar; if (eq && sign != svar.getLB().contains(val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else { throw new UnsupportedOperationException("Unknown case"); } } OK &= clauseEntailed(sat_.clauses); OK &= clauseEntailed(sat_.learnts); return ESat.eval(OK); } return ESat.UNDEFINED; } }
PropNogoods extends Propagator<Variable> { @Override public ESat isEntailed() { if (vars.length == 0) return ESat.TRUE; if (isCompletelyInstantiated()) { boolean OK = true; int var, val; long value; boolean sign, eq; for (int k : sat_.implies_.keys()) { sign = sign(negated(k)); var = var(k); Variable avar = vars[lit2pos[var]]; value = lit2val[var]; eq = iseq(value); val = ivalue(value); if (VariableUtils.isInt(avar)) { IntVar ivar = (IntVar) avar; if ((eq && sign != ivar.contains(val)) || (!eq && sign != ivar.getUB() <= val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else if (VariableUtils.isSet(avar)) { SetVar svar = (SetVar) avar; if (eq && sign != svar.getLB().contains(val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else { throw new UnsupportedOperationException("Unknown case"); } } OK &= clauseEntailed(sat_.clauses); OK &= clauseEntailed(sat_.learnts); return ESat.eval(OK); } return ESat.UNDEFINED; } PropNogoods(Model model); }
PropNogoods extends Propagator<Variable> { @Override public ESat isEntailed() { if (vars.length == 0) return ESat.TRUE; if (isCompletelyInstantiated()) { boolean OK = true; int var, val; long value; boolean sign, eq; for (int k : sat_.implies_.keys()) { sign = sign(negated(k)); var = var(k); Variable avar = vars[lit2pos[var]]; value = lit2val[var]; eq = iseq(value); val = ivalue(value); if (VariableUtils.isInt(avar)) { IntVar ivar = (IntVar) avar; if ((eq && sign != ivar.contains(val)) || (!eq && sign != ivar.getUB() <= val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else if (VariableUtils.isSet(avar)) { SetVar svar = (SetVar) avar; if (eq && sign != svar.getLB().contains(val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else { throw new UnsupportedOperationException("Unknown case"); } } OK &= clauseEntailed(sat_.clauses); OK &= clauseEntailed(sat_.learnts); return ESat.eval(OK); } return ESat.UNDEFINED; } 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 ESat isEntailed() { if (vars.length == 0) return ESat.TRUE; if (isCompletelyInstantiated()) { boolean OK = true; int var, val; long value; boolean sign, eq; for (int k : sat_.implies_.keys()) { sign = sign(negated(k)); var = var(k); Variable avar = vars[lit2pos[var]]; value = lit2val[var]; eq = iseq(value); val = ivalue(value); if (VariableUtils.isInt(avar)) { IntVar ivar = (IntVar) avar; if ((eq && sign != ivar.contains(val)) || (!eq && sign != ivar.getUB() <= val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else if (VariableUtils.isSet(avar)) { SetVar svar = (SetVar) avar; if (eq && sign != svar.getLB().contains(val)) { OK &= impliesEntailed(sat_.implies_.get(k)); } } else { throw new UnsupportedOperationException("Unknown case"); } } OK &= clauseEntailed(sat_.clauses); OK &= clauseEntailed(sat_.learnts); return ESat.eval(OK); } return ESat.UNDEFINED; } 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);  }