@Override public ESat isEntailed() { int env = g.getEnvelopGraph().getActiveNodes().getSize(); int ker = g.getKernelGraph().getActiveNodes().getSize(); if (env < k.getLB() || ker > k.getUB()) { return ESat.FALSE; } if (env == ker) { return ESat.TRUE; } return ESat.UNDEFINED; }
@Override public void propagate(int evtmask) throws ContradictionException { int env = g.getEnvelopGraph().getActiveNodes().getSize(); int ker = g.getKernelGraph().getActiveNodes().getSize(); k.updateLowerBound(ker, aCause); k.updateUpperBound(env, aCause); if (ker == env) { setPassive(); } else if (k.instantiated()) { int v = k.getValue(); ISet envNodes = g.getEnvelopGraph().getActiveNodes(); if (v == env) { for (int i = envNodes.getFirstElement(); i >= 0; i = envNodes.getNextElement()) { g.enforceNode(i, aCause); } setPassive(); } else if (v == ker) { ISet kerNodes = g.getKernelGraph().getActiveNodes(); for (int i = envNodes.getFirstElement(); i >= 0; i = envNodes.getNextElement()) { if (!kerNodes.contain(i)) { g.removeNode(i, aCause); } } setPassive(); } } }