public static Keyword tryGoalCachesProof(ControlFrame frame) {
    if (((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null))) == null) {
      { Proposition proposition = frame.proposition;
        Keyword cachedresult = ControlFrame.lookupCachedProof(frame);

        if (!(cachedresult == Logic.KWD_FAILURE)) {
          return (cachedresult);
        }
        if (Proposition.allArgumentsBoundP(proposition) ||
            ((!((Logic.$CACHE_SUCCEEDED_GOALSp$ ||
            Logic.$CACHE_FAILED_GOALSp$) &&
            ((Logic.$DUPLICATE_SUBGOAL_STRATEGY$ == Logic.KWD_DUPLICATE_GOALS) &&
             (!((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) &&
            (((QueryIterator)(Logic.$QUERYITERATOR$.get())).partialMatchStrategy != null)))))) ||
             (Proposition.getGoalCacheList(proposition) == null))) {
          return (Logic.KWD_FAILURE);
        }
      }
    }
    if (Proposition.allKeyArgumentsBoundP(frame.proposition)) {
      if (ControlFrame.scanCachedGoals(frame) == Logic.KWD_FAILURE) {
        return (Logic.KWD_FAILURE);
      }
      else {
        return (Logic.KWD_FINAL_SUCCESS);
      }
    }
    return (Logic.KWD_FAILURE);
  }