public static IntegerWrapper lengthComputation(Stella_Object x) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(x);

      if (Surrogate.subtypeOfStringP(testValue000)) {
        { StringWrapper x000 = ((StringWrapper)(x));

          return (IntegerWrapper.wrapInteger((x000.wrapperValue).length()));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_SKOLEM)) {
        { Skolem x000 = ((Skolem)(x));

          if (Logic.enumeratedListP(x000) ||
              Logic.enumeratedSetP(x000)) {
            return (IntegerWrapper.wrapInteger(x000.definingProposition.arguments.length() - 1));
          }
          else if (Logic.logicalCollectionP(x000)) {
            { List listvalue = Logic.assertedCollectionMembers(x000, true);

              if (listvalue != null) {
                return (IntegerWrapper.wrapInteger(listvalue.length()));
              }
            }
          }
        }
      }
      else {
      }
    }
    return (null);
  }