public static Vector findExternalArgumentsForSubgoal(ControlFrame frame) {
    while (!(frame.state == Logic.KWD_ATOMIC_GOAL)) {
      frame = frame.up;
    }
    { Proposition proposition = frame.proposition;
      Vector externalarguments = frame.proposition.arguments;

      if ((proposition.operator == Logic.SGT_PL_KERNEL_KB_MEMBER_OF) &&
          ((((Description)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, null))) != null) &&
           ((((Description)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_DESCRIPTION, null))).arity() > 1) &&
            Stella_Object.isaP((proposition.arguments.theArray)[0], Logic.SGT_STELLA_LIST)))) {
        externalarguments = Logic.copyListToArgumentsVector(((List)((proposition.arguments.theArray)[0])));
      }
      return (externalarguments);
    }
  }