public static void registerInferenceCutoff(ControlFrame frame, Keyword reason) {
    while (frame != null) {
      if ((frame.state == Logic.KWD_FAIL) ||
          ControlFrame.collectDescriptionExtensionFrameP(frame)) {
        KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_INFERENCE_CUTOFF_REASON, reason, null);
      }
      frame = frame.up;
    }
  }