private void updateBeta() throws ContradictionException { do { beta.add(1); } while (beta.get() < n && checkKerEnv(vars[beta.get()])); if (beta.get() > gamma.get()) { vars[alpha.get()].remFromEnveloppe(t, this, true); vars[alpha.get()].addToKernel(s, this, true); } }
private void initialize() throws ContradictionException { alpha = environment.makeInt(0); while ((alpha.get() < n) && checkKerEnv(vars[alpha.get()])) { updateVar(vars[alpha.get()]); alpha.add(1); } beta = environment.makeInt(alpha.get()); gamma = environment.makeInt(alpha.get()); if (alpha.get() < n) { do { gamma.add(1); } while ((gamma.get()) < n && (vars[gamma.get()].isInDomainEnveloppe(s) || !vars[gamma.get()].isInDomainKernel(t))); updateBeta(); } }
private void propagate(int idx) throws ContradictionException { if (beta.get() <= gamma.get()) { SetVar var = vars[idx]; if ((idx == alpha.get()) && checkKerEnv(var)) { updateVar(var); alpha.add(1); while (alpha.get() < beta.get()) { updateVar(vars[alpha.get()]); alpha.add(1); } while (alpha.get() < n && checkKerEnv(vars[alpha.get()])) { updateVar(vars[alpha.get()]); alpha.add(1); } beta.set(alpha.get()); if (alpha.get() < n) updateBeta(); } else if (idx == beta.get() && checkKerEnv(var)) { updateBeta(); } checkGamma(idx); } }
private void addIndex(int i) { contents.set(i); delatDom.remove(i + offset); if (!contents.get(i)) LOGGER.severe("etrange etrange"); size.add(1); }
private void removeIndex(int i) { contents.clear(i); delatDom.remove(i + offset); if (contents.get(i)) LOGGER.severe("etrange etrange"); size.add(-1); }