コード例 #1
0
  private static List<PExp> getConditions(AlternativeExp alternativeExp) {

    List<PExp> result = new LinkedList<PExp>();
    for (AltItemExp aie : alternativeExp.getAlternatives()) {
      if (aie.getTest() != null) {
        result.add(PExp.buildPExp(aie.getTest()));
      }
    }

    return result;
  }
コード例 #2
0
  private static PExp getOtherwiseClauseResult(AlternativeExp alternativeExp) {

    PExp workingOtherwiseClauseResult = null;

    for (AltItemExp aie : alternativeExp.getAlternatives()) {
      if (workingOtherwiseClauseResult != null) {
        throw new IllegalArgumentException(
            "AlternativeExps with "
                + "additional alternatives after the 'otherwise' "
                + "clause are not accepted by the prover. \n\t"
                + aie.getAssignment()
                + " appears in such a position.");
      }

      if (aie.getTest() == null) {
        workingOtherwiseClauseResult = PExp.buildPExp(aie.getAssignment());
      }
    }

    return workingOtherwiseClauseResult;
  }