public static Keyword continueContainedByProof(ControlFrame frame, Keyword lastmove) {
    if (lastmove == Logic.KWD_DOWN) {
      if (frame.state == Logic.KWD_CONTAINED_BY) {
        ControlFrame.resetCurrentPatternRecord(frame, Logic.KWD_LOCAL);
      }
      ControlFrame.createDownFrame(frame, ((Proposition)((frame.proposition.arguments.theArray)[0])));
      KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_BACK, frame.down, null);
      return (Logic.KWD_MOVE_DOWN);
    }
    else if (lastmove == Logic.KWD_UP_TRUE) {
      switch (frame.argumentCursor) {
        case 0: 
          frame.down = null;
          frame.argumentCursor = 1;
          return (Logic.KWD_MOVE_DOWN);
        case 1: 
          if (frame.down != null) {
            ControlFrame.popFramesUpTo(frame.down);
          }
          if (((ControlFrame)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_BACK, null))).state == Logic.KWD_POPPED) {
            {
              ControlFrame.setFrameTruthValue(frame, Logic.TRUE_TRUTH_VALUE);
              return (Logic.KWD_FINAL_SUCCESS);
            }
          }
          else {
            {
              frame.down = ((ControlFrame)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_BACK, null)));
              frame.argumentCursor = 0;
              return (Logic.KWD_MOVE_DOWN);
            }
          }
        default:
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("`" + frame.argumentCursor + "' is not a valid case option");
            throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
          }
      }
    }
    else if (lastmove == Logic.KWD_UP_FAIL) {
      switch (frame.argumentCursor) {
        case 0: 
          ControlFrame.setFrameTruthValue(frame, Logic.TRUE_TRUTH_VALUE);
          return (Logic.KWD_FINAL_SUCCESS);
        case 1: 
          { ControlFrame parent = frame.up;
            Proposition parentgoal = parent.proposition;

            if ((parentgoal.kind == Logic.KWD_IMPLIES) &&
                Logic.closedTermP((parentgoal.arguments.theArray)[1])) {
              ControlFrame.setFrameTruthValue(frame, Logic.FALSE_TRUTH_VALUE);
              parent.nextStrategies = Stella.NIL;
            }
            if (!(((ControlFrame)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_BACK, null))).state == Logic.KWD_POPPED)) {
              ControlFrame.popFramesUpTo(((ControlFrame)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_BACK, null))));
            }
            return (Logic.KWD_FAILURE);
          }
        default:
          { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

            stream001.nativeStream.print("`" + frame.argumentCursor + "' is not a valid case option");
            throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
          }
      }
    }
    else {
      { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

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