public static void handleOutOfDateInferenceCache(Keyword assertorretract, Proposition proposition) {
    if (Logic.worldStateP(((Context)(Stella.$CONTEXT$.get())))) {
      if ((Logic.lookupInferenceCache(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_META) == null) ||
          ((((QueryIterator)(Logic.$QUERYITERATOR$.get())) != null) ||
           (Logic.descriptionModeP() ||
            ((Boolean)(Logic.$INVISIBLEASSERTIONp$.get())).booleanValue()))) {
        return;
      }
      { NamedDescription description = ((proposition != null) ? Logic.getDescription(((Surrogate)(proposition.operator))) : ((NamedDescription)(null)));

        if ((description != null) &&
            Logic.testPropertyP(description, Logic.SGT_PL_KERNEL_KB_HIDDEN_RELATION)) {
          return;
        }
      }
      if (Proposition.metaPropositionP(proposition) &&
          ((assertorretract == Logic.KWD_RETRACT) &&
           (!((BooleanWrapper)(KeyValueList.dynamicSlotValue(Logic.lookupInferenceCache(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_META).dynamicSlots, Logic.SYM_LOGIC_TRUTH_MAINTAINEDp, Stella.FALSE_WRAPPER))).wrapperValue))) {
        if ((Stella.$TRACED_KEYWORDS$ != null) &&
            Stella.$TRACED_KEYWORDS$.membP(Logic.KWD_PERFORMANCE_CLUES)) {
          System.out.println("DELETING META CACHE");
        }
        Logic.destroyInferenceCache(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_META);
      }
      else if (Logic.$JUST_IN_TIME_FORWARD_INFERENCEp$) {
        if (((World)(KeyValueList.dynamicSlotValue(((Context)(Stella.$CONTEXT$.get())).dynamicSlots, Logic.SYM_LOGIC_JUST_IN_TIME_INFERENCE_CACHE, null))) != null) {
          if ((Stella.$TRACED_KEYWORDS$ != null) &&
              Stella.$TRACED_KEYWORDS$.membP(Logic.KWD_PERFORMANCE_CLUES)) {
            System.out.println("DELETING JIT CACHE");
          }
          Logic.destroyAllInferenceCaches(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_JUST_IN_TIME);
        }
      }
      else {
        { World cache = Logic.lookupInferenceCache(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_TMS);

          if ((cache != null) &&
              (!((BooleanWrapper)(KeyValueList.dynamicSlotValue(cache.dynamicSlots, Logic.SYM_LOGIC_TRUTH_MAINTAINEDp, Stella.FALSE_WRAPPER))).wrapperValue)) {
            Logic.destroyInferenceCache(((Context)(Stella.$CONTEXT$.get())), Logic.KWD_TMS);
          }
        }
      }
      return;
    }
    { World world = ((World)(((Context)(Stella.$CONTEXT$.get()))));

      if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(world.dynamicSlots, Logic.SYM_LOGIC_MONOTONICp, Stella.FALSE_WRAPPER))).wrapperValue &&
          (assertorretract == Logic.KWD_RETRACT)) {
        if (proposition != null) {
          Stella.STANDARD_WARNING.nativeStream.println("Warning: Retraction of `" + proposition + "' occurred in world `" + world + "' which is marked monotonic.");
        }
        else {
          Stella.STANDARD_WARNING.nativeStream.println("Warning: Retraction occurred in world `" + world + "' which is marked monotonic.");
        }
      }
      if (!((BooleanWrapper)(KeyValueList.dynamicSlotValue(world.dynamicSlots, Logic.SYM_LOGIC_TRUTH_MAINTAINEDp, Stella.FALSE_WRAPPER))).wrapperValue) {
        KeyValueList.setDynamicSlotValue(world.dynamicSlots, Logic.SYM_LOGIC_UP_TO_DATE_INFERENCESp, Stella.FALSE_WRAPPER, Stella.FALSE_WRAPPER);
      }
    }
  }