* @param terminalP
   * @param frame
   * @return Keyword
   */
  public static Keyword selectTestResult(boolean successP, boolean terminalP, ControlFrame frame) {
    if (successP == ((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue()) {
      ControlFrame.setFrameTruthValue(frame, Logic.FALSE_TRUTH_VALUE);
      if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
          (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
        ((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy.setBasePartialMatchTruth(frame.proposition, Logic.KWD_FAIL);
      }
      return ((terminalP ? Logic.KWD_TERMINAL_FAILURE : Logic.KWD_FAILURE));
    }
    else {
      ControlFrame.setFrameTruthValue(frame, Logic.TRUE_TRUTH_VALUE);
      if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
          (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
        ((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy.setBasePartialMatchTruth(frame.proposition, Logic.KWD_TRUE);
      }
      return (Logic.KWD_FINAL_SUCCESS);
    }
  }