public static World getInferenceCache(Context context, Keyword kind) {
    if (!Logic.worldStateP(context)) {
      return (((World)(context)));
    }
    { World world = Logic.lookupInferenceCache(context, kind);

      if (world != null) {
        return (world);
      }
      Logic.processCheckTypesAgenda();
      world = Logic.createInferenceCache(context, kind);
      if (kind == Logic.KWD_JUST_IN_TIME) {
      }
      else if ((kind == Logic.KWD_META) ||
          (kind == Logic.KWD_TMS)) {
        { Module parentmodule = null;
          Cons iter000 = context.baseModule.parentModules.theConsList;

          for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            parentmodule = ((Module)(iter000.value));
            Logic.inheritCachedInferences(Logic.lookupInferenceCache(parentmodule, kind), world);
          }
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

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