Пример #1
0
  /** Ends subSolvers data collection. */
  protected void end() {
    if (subSolver != null && subSolver.subSolver == null) {
      if (type == OperatorDescrType.AND) {
        if (possibilityLists.isEmpty()) {
          possibilityLists.add(new HashSet<VerifierComponent>());
        }

        List<Set<VerifierComponent>> newPossibilities = new ArrayList<Set<VerifierComponent>>();

        List<Set<VerifierComponent>> sets = subSolver.getPossibilityLists();
        for (Set<VerifierComponent> possibilityList : possibilityLists) {

          for (Set<VerifierComponent> set : sets) {
            Set<VerifierComponent> newSet = new HashSet<VerifierComponent>();
            newSet.addAll(possibilityList);
            newSet.addAll(set);
            newPossibilities.add(newSet);
          }
        }
        possibilityLists = newPossibilities;

      } else if (type == OperatorDescrType.OR) {

        possibilityLists.addAll(subSolver.getPossibilityLists());
      }

      subSolver = null;

    } else if (subSolver != null && subSolver.subSolver != null) {

      subSolver.end();
    }
  }
Пример #2
0
 public boolean isChildNot() {
   if (subSolver != null) {
     return subSolver.isChildNot();
   } else {
     return isChildNot;
   }
 }
Пример #3
0
 public void addOperator(OperatorDescrType type) {
   if (subSolver != null) {
     subSolver.addOperator(type);
   } else {
     subSolver = new Solver(type);
   }
 }
Пример #4
0
 public boolean isExists() {
   if (subSolver != null) {
     return subSolver.isExists();
   } else {
     return isChildExists;
   }
 }
Пример #5
0
 public boolean isForall() {
   if (subSolver != null) {
     return subSolver.isForall();
   } else {
     return isChildForall;
   }
 }
Пример #6
0
 public void setChildNot(boolean b) {
   if (subSolver != null) {
     subSolver.setChildNot(b);
   } else {
     isChildNot = b;
   }
 }
Пример #7
0
 public void setChildExists(boolean b) {
   if (subSolver != null) {
     subSolver.setChildExists(b);
   } else {
     isChildExists = b;
   }
 }
Пример #8
0
 public void setChildForall(boolean b) {
   if (subSolver != null) {
     subSolver.setChildForall(b);
   } else {
     isChildForall = b;
   }
 }
Пример #9
0
  /**
   * Add new descr.
   *
   * @param descr
   */
  public void add(VerifierComponent descr) {

    if (subSolver != null) {
      subSolver.add(descr);
    } else {
      if (type == OperatorDescrType.AND) {
        if (possibilityLists.isEmpty()) {
          possibilityLists.add(new HashSet<VerifierComponent>());
        }
        for (Set<VerifierComponent> set : possibilityLists) {
          set.add(descr);
        }
      } else if (type == OperatorDescrType.OR) {
        Set<VerifierComponent> set = new HashSet<VerifierComponent>();
        set.add(descr);
        possibilityLists.add(set);
      }
    }
  }