public static Keyword uBaseMeasuresSpecialist(ControlFrame frame, Keyword lastmove) {
    { Proposition proposition = frame.proposition;
      Stella_Object mainarg = (proposition.arguments.theArray)[0];
      Stella_Object mainargvalue = Logic.argumentBoundTo(mainarg);
      int value = Stella.NULL_INTEGER;

      if (mainargvalue == null) {
        return (Units.KWD_FAILURE);
      }
      else {
        { Surrogate testValue000 = Stella_Object.safePrimaryType(mainargvalue);

          if (Surrogate.subtypeOfP(testValue000, Units.SGT_UNIT_SUPPORT_DIM_NUMBER_LOGIC_WRAPPER)) {
            { DimNumberLogicWrapper mainargvalue000 = ((DimNumberLogicWrapper)(mainargvalue));

              { GeneralizedSymbol testValue001 = proposition.operator;

                if (testValue001 == Units.SGT_UNIT_KB_NUMERATOR_MEASURES) {
                  value = ((DimNumber)(mainargvalue000.wrapperValue)).pid.numerator;
                }
                else if (testValue001 == Units.SGT_UNIT_KB_DENOMINATOR_MEASURES) {
                  value = ((DimNumber)(mainargvalue000.wrapperValue)).pid.denominator;
                }
                else {
                  { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                    stream000.nativeStream.print("`" + testValue001 + "' is not a valid case option");
                    throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                  }
                }
              }
              return (Units.integerToMeasuresHelper(frame, lastmove, value));
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Units.SGT_LOGIC_LOGIC_OBJECT)) {
            { LogicObject mainargvalue000 = ((LogicObject)(mainargvalue));

              { Measure measure = ((Measure)(Units.$INSTANCE_MEASURE_TABLE$.lookup(mainargvalue000)));

                if (measure != null) {
                  { GeneralizedSymbol testValue002 = proposition.operator;

                    if (testValue002 == Units.SGT_UNIT_KB_NUMERATOR_MEASURES) {
                      value = measure.primeId.numerator;
                    }
                    else if (testValue002 == Units.SGT_UNIT_KB_DENOMINATOR_MEASURES) {
                      value = measure.primeId.denominator;
                    }
                    else {
                      { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

                        stream001.nativeStream.print("`" + testValue002 + "' is not a valid case option");
                        throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
                      }
                    }
                  }
                  return (Units.integerToMeasuresHelper(frame, lastmove, value));
                }
              }
              return (Units.KWD_FAILURE);
            }
          }
          else {
            return (Units.KWD_FAILURE);
          }
        }
      }
    }
  }