public static Keyword instanceOfSpecialist(ControlFrame frame, Keyword lastmove) {
    { Proposition proposition = frame.proposition;
      Vector arguments = proposition.arguments;
      Stella_Object memberarg = (arguments.theArray)[0];
      Stella_Object member = Logic.argumentBoundTo(memberarg);
      Stella_Object collectionarg = (arguments.theArray)[1];
      Stella_Object collection = Logic.argumentBoundTo(collectionarg);
      Iterator iterator = ((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null)));

      if (lastmove == Logic.KWD_UP_TRUE) {
        return (((frame.down != null) ? Logic.KWD_CONTINUING_SUCCESS : Logic.KWD_FINAL_SUCCESS));
      }
      else if (lastmove == Logic.KWD_UP_FAIL) {
        return (Logic.KWD_FAILURE);
      }
      else {
      }
      if (iterator == null) {
        if (collection != null) {
          if (Logic.classP(collection) &&
              Stella_Object.isaP(collection, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
            { Proposition isaproposition = Logic.createProposition(Logic.SYM_STELLA_ISA, 1);

              isaproposition.operator = ((NamedDescription)(collection)).surrogateValueInverse;
              (isaproposition.arguments.theArray)[0] = memberarg;
              ControlFrame.createSubgoalFrame(frame, isaproposition, null);
              return (Logic.KWD_MOVE_DOWN);
            }
          }
          else if (member == null) {
            ControlFrame.createSubgoalFrame(frame, frame.proposition, Logic.KWD_SCAN_COLLECTION);
            return (Logic.KWD_MOVE_DOWN);
          }
          else {
            if (Logic.memberOfCollectionP(member, collection)) {
              return (Logic.KWD_FINAL_SUCCESS);
            }
            else {
              return (Logic.KWD_FAILURE);
            }
          }
        }
        else if (member != null) {
          iterator = Logic.allTypes(member).allocateIterator();
          KeyValueList.setDynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, iterator, null);
        }
        else {
          return (Logic.KWD_FAILURE);
        }
      }
      if (iterator != null) {
        while (iterator.nextP()) {
          if (PatternVariable.bindVariableToValueP(((PatternVariable)(collectionarg)), iterator.value, true)) {
            return (Logic.KWD_CONTINUING_SUCCESS);
          }
        }
        return (Logic.KWD_FAILURE);
      }
      return (Logic.KWD_FAILURE);
    }
  }