public static Keyword continuePatternProof(ControlFrame frame, Keyword lastmove) {
    if (lastmove == Logic.KWD_DOWN) {
      ControlFrame.resetCurrentPatternRecord(frame, Logic.KWD_LOCAL);
      return (Logic.KWD_MOVE_DOWN);
    }
    else if (lastmove == Logic.KWD_UP_TRUE) {
      { boolean futurebindingsP = frame.down != null;
        ControlFrame result = frame.result;
        Proposition rule = ControlFrame.getRuleOfAntecedentFrame(frame);

        frame.truthValue = TruthValue.weakenTruthValue(ControlFrame.propagateFrameTruthValue(result, frame), ((rule != null) ? ((TruthValue)(Stella_Object.accessInContext(rule.truthValue, rule.homeContext, false))) : Logic.TRUE_TRUTH_VALUE));
        if (result.partialMatchFrame != null) {
          result.partialMatchFrame.propagateFramePartialTruth(frame);
        }
        if (((Boolean)(Logic.$RECORD_JUSTIFICATIONSp$.get())).booleanValue()) {
          ControlFrame.recordPatternJustification(frame, lastmove);
        }
        if (frame.patternRecord.collectionList != null) {
          ControlFrame.collectPatternQueryBindings(frame);
          if (futurebindingsP) {
            return (Logic.KWD_MOVE_DOWN);
          }
          else {
            {
              ControlFrame.resetCurrentPatternRecord(frame, Logic.KWD_PARENT);
              return (Logic.KWD_CONTINUING_SUCCESS);
            }
          }
        }
        else if (ControlFrame.transferPatternQueryBindingsP(frame, futurebindingsP)) {
          if (futurebindingsP) {
            {
              if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_CACHED_SINGLE_VALUEDp, Stella.FALSE_WRAPPER))).wrapperValue &&
                  (!((Boolean)(Logic.$GENERATE_ALL_PROOFSp$.get())).booleanValue())) {
                ControlFrame.popFramesUpTo(frame.down);
                return (Logic.KWD_FINAL_SUCCESS);
              }
              return (Logic.KWD_CONTINUING_SUCCESS);
            }
          }
          else {
            return (Logic.KWD_FINAL_SUCCESS);
          }
        }
        else if (futurebindingsP) {
          return (Logic.KWD_MOVE_DOWN);
        }
        else {
          return (Logic.KWD_FAILURE);
        }
      }
    }
    else if ((lastmove == Logic.KWD_UP_FAIL) ||
        (lastmove == Logic.KWD_FAILED_OVERLAY)) {
      { ControlFrame result = frame.result;

        ControlFrame.propagateFrameTruthValue(result, frame);
        if (result.partialMatchFrame != null) {
          result.partialMatchFrame.propagateFramePartialTruth(frame);
        }
        if (((Boolean)(Logic.$RECORD_JUSTIFICATIONSp$.get())).booleanValue()) {
          ControlFrame.recordPatternJustification(frame, lastmove);
        }
        if (frame.patternRecord.collectionList != null) {
          {
            ControlFrame.resetCurrentPatternRecord(frame, Logic.KWD_PARENT);
            return (Logic.KWD_CONTINUING_SUCCESS);
          }
        }
        else {
          return (Logic.KWD_FAILURE);
        }
      }
    }
    else {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + lastmove + "' is not a valid case option");
        throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
  }