public static Keyword evaluateNextMove(ControlFrame frame, Keyword lastmove, int clockticks) {
    { Keyword testValue000 = frame.state;

      if (testValue000 == Logic.KWD_AND) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          return (frame.continuePartialAndProof(frame, lastmove));
        }
        else {
          return (ControlFrame.continueAndProof(frame, lastmove));
        }
      }
      else if (testValue000 == Logic.KWD_OR) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          return (frame.continuePartialOrProof(lastmove));
        }
        else {
          return (ControlFrame.continueOrProof(frame, lastmove));
        }
      }
      else if (testValue000 == Logic.KWD_NOT) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          return (frame.continuePartialNotProof(lastmove));
        }
        else {
          return (ControlFrame.continueNotProof(frame, lastmove));
        }
      }
      else if ((testValue000 == Logic.KWD_ISA) ||
          ((testValue000 == Logic.KWD_FUNCTION) ||
           ((testValue000 == Logic.KWD_PREDICATE) ||
            ((testValue000 == Logic.KWD_EQUIVALENT) ||
             (testValue000 == Logic.KWD_IMPLIES))))) {
        return (ControlFrame.initiateAtomicGoalProofs(frame));
      }
      else if ((testValue000 == Logic.KWD_ATOMIC_GOAL) ||
          (testValue000 == Logic.KWD_STRATEGY)) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          return (frame.continuePartialStrategiesProofs(lastmove));
        }
        else {
          return (ControlFrame.continueStrategiesProofs(frame, lastmove));
        }
      }
      else if (testValue000 == Logic.KWD_SCAN_CACHED_BINDINGS) {
        return (ControlFrame.continueCachedBindingsProof(frame, lastmove));
      }
      else if (testValue000 == Logic.KWD_PATTERN) {
        return (ControlFrame.continuePatternProof(frame, lastmove));
      }
      else if (testValue000 == Logic.KWD_FORALL) {
        return (ControlFrame.continueForallProof(frame, lastmove));
      }
      else if ((testValue000 == Logic.KWD_CONTAINED_BY) ||
          (testValue000 == Logic.KWD_ITERATIVE_FORALL)) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          lastmove = ControlFrame.interpretIterativeForallScores(frame, lastmove);
        }
        return (ControlFrame.continueContainedByProof(frame, lastmove));
      }
      else if (testValue000 == Logic.KWD_EXISTS) {
        return (ControlFrame.continueExistsProof(frame, lastmove));
      }
      else if (testValue000 == Logic.KWD_CONSTANT) {
        return (ControlFrame.continueConstantProof(frame, lastmove));
      }
      else if (testValue000 == Logic.KWD_FAIL) {
        if ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)) {
          return (frame.continuePartialFailProof(lastmove));
        }
        else {
          return (ControlFrame.continueFailProof(frame, lastmove));
        }
      }
      else if (testValue000 == Logic.KWD_PARALLEL_STRATEGIES) {
        return (ParallelControlFrame.continueParallelStrategiesProofs(((ParallelControlFrame)(frame)), lastmove));
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.println("Error.  No query state implemented for operator `" + frame.state + "'");
          throw ((FailException)(FailException.newFailException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }