示例#1
0
  /**
   * Return TRUE if <code>x</code> and <code>y</code> represent the same set of key/value pairs.
   *
   * @param y
   * @return boolean
   */
  public boolean objectEqualP(Stella_Object y) {
    {
      StellaHashTable x = this;

      if (Surrogate.subtypeOfP(
          Stella_Object.safePrimaryType(y), Stella.SGT_STELLA_STELLA_HASH_TABLE)) {
        {
          StellaHashTable y000 = ((StellaHashTable) (y));

          if (x.length() == y000.length()) {
            {
              Stella_Object key = null;
              Stella_Object value = null;
              StellaHashTableIterator iter000 = ((StellaHashTableIterator) (x.allocateIterator()));

              while (iter000.nextP()) {
                key = iter000.key;
                value = iter000.value;
                if (!Stella_Object.equalP(value, y000.lookup(key))) {
                  return (false);
                }
              }
            }
            return (true);
          }
        }
      } else {
      }
      return (false);
    }
  }
示例#2
0
  public static Stella_Object stellaHashTableLookup(StellaHashTable self, Stella_Object key) {
    {
      KvCons[] table = self.theTable;
      KvCons bucket = null;

      if (table == null) {
        return (null);
      }
      if (self.equalTestP) {
        bucket = table[(((key.equalHashCode()) & 0x7FFFFFFF) % (self.size))];
        while (bucket != null) {
          if (Stella_Object.equalP(bucket.key, key)) {
            return (bucket.value);
          } else {
            bucket = bucket.rest;
          }
        }
      } else {
        bucket = table[(((key.hashCode_()) & 0x7FFFFFFF) % (self.size))];
        while (bucket != null) {
          if (Stella_Object.eqlP(bucket.key, key)) {
            return (bucket.value);
          } else {
            bucket = bucket.rest;
          }
        }
      }
      return (null);
    }
  }
  public static void STARTUP_XML_SCHEMA_INSTANCE() {
    {
      Object OLD_$MODULE$_000 = Stella.$MODULE$.get();
      Object OLD_$CONTEXT$_000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(
            Stella.$MODULE$,
            Stella.getStellaModule("/STELLA/XML-OBJECTS/XSI", Stella.$STARTUP_TIME_PHASE$ > 1));
        Native.setSpecial(Stella.$CONTEXT$, ((Module) (Stella.$MODULE$.get())));
        if (Stella.currentStartupTimePhaseP(2)) {
          Xsi.SYM_XSI_STARTUP_XML_SCHEMA_INSTANCE =
              ((Symbol)
                  (GeneralizedSymbol.internRigidSymbolWrtModule(
                      "STARTUP-XML-SCHEMA-INSTANCE", null, 0)));
        }
        if (Stella.currentStartupTimePhaseP(6)) {
          Stella.finalizeClasses();
        }
        if (Stella.currentStartupTimePhaseP(7)) {
          Stella.defineFunctionObject(
              "STARTUP-XML-SCHEMA-INSTANCE",
              "(DEFUN STARTUP-XML-SCHEMA-INSTANCE () :PUBLIC? TRUE)",
              Native.find_java_method(
                  "edu.isi.webtools.objects.xmlschemainstance._StartupXmlSchemaInstance",
                  "STARTUP_XML_SCHEMA_INSTANCE",
                  new java.lang.Class[] {}),
              null);
          {
            MethodSlot function = Symbol.lookupFunction(Xsi.SYM_XSI_STARTUP_XML_SCHEMA_INSTANCE);

            KeyValueList.setDynamicSlotValue(
                function.dynamicSlots,
                edu.isi.webtools.http.Http.SYM_STELLA_METHOD_STARTUP_CLASSNAME,
                StringWrapper.wrapString("_StartupXmlSchemaInstance"),
                Stella.NULL_STRING_WRAPPER);
          }
        }
        if (Stella.currentStartupTimePhaseP(8)) {
          Stella.finalizeSlots();
          Stella.cleanupUnfinalizedClasses();
        }
        if (Stella.currentStartupTimePhaseP(9)) {
          Stella_Object.inModule(
              ((StringWrapper) (Stella_Object.copyConsTree(StringWrapper.wrapString("XSI")))));
          XmlObjects.$NAMESPACE_PREFIX_URI_TABLE$.insertAt(
              StringWrapper.wrapString("XSI"),
              StringWrapper.wrapString("http://www.w3.org/2001/XMLSchema-instance"));
          XmlObjects.$NAMESPACE_URI_PREFIX_TABLE$.insertAt(
              StringWrapper.wrapString("http://www.w3.org/2001/XMLSchema-instance"),
              StringWrapper.wrapString("XSI"));
        }

      } finally {
        Stella.$CONTEXT$.set(OLD_$CONTEXT$_000);
        Stella.$MODULE$.set(OLD_$MODULE$_000);
      }
    }
  }
示例#4
0
  public boolean lessP(Stella_Object t2) {
    {
      CalendarDate t1 = this;

      if (Surrogate.subtypeOfP(
          Stella_Object.safePrimaryType(t2), Stella.SGT_STELLA_CALENDAR_DATE)) {
        {
          CalendarDate t2000 = ((CalendarDate) (t2));

          if (t1.modifiedJulianDay == t2000.modifiedJulianDay) {
            return (t1.timeMillis < t2000.timeMillis);
          } else {
            return (t1.modifiedJulianDay < t2000.modifiedJulianDay);
          }
        }
      } else {
        {
          OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print(
              "Can't compare calendar date `" + t1 + "' with object `" + t2 + "'");
          throw ((IncompatibleQuantityException)
              (IncompatibleQuantityException.newIncompatibleQuantityException(
                      stream000.theStringReader())
                  .fillInStackTrace()));
        }
      }
    }
  }
示例#5
0
  public boolean vizAllowedObjectP(Stella_Object renamed_Object) {
    {
      VizInfo self = this;

      return (((self.allowedObjects == null)
          ? (!self.vizExcludedModuleP(renamed_Object.homeModule()))
          : self.allowedObjects.memberP(renamed_Object)));
    }
  }
  public void propagateFramePartialTruth(ControlFrame target) {
    {
      PartialMatchFrame source = this;

      {
        PartialMatchFrame targetpmf = target.partialMatchFrame;
        boolean flippolarityP = !(source.controlFrame.reversePolarityP == target.reversePolarityP);

        if (targetpmf == null) {
          if (flippolarityP) {
            targetpmf =
                ((PartialMatchFrame)
                    (Surrogate.createObject(
                        source.primaryType(),
                        Stella_Object.cons(
                            Logic.KWD_CONTROL_FRAME,
                            Stella_Object.cons(
                                target,
                                Stella_Object.cons(
                                    Logic.KWD_KIND,
                                    Stella_Object.cons(target.state, Stella.NIL)))))));
            targetpmf.parent = source.parent;
            targetpmf.child = source;
          } else {
            targetpmf = source;
          }
          target.partialMatchFrame = targetpmf;
        }
        if (flippolarityP) {
          targetpmf.positiveScore = 0 - source.positiveScore;
          targetpmf.negativeScore = source.positiveScore;
        } else {
          targetpmf.positiveScore = source.positiveScore;
          targetpmf.negativeScore = source.negativeScore;
        }
        KeyValueList.setDynamicSlotValue(
            ((QueryIterator) (Logic.$QUERYITERATOR$.get())).dynamicSlots,
            Logic.SYM_LOGIC_LATEST_POSITIVE_SCORE,
            FloatWrapper.wrapFloat(targetpmf.positiveScore),
            Stella.NULL_FLOAT_WRAPPER);
      }
    }
  }
  public static Cons lookupMemoizedValue(
      MemoizationTable memotable,
      Stella_Object arg1,
      Stella_Object arg2,
      Stella_Object arg3,
      Stella_Object arg4,
      int eqvector) {
    {
      IntegerHashTable hashtable = memotable.hashTable;
      Cons timestamp = null;
      int hashcode = 0;
      Cons entry = Stella.NIL;
      Cons bucket = Stella.NIL;

      if (hashtable == null) {
        hashtable = IntegerHashTable.newIntegerHashTable();
        memotable.hashTable = hashtable;
        memotable.currentTimestamp = Cons.cons(null, Stella.NIL);
      }
      timestamp = memotable.currentTimestamp;
      hashcode = Stella_Object.hashMemoizedArguments(arg1, arg2, arg3, arg4, eqvector);
      bucket = ((Cons) (hashtable.lookup(hashcode)));
      if (bucket != null) {
        if (((Cons) (bucket.value)) == timestamp) {
          entry = Cons.findMemoizedValueEntry(bucket, arg1, arg2, arg3, arg4, eqvector, false);
          if (entry != null) {
            return (entry);
          }
        } else {
          bucket.value = timestamp;
          bucket.rest = Stella.NIL;
        }
      }
      entry = Stella_Object.makeMemoizedValueEntry(null, arg1, arg2, arg3, arg4);
      if (bucket != null) {
        bucket.rest = Cons.cons(entry, bucket.rest);
      } else {
        hashtable.insertAt(hashcode, Cons.cons(timestamp, Cons.cons(entry, Stella.NIL)));
      }
      return (entry);
    }
  }
示例#8
0
  /**
   * Return an <code>equalP</code> hash code for <code>self</code>. Note that this is O(N) in the
   * number of entries of <code>self</code>.
   *
   * @return int
   */
  public int equalHashCode() {
    {
      StellaHashTable self = this;

      {
        int code = 36273463;

        {
          Stella_Object key = null;
          Stella_Object value = null;
          StellaHashTableIterator iter000 = ((StellaHashTableIterator) (self.allocateIterator()));

          while (iter000.nextP()) {
            key = iter000.key;
            value = iter000.value;
            code = (code ^ (key.equalHashCode()));
            code = (code ^ (value.equalHashCode()));
          }
        }
        return (code);
      }
    }
  }
示例#9
0
  public static void stellaHashTableRemoveAt(StellaHashTable self, Stella_Object key) {
    {
      KvCons[] table = self.theTable;
      int bucketindex = 0;
      KvCons bucket = null;
      boolean equaltestP = self.equalTestP;

      if (table == null) {
        return;
      }
      if (equaltestP) {
        bucketindex = (((key.equalHashCode()) & 0x7FFFFFFF) % (self.size));
      } else {
        bucketindex = (((key.hashCode_()) & 0x7FFFFFFF) % (self.size));
      }
      bucket = table[bucketindex];
      if (bucket == null) {
        return;
      } else if ((!equaltestP) && Stella_Object.eqlP(bucket.key, key)) {
        table[bucketindex] = bucket.rest;
        self.freeElements = self.freeElements + 1;
        return;
      } else if (equaltestP && Stella_Object.equalP(bucket.key, key)) {
        table[bucketindex] = bucket.rest;
        self.freeElements = self.freeElements + 1;
        return;
      } else {
        {
          KvCons trailer = bucket;

          bucket = bucket.rest;
          while (bucket != null) {
            if ((!equaltestP) && Stella_Object.eqlP(bucket.key, key)) {
              trailer.rest = bucket.rest;
              self.freeElements = self.freeElements + 1;
              return;
            } else if (equaltestP && Stella_Object.equalP(bucket.key, key)) {
              trailer.rest = bucket.rest;
              self.freeElements = self.freeElements + 1;
              return;
            } else {
              trailer = bucket;
              bucket = bucket.rest;
            }
          }
        }
      }
    }
  }
示例#10
0
  public boolean objectEqlP(Stella_Object t2) {
    {
      CalendarDate t1 = this;

      if (Surrogate.subtypeOfP(
          Stella_Object.safePrimaryType(t2), Stella.SGT_STELLA_CALENDAR_DATE)) {
        {
          CalendarDate t2000 = ((CalendarDate) (t2));

          if (t1.modifiedJulianDay == t2000.modifiedJulianDay) {
            return (t1.timeMillis == t2000.timeMillis);
          } else {
            return (t1.modifiedJulianDay == t2000.modifiedJulianDay);
          }
        }
      } else {
        return (false);
      }
    }
  }
示例#11
0
  public void vizExportConcepts(Module module) {
    {
      VizInfo self = this;

      {
        Stella_Object concept = null;
        edu.isi.powerloom.PlIterator iter000 =
            edu.isi.powerloom.PLI.getConceptInstances(
                ((LogicObject) (Logic.getInstance(OntosaurusUtil.SGT_PL_KERNEL_KB_CONCEPT))),
                module,
                null);

        while (iter000.nextP()) {
          concept = iter000.value;
          if (Surrogate.subtypeOfP(
              Stella_Object.safePrimaryType(concept), OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
            {
              LogicObject concept000 = ((LogicObject) (concept));

              if ((concept000.homeModule() == module) && self.vizAllowedObjectP(concept000)) {
                self.vizExportConcept(concept000, module);
              }
            }
          } else {
            {
              OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print(
                  "viz-export-concepts: concept not handled: `" + concept + "'");
              throw ((StellaException)
                  (StellaException.newStellaException(stream000.theStringReader())
                      .fillInStackTrace()));
            }
          }
        }
      }
    }
  }
示例#12
0
  public Quantity coerceTo(Stella_Object y) {
    {
      CalendarDate x = this;

      if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(y), Stella.SGT_STELLA_CALENDAR_DATE)) {
        {
          CalendarDate y000 = ((CalendarDate) (y));

          return (y000);
        }
      } else {
        {
          OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Can't coerce `" + y + "' to a CALENDAR-DATE");
          throw ((IncompatibleQuantityException)
              (IncompatibleQuantityException.newIncompatibleQuantityException(
                      stream000.theStringReader())
                  .fillInStackTrace()));
        }
      }
    }
  }
示例#13
0
  /**
   * Collect all entries of <code>self</code> into a cons list of <code>_LkeyGLvalueG_</code> pairs
   * and return the result.
   *
   * @return Cons
   */
  public Cons consify() {
    {
      StellaHashTable self = this;

      {
        Cons result = Stella.NIL;

        {
          Stella_Object key = null;
          Stella_Object value = null;
          StellaHashTableIterator iter000 = ((StellaHashTableIterator) (self.allocateIterator()));
          Cons collect000 = null;

          while (iter000.nextP()) {
            key = iter000.key;
            value = iter000.value;
            if (collect000 == null) {
              {
                collect000 =
                    Stella_Object.cons(
                        Stella_Object.cons(key, Stella_Object.cons(value, Stella.NIL)), Stella.NIL);
                if (result == Stella.NIL) {
                  result = collect000;
                } else {
                  Cons.addConsToEndOfConsList(result, collect000);
                }
              }
            } else {
              {
                collect000.rest =
                    Stella_Object.cons(
                        Stella_Object.cons(key, Stella_Object.cons(value, Stella.NIL)), Stella.NIL);
                collect000 = collect000.rest;
              }
            }
          }
        }
        return (result);
      }
    }
  }
示例#14
0
  public static void stellaHashTableInsertAt(
      StellaHashTable self, Stella_Object key, Stella_Object value) {
    {
      KvCons[] table = self.theTable;
      int free = self.freeElements;
      int bucketindex = 0;
      KvCons bucket = null;
      boolean equaltestP = self.equalTestP;

      if (table == null) {
        StellaHashTable.initializeStellaHashTable(self);
        table = self.theTable;
        free = self.freeElements;
      }
      if (free == 0) {
        StellaHashTable.rehashStellaHashTable(self, Stella.pickHashTableSizePrime(self.size + 1));
        table = self.theTable;
        free = self.freeElements;
      }
      if (equaltestP) {
        bucketindex = (((key.equalHashCode()) & 0x7FFFFFFF) % (self.size));
      } else {
        bucketindex = (((key.hashCode_()) & 0x7FFFFFFF) % (self.size));
      }
      bucket = table[bucketindex];
      if (bucket == null) {
        {
          KvCons self000 = KvCons.newKvCons();

          self000.key = key;
          self000.value = value;
          table[bucketindex] = self000;
        }
        self.freeElements = free - 1;
      } else {
        {
          KvCons cursor = bucket;

          if (equaltestP) {
            while ((cursor != null) && (!Stella_Object.equalP(cursor.key, key))) {
              cursor = cursor.rest;
            }
          } else {
            while ((cursor != null) && (!Stella_Object.eqlP(cursor.key, key))) {
              cursor = cursor.rest;
            }
          }
          if (cursor != null) {
            cursor.value = value;
          } else {
            {
              KvCons self001 = KvCons.newKvCons();

              self001.key = key;
              self001.value = value;
              self001.rest = bucket.rest;
              bucket.rest = self001;
            }
            self.freeElements = free - 1;
          }
        }
      }
    }
  }
示例#15
0
  public void vizExportConceptTree(LogicObject concept, Module module) {
    {
      VizInfo self = this;

      self.nodeColor = "palegreen";
      self.vizExportConcept(concept, module);
      self.nodeColor = "yellow";
      self.vizAllowObject(concept);
      {
        LogicObject renamed_Super = null;
        edu.isi.powerloom.PlIterator iter000 =
            edu.isi.powerloom.PLI.getProperSuperrelations(concept, module, null);

        while (iter000.nextP()) {
          renamed_Super = ((LogicObject) (iter000.value));
          self.vizAllowObject(renamed_Super);
        }
      }
      {
        LogicObject sub = null;
        edu.isi.powerloom.PlIterator iter001 =
            edu.isi.powerloom.PLI.getProperSubrelations(concept, module, null);

        while (iter001.nextP()) {
          sub = ((LogicObject) (iter001.value));
          self.vizAllowObject(sub);
        }
      }
      {
        LogicObject renamed_Super = null;
        edu.isi.powerloom.PlIterator iter002 =
            edu.isi.powerloom.PLI.getProperSuperrelations(concept, module, null);

        while (iter002.nextP()) {
          renamed_Super = ((LogicObject) (iter002.value));
          if (Surrogate.subtypeOfP(
              Stella_Object.safePrimaryType(renamed_Super),
              OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
            {
              LogicObject super000 = ((LogicObject) (renamed_Super));

              self.vizExportConcept(super000, module);
            }
          } else {
            {
              OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print(
                  "viz-export-concept-tree: concept not handled: `" + renamed_Super + "'");
              throw ((StellaException)
                  (StellaException.newStellaException(stream000.theStringReader())
                      .fillInStackTrace()));
            }
          }
        }
      }
      {
        LogicObject sub = null;
        edu.isi.powerloom.PlIterator iter003 =
            edu.isi.powerloom.PLI.getProperSubrelations(concept, module, null);

        while (iter003.nextP()) {
          sub = ((LogicObject) (iter003.value));
          if (Surrogate.subtypeOfP(
              Stella_Object.safePrimaryType(sub), OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
            {
              LogicObject sub000 = ((LogicObject) (sub));

              self.vizExportConcept(sub000, module);
            }
          } else {
            {
              OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print(
                  "viz-export-concept-tree: concept not handled: `" + sub + "'");
              throw ((StellaException)
                  (StellaException.newStellaException(stream001.theStringReader())
                      .fillInStackTrace()));
            }
          }
        }
      }
    }
  }
示例#16
0
  public void vizConceptLinksToDotEdges(LogicObject concept, Module module) {
    {
      VizInfo self = this;

      {
        OutputStream stream = self.stream;
        int count = 0;

        {
          LogicObject renamed_Super = null;
          edu.isi.powerloom.PlIterator iter000 =
              edu.isi.powerloom.PLI.getDirectSuperrelations(concept, module, null);

          while (iter000.nextP()) {
            renamed_Super = ((LogicObject) (iter000.value));
            if (Surrogate.subtypeOfP(
                Stella_Object.safePrimaryType(renamed_Super),
                OntosaurusUtil.SGT_LOGIC_NAMED_DESCRIPTION)) {
              {
                NamedDescription super000 = ((NamedDescription) (renamed_Super));

                if (self.vizAllowedObjectP(super000)) {
                  stream.nativeStream.println(
                      "  \""
                          + OntosaurusUtil.vizDotObjectName(super000)
                          + "\" -> \""
                          + OntosaurusUtil.vizDotObjectName(concept)
                          + "\" [dir=back]");
                  count = count + 1;
                } else {
                  stream.nativeStream.print(
                      "  \""
                          + OntosaurusUtil.vizDotObjectName(super000)
                          + "\" [shape=box, style=filled, fillcolor=grey,URL=\""
                          + self.vizGenerateOntosaurusHandle(super000)
                          + "\"]");
                  stream.nativeStream.println(
                      "  \""
                          + OntosaurusUtil.vizDotObjectName(super000)
                          + "\" -> \""
                          + OntosaurusUtil.vizDotObjectName(concept)
                          + "\" [dir=back]");
                  count = count + 1;
                }
              }
            } else {
              {
                OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                stream000.nativeStream.print(
                    "viz-concept-links-to-dot-edges: unhandled super concept: `"
                        + renamed_Super
                        + "'");
                throw ((StellaException)
                    (StellaException.newStellaException(stream000.theStringReader())
                        .fillInStackTrace()));
              }
            }
          }
        }
        if ((count == 0) && self.addTopP) {
          stream.nativeStream.println(
              "  \""
                  + OntosaurusUtil.VIZ_TOP
                  + "\" -> \""
                  + OntosaurusUtil.vizDotObjectName(concept)
                  + "\" [dir=back]");
        }
        if (self.showRelationsP) {
          {
            LogicObject range = null;
            String relcolor = self.relationColor;
            String relstyle = self.relationStyle;

            {
              Object old$Module$000 = Stella.$MODULE$.get();
              Object old$Context$000 = Stella.$CONTEXT$.get();

              try {
                Native.setSpecial(Stella.$MODULE$, module);
                Native.setSpecial(Stella.$CONTEXT$, ((Module) (Stella.$MODULE$.get())));
                {
                  LogicObject relation = null;
                  Cons iter001 = self.vizGetBinaryRelationsOf(concept);

                  for (; !(iter001 == Stella.NIL); iter001 = iter001.rest) {
                    relation = ((LogicObject) (iter001.value));
                    range = edu.isi.powerloom.PLI.getRange(relation);
                    if (self.vizAllowedObjectP(relation)) {
                      stream.nativeStream.println(
                          "  \""
                              + OntosaurusUtil.vizDotObjectName(concept)
                              + "\" -> \""
                              + OntosaurusUtil.vizDotObjectName(range)
                              + "\" [label=\""
                              + OntosaurusUtil.vizDotObjectName(relation)
                              + "\", color="
                              + relcolor
                              + ", style="
                              + relstyle
                              + "]");
                    }
                  }
                }

              } finally {
                Stella.$CONTEXT$.set(old$Context$000);
                Stella.$MODULE$.set(old$Module$000);
              }
            }
          }
        }
      }
    }
  }
  public static void startupControlPanelScript() {
    {
      Object old$Module$000 = Stella.$MODULE$.get();
      Object old$Context$000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(
            Stella.$MODULE$,
            Stella.getStellaModule("/ONTOSAURUS", Stella.$STARTUP_TIME_PHASE$ > 1));
        Native.setSpecial(Stella.$CONTEXT$, ((Module) (Stella.$MODULE$.get())));
        if (Stella.currentStartupTimePhaseP(2)) {
          OntosaurusUtil.SYM_ONTOSAURUS_STARTUP_CONTROL_PANEL_SCRIPT =
              ((Symbol)
                  (GeneralizedSymbol.internRigidSymbolWrtModule(
                      "STARTUP-CONTROL-PANEL-SCRIPT", null, 0)));
        }
        if (Stella.currentStartupTimePhaseP(6)) {
          Stella.finalizeClasses();
        }
        if (Stella.currentStartupTimePhaseP(7)) {
          Stella.defineFunctionObject(
              "WRITE-CONTROL-PANEL-SCRIPT",
              "(DEFUN WRITE-CONTROL-PANEL-SCRIPT ((STREAM NATIVE-OUTPUT-STREAM)))",
              Native.find_java_method(
                  "edu.isi.ontosaurus.OntosaurusUtil",
                  "writeControlPanelScript",
                  new java.lang.Class[] {Native.find_java_class("java.io.PrintStream")}),
              null);
          Stella.defineFunctionObject(
              "STARTUP-CONTROL-PANEL-SCRIPT",
              "(DEFUN STARTUP-CONTROL-PANEL-SCRIPT () :PUBLIC? TRUE)",
              Native.find_java_method(
                  "edu.isi.ontosaurus._StartupControlPanelScript",
                  "startupControlPanelScript",
                  new java.lang.Class[] {}),
              null);
          {
            MethodSlot function =
                Symbol.lookupFunction(OntosaurusUtil.SYM_ONTOSAURUS_STARTUP_CONTROL_PANEL_SCRIPT);

            KeyValueList.setDynamicSlotValue(
                function.dynamicSlots,
                OntosaurusUtil.SYM_STELLA_METHOD_STARTUP_CLASSNAME,
                StringWrapper.wrapString("_StartupControlPanelScript"),
                Stella.NULL_STRING_WRAPPER);
          }
        }
        if (Stella.currentStartupTimePhaseP(8)) {
          Stella.finalizeSlots();
          Stella.cleanupUnfinalizedClasses();
        }
        if (Stella.currentStartupTimePhaseP(9)) {
          Stella_Object.inModule(
              ((StringWrapper)
                  (Stella_Object.copyConsTree(StringWrapper.wrapString("ONTOSAURUS")))));
        }

      } finally {
        Stella.$CONTEXT$.set(old$Context$000);
        Stella.$MODULE$.set(old$Module$000);
      }
    }
  }
  public static void startupHttpServerImpl() {
    {
      Object old$Module$000 = Stella.$MODULE$.get();
      Object old$Context$000 = Stella.$CONTEXT$.get();

      try {
        Native.setSpecial(
            Stella.$MODULE$,
            Stella.getStellaModule("/HTTP/TOMCAT", Stella.$STARTUP_TIME_PHASE$ > 1));
        Native.setSpecial(Stella.$CONTEXT$, ((Module) (Stella.$MODULE$.get())));
        if (Stella.currentStartupTimePhaseP(2)) {
          Tomcat.SGT_TOMCAT_HTTP_SERVER_TOMCAT =
              ((Surrogate)
                  (GeneralizedSymbol.internRigidSymbolWrtModule("HTTP-SERVER-TOMCAT", null, 1)));
          Tomcat.KWD_OK = ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("OK", null, 2)));
          Tomcat.SGT_TOMCAT_HTTP_EXCHANGE_TOMCAT =
              ((Surrogate)
                  (GeneralizedSymbol.internRigidSymbolWrtModule("HTTP-EXCHANGE-TOMCAT", null, 1)));
          Tomcat.SYM_TOMCAT_RESPONSE_CODE =
              ((Symbol) (GeneralizedSymbol.internRigidSymbolWrtModule("RESPONSE-CODE", null, 0)));
          Tomcat.SYM_TOMCAT_HANDLER_OPTIONS =
              ((Symbol) (GeneralizedSymbol.internRigidSymbolWrtModule("HANDLER-OPTIONS", null, 0)));
          Tomcat.KWD_BLOCK =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("BLOCK", null, 2)));
          Tomcat.SGT_STELLA_PROPERTY_LIST =
              ((Surrogate)
                  (GeneralizedSymbol.internRigidSymbolWrtModule(
                      "PROPERTY-LIST", Stella.getStellaModule("/STELLA", true), 1)));
          Tomcat.KWD_PATH =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("PATH", null, 2)));
          Tomcat.KWD_HANDLER_TYPE =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("HANDLER-TYPE", null, 2)));
          Tomcat.KWD_ERROR =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("ERROR", null, 2)));
          Tomcat.KWD_HANDLER =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("HANDLER", null, 2)));
          Tomcat.KWD_FILE =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("FILE", null, 2)));
          Tomcat.KWD_DIRECTORY =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("DIRECTORY", null, 2)));
          Tomcat.KWD_CONTENT_TYPE =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("CONTENT-TYPE", null, 2)));
          Tomcat.KWD_HTML =
              ((Keyword) (GeneralizedSymbol.internRigidSymbolWrtModule("HTML", null, 2)));
          Tomcat.SYM_TOMCAT_STARTUP_HTTP_SERVER_IMPL =
              ((Symbol)
                  (GeneralizedSymbol.internRigidSymbolWrtModule(
                      "STARTUP-HTTP-SERVER-IMPL", null, 0)));
          Tomcat.SYM_STELLA_METHOD_STARTUP_CLASSNAME =
              ((Symbol)
                  (GeneralizedSymbol.internRigidSymbolWrtModule(
                      "METHOD-STARTUP-CLASSNAME", Stella.getStellaModule("/STELLA", true), 0)));
        }
        if (Stella.currentStartupTimePhaseP(5)) {
          {
            Stella_Class renamed_Class =
                Stella.defineClassFromStringifiedSource(
                    "HTTP-SERVER-TOMCAT",
                    "(DEFCLASS HTTP-SERVER-TOMCAT (HTTP-SERVER) :PUBLIC? TRUE)");

            renamed_Class.classConstructorCode =
                Native.find_java_method(
                    "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                    "newHttpServerTomcat",
                    new java.lang.Class[] {});
          }
          Stella.defineClassFromStringifiedSource(
              "NATIVE-HTTP-SERVLET-REQUEST",
              "(DEFCLASS NATIVE-HTTP-SERVLET-REQUEST () :JAVA-NATIVE-TYPE \"javax.servlet.http.HttpServletRequest\")");
          Stella.defineClassFromStringifiedSource(
              "NATIVE-HTTP-SERVLET-RESPONSE",
              "(DEFCLASS NATIVE-HTTP-SERVLET-RESPONSE () :JAVA-NATIVE-TYPE \"javax.servlet.http.HttpServletResponse\")");
          {
            Stella_Class renamed_Class =
                Stella.defineClassFromStringifiedSource(
                    "HTTP-EXCHANGE-TOMCAT",
                    "(DEFCLASS HTTP-EXCHANGE-TOMCAT (HTTP-EXCHANGE) :SLOTS ((NATIVE-REQUEST :TYPE NATIVE-HTTP-SERVLET-REQUEST) (NATIVE-RESPONSE :TYPE NATIVE-HTTP-SERVLET-RESPONSE) (RESPONSE-CODE :TYPE INTEGER :INITIALLY (GET-HTTP-RESPONSE-CODE :OK NULL)) (REPLY-STREAM :TYPE NATIVE-OUTPUT-STREAM) (HANDLER-OPTIONS :TYPE PROPERTY-LIST)))");

            renamed_Class.classConstructorCode =
                Native.find_java_method(
                    "edu.isi.webtools.http.tomcat.HttpExchangeTomcat",
                    "newHttpExchangeTomcat",
                    new java.lang.Class[] {});
            renamed_Class.classSlotAccessorCode =
                Native.find_java_method(
                    "edu.isi.webtools.http.tomcat.HttpExchangeTomcat",
                    "accessHttpExchangeTomcatSlotValue",
                    new java.lang.Class[] {
                      Native.find_java_class("edu.isi.webtools.http.tomcat.HttpExchangeTomcat"),
                      Native.find_java_class("edu.isi.stella.Symbol"),
                      Native.find_java_class("edu.isi.stella.Stella_Object"),
                      java.lang.Boolean.TYPE
                    });
          }
        }
        if (Stella.currentStartupTimePhaseP(6)) {
          Stella.finalizeClasses();
        }
        if (Stella.currentStartupTimePhaseP(7)) {
          Stella.defineMethodObject(
              "(DEFMETHOD (START-HTTP-SERVER-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (PORT INTEGER)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "startHttpServerImpl",
                  new java.lang.Class[] {java.lang.Integer.TYPE}),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD STOP-HTTP-SERVER-IMPL ((SERVER HTTP-SERVER-TOMCAT)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "stopHttpServerImpl",
                  new java.lang.Class[] {}),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-HEADER-VALUE-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE) (KEY KEYWORD)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getHeaderValueImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange"),
                    Native.find_java_class("edu.isi.stella.Keyword")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REPLY-HEADER-VALUE-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE) (KEY KEYWORD)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getReplyHeaderValueImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange"),
                    Native.find_java_class("edu.isi.stella.Keyword")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD SET-REPLY-HEADER-VALUE-IMPL ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE) (KEY KEYWORD) (VALUE STRING)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "setReplyHeaderValueImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange"),
                    Native.find_java_class("edu.isi.stella.Keyword"),
                    Native.find_java_class("java.lang.String")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-URI-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestUriImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-URI-QUERY-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestUriQueryImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-URI-PATH-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestUriPathImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-METHOD-IMPL KEYWORD) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestMethodImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-PROTOCOL-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestProtocolImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-BODY-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestBodyImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-LOCAL-ADDRESS-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestLocalAddressImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REQUEST-REMOTE-ADDRESS-IMPL STRING) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getRequestRemoteAddressImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-REPLY-STREAM-IMPL NATIVE-OUTPUT-STREAM) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getReplyStreamImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD SET-RESPONSE-CODE-IMPL ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE) (CODE KEYWORD)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "setResponseCodeImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange"),
                    Native.find_java_class("edu.isi.stella.Keyword")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD PUBLISH-FILE-IMPL ((SERVER HTTP-SERVER-TOMCAT) (PATH STRING) (FILE STRING) (OPTIONS PROPERTY-LIST)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "publishFileImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("java.lang.String"),
                    Native.find_java_class("java.lang.String"),
                    Native.find_java_class("edu.isi.stella.PropertyList")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD PUBLISH-DIRECTORY-IMPL ((SERVER HTTP-SERVER-TOMCAT) (PATH STRING) (DIRECTORY STRING) (OPTIONS PROPERTY-LIST)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "publishDirectoryImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("java.lang.String"),
                    Native.find_java_class("java.lang.String"),
                    Native.find_java_class("edu.isi.stella.PropertyList")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD PUBLISH-HANDLER-IMPL ((SERVER HTTP-SERVER-TOMCAT) (PATH STRING) (HANDLER FUNCTION-CODE) (OPTIONS PROPERTY-LIST)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "publishHandlerImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("java.lang.String"),
                    Native.find_java_class("java.lang.reflect.Method"),
                    Native.find_java_class("edu.isi.stella.PropertyList")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (GET-HANDLER-OPTIONS-IMPL PROPERTY-LIST) ((SERVER HTTP-SERVER-TOMCAT) (XCHG HTTP-EXCHANGE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "getHandlerOptionsImpl",
                  new java.lang.Class[] {
                    Native.find_java_class("edu.isi.webtools.http.HttpExchange")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineMethodObject(
              "(DEFMETHOD (SERVLET-HANDLE-REQUEST HTTP-EXCHANGE-TOMCAT) ((SERVER HTTP-SERVER-TOMCAT) (REQUEST NATIVE-HTTP-SERVLET-REQUEST) (RESPONSE NATIVE-HTTP-SERVLET-RESPONSE)))",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat.HttpServerTomcat",
                  "servletHandleRequest",
                  new java.lang.Class[] {
                    Native.find_java_class("javax.servlet.http.HttpServletRequest"),
                    Native.find_java_class("javax.servlet.http.HttpServletResponse")
                  }),
              ((java.lang.reflect.Method) (null)));
          Stella.defineFunctionObject(
              "STARTUP-HTTP-SERVER-IMPL",
              "(DEFUN STARTUP-HTTP-SERVER-IMPL () :PUBLIC? TRUE)",
              Native.find_java_method(
                  "edu.isi.webtools.http.tomcat._StartupHttpServerImpl",
                  "startupHttpServerImpl",
                  new java.lang.Class[] {}),
              null);
          {
            MethodSlot function = Symbol.lookupFunction(Tomcat.SYM_TOMCAT_STARTUP_HTTP_SERVER_IMPL);

            KeyValueList.setDynamicSlotValue(
                function.dynamicSlots,
                Tomcat.SYM_STELLA_METHOD_STARTUP_CLASSNAME,
                StringWrapper.wrapString("_StartupHttpServerImpl"),
                Stella.NULL_STRING_WRAPPER);
          }
        }
        if (Stella.currentStartupTimePhaseP(8)) {
          Stella.finalizeSlots();
          Stella.cleanupUnfinalizedClasses();
        }
        if (Stella.currentStartupTimePhaseP(9)) {
          Stella_Object.inModule(
              ((StringWrapper)
                  (Stella_Object.copyConsTree(StringWrapper.wrapString("HTTP/TOMCAT")))));
          if ((Http.$HTTP_SERVER_IMPLEMENTATION$ != null)
              && (!Stella_Object.isaP(
                  Http.$HTTP_SERVER_IMPLEMENTATION$, Tomcat.SGT_TOMCAT_HTTP_SERVER_TOMCAT))) {
            throw ((StellaException)
                (StellaException.newStellaException(
                        "Conflicting HTTP server implementation already loaded")
                    .fillInStackTrace()));
          } else {
            Http.$HTTP_SERVER_IMPLEMENTATION$ = HttpServerTomcat.newHttpServerTomcat();
          }
        }

      } finally {
        Stella.$CONTEXT$.set(old$Context$000);
        Stella.$MODULE$.set(old$Module$000);
      }
    }
  }