示例#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);
      }
    }
  }