コード例 #1
0
ファイル: PropSetEqual.java プロジェクト: gsdlab/chocosolver
  @Override
  public ESat isEntailed() {
    if (!PropUtil.isKerSubsetEnv(s1, s2) || !PropUtil.isKerSubsetEnv(s2, s1)) {
      return ESat.FALSE;
    }
    if (s1.isInstantiated() && s2.isInstantiated()) {
      return ESat.TRUE;
    }
    int setIntersection = 0;
    ISetIterator iter = s1.getUB().iterator();
    while (iter.hasNext()) {
      int i = iter.nextInt();
      if (s2.getUB().contains(i)) {
        setIntersection++;
      }
    }
    if (setIntersection < s1.getCard().getLB() || setIntersection < s2.getCard().getLB()) {
      return ESat.FALSE;
    }

    return ESat.UNDEFINED;
  }