public static Keyword rangeMaxCardinalitySpecialist(ControlFrame frame, Keyword lastmove) {
    { Proposition proposition = frame.proposition;
      Stella_Object relation = Logic.argumentBoundTo((proposition.arguments.theArray)[0]);
      Stella_Object instance = Logic.argumentBoundTo((proposition.arguments.theArray)[1]);
      Stella_Object maxcardarg = (proposition.arguments.theArray)[2];
      Stella_Object maxcardvalue = Logic.argumentBoundTo(maxcardarg);
      int computedvalue = Stella.NULL_INTEGER;

      lastmove = lastmove;
      if (!Logic.$ACCELERATE_FRAME_COMPUTATIONSp$) {
        return (Logic.KWD_FAILURE);
      }
      if ((relation == null) ||
          (instance == null)) {
        return (Logic.KWD_FAILURE);
      }
      { boolean testValue000 = false;

        testValue000 = Stella_Object.isaP(relation, Logic.SGT_LOGIC_NAMED_DESCRIPTION);
        if (testValue000) {
          { 
            computedvalue = NamedDescription.computeMaximumCardinality(((NamedDescription)(relation)), instance);
            testValue000 = computedvalue != Stella.NULL_INTEGER;
          }
        }
        if (testValue000) {
          { boolean successP = (((maxcardvalue != null) &&
                Stella_Object.isaP(maxcardvalue, Logic.SGT_STELLA_INTEGER_WRAPPER)) ? (computedvalue <= ((NumberWrapper)(maxcardvalue)).numberWrapperToFloat()) : Logic.bindArgumentToValueP(maxcardarg, IntegerWrapper.wrapInteger(computedvalue), true));

            return (Logic.selectTestResult(successP, true, frame));
          }
        }
        else {
          { boolean testValue001 = false;

            testValue001 = maxcardvalue != null;
            if (testValue001) {
              testValue001 = Stella_Object.isaP(maxcardvalue, Logic.SGT_STELLA_INTEGER_WRAPPER);
              if (testValue001) {
                { 
                  computedvalue = NamedDescription.computeMinimumCardinality(((NamedDescription)(relation)), instance);
                  testValue001 = computedvalue != Stella.NULL_INTEGER;
                }
                if (testValue001) {
                  testValue001 = computedvalue > ((NumberWrapper)(maxcardvalue)).numberWrapperToFloat();
                }
              }
            }
            if (testValue001) {
              return (Logic.selectTestResult(false, true, frame));
            }
            else {
              return (Logic.KWD_FAILURE);
            }
          }
        }
      }
    }
  }