public static void htmlDisplayModuleStats(String title, String head, Module module, org.powerloom.PrintableStringWriter stream, boolean ruleP) {
    { int nconcepts = 0;
      int nrelations = 0;
      int ninstances = 0;
      List allclasses = List.newList();
      List toplevelclasses = List.newList();
      boolean addP = false;

      { Stella_Object renamed_Object = null;
        Iterator iter000 = Logic.allNamedTerms(module, true);

        while (iter000.nextP()) {
          renamed_Object = iter000.value;
          if (Stella_Object.isaP(renamed_Object, OntosaurusUtil.SGT_LOGIC_NAMED_DESCRIPTION)) {
            if (Logic.classP(renamed_Object)) {
              nconcepts = nconcepts + 1;
              allclasses.push(((LogicObject)(renamed_Object)));
            }
            else if (Logic.relationP(renamed_Object)) {
              nrelations = nrelations + 1;
            }
            else {
              ninstances = ninstances + 1;
            }
          }
          else if (Stella_Object.stellaClassP(renamed_Object)) {
            nconcepts = nconcepts + 1;
          }
          else {
            ninstances = ninstances + 1;
          }
        }
      }
      { LogicObject renamed_Class = null;
        Cons iter001 = allclasses.theConsList;

        for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
          renamed_Class = ((LogicObject)(iter001.value));
          addP = true;
          { NamedDescription parent = null;
            Cons iter002 = NamedDescription.allDirectSuperrelations(((NamedDescription)(renamed_Class)), true);

            loop002 : for (;!(iter002 == Stella.NIL); iter002 = iter002.rest) {
              parent = ((NamedDescription)(iter002.value));
              if (allclasses.memberP(parent)) {
                addP = false;
                break loop002;
              }
            }
          }
          if (addP) {
            toplevelclasses.push(renamed_Class);
          }
        }
      }
      OntosaurusUtil.htmlWriteHeaderWithTable(stream, title, head);
      stream.print(nconcepts + " " + OntosaurusUtil.lookupTerm(OntosaurusUtil.KWD_CONCEPT, false, !(nconcepts == 1)) + "; " + nrelations + " " + OntosaurusUtil.lookupTerm(OntosaurusUtil.KWD_RELATION, false, !(nrelations == 1)) + "; " + ninstances + " " + OntosaurusUtil.lookupTerm(OntosaurusUtil.KWD_INSTANCE, false, !(ninstances == 1)) + ";  TOTAL of objects = " + (nconcepts + nrelations + ninstances));
      {
        stream.print("<P>");
        {
          stream.print("<B>");
          stream.print("Top Level Classes:");
          stream.print("</B>");
        }
        stream.println("<BR>");
        if (toplevelclasses.emptyP()) {
          {
            stream.print("<I>");
            stream.print("None");
            stream.println("</I>");
          }
        }
        else {
          {
            stream.print("<DL>");
            toplevelclasses = toplevelclasses.sort(Native.find_java_method("edu.isi.powerloom.logic.LogicObject", "objectNameLessThanP", new java.lang.Class [] {Native.find_java_class("edu.isi.powerloom.logic.LogicObject"), Native.find_java_class("edu.isi.powerloom.logic.LogicObject")}));
            { LogicObject renamed_Class = null;
              Cons iter003 = toplevelclasses.theConsList;

              for (;!(iter003 == Stella.NIL); iter003 = iter003.rest) {
                renamed_Class = ((LogicObject)(iter003.value));
                {
                  stream.print("<DT STYLE='margin-top: 0'>");
                  OntosaurusUtil.htmlWriteHref(stream, "show", "concept", renamed_Class);
                  stream.println("</DT>");
                }
              }
            }
            stream.print("</DL>");
          }
        }
        stream.println("</P>");
      }
      if (ruleP) {
        stream.println("<HR SIZE=2>");
      }
      return;
    }
  }