public static SequenceIndex createSequenceIndex(Stella_Object self, Cons pattern) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfKeywordP(testValue000)) {
        { Keyword self000 = ((Keyword)(self));

          return (Logic.keywordDcreateSequenceIndex(self000, pattern));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_MODULE)) {
        { Module self000 = ((Module)(self));

          return (Logic.moduleDcreateSequenceIndex(self000, pattern));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_OBJECT_STORE)) {
        { ObjectStore self000 = ((ObjectStore)(self));

          return (self000.objectStoreDcreateSequenceIndex(pattern));
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Don't know how to create a sequence index on `" + self + "'");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }