     *
     * So computing the set of ancestors of a sort <tt>s</tt> works as
     * follows:
     *
     * <ul>
     *
     * <li/> Let <tt>s.index()</tt> be the index of sort <tt>s</tt> in the
     * array <tt>TAXONOMY</tt> (<i>i.e.</i>, <tt>TAXONOMY[s.index()] ==
     * s</tt>);
     *
     * <li/> Let <tt>nonDescendants</tt> be the set represented as a bit
     * vector of sort indices <tt>i</tt>, such that
     * <tt>nonDescendants.bit(i) = 1</tt> <i>iff</i>
     * <tt>TAXONOMY[i].bit(s.index()) == 0</tt>&mdash;in other words, (a
     * copy of) the Boolean negation of the bit vector
     * <tt>TAXONOMY[i]</tt> obtained as: <tt>nonDescendants =
     * TAXONOMY[i].not().copy()</tt>;
     *
     * <li/> Let <tt>s.ancestors</tt> be a bit vector initialized to be
     * <tt>nonDescendants</tt>;
     *
     * <li/> Set <tt>s.ancestors.bit(j) = 0</tt> whenever
     * <tt>TAXONOMY[j].bit(s.index()) == 0</tt>;
     *
     * <li/> What is left with <tt>s.ancestors</tt> is a bit vector with
     * <tt>1</tt>s in all and only those positions that are indices of
     * sorts that are in <tt>nonDescendants</tt> but comparable with
     * <tt>s</tt>; namely its ancestors.
     *
     * </ul>
     *
     * <p/>
     *
     * This is because all ancestors of <tt>s</tt> must have a code
     * containing a <tt>1</tt> wherever there is a <tt>1</tt> in the
     * code of <tt>s</tt> (because all descendants of <tt>s</tt> are
     * also descencants of any ancestor of <tt>s</tt>, by definition of
     * the transitive-closure code).
     *
     */
    public BitCode getAncestors (Sort sort) throws LockedCodeArrayException
    {
      if (!isLocked())
    	throw new LockedCodeArrayException("Can't compute sort ancestors in a non-encoded taxonomy");

      // If the sort is top, return null:
      if (sort.isTop())
    	return null;

      // If the sort is bottom, return a copy of top:
      if (sort.isBottom())
    	return Sort.top().copy();

      // otherwise, create the negation of the sort's code; it will be a
      // superset of ancestors (as a set, not as a code)
      BitCode wouldBeAncestors = sort.code.not();

      for (IntIterator it = wouldBeAncestors.iterator(); it.hasNext();)
    	{
    	  Int index = it.next();
    	  // TAXONOMY[index] is a potential ancestor of sort"
    	  Sort wouldBeAncestor = TAXONOMY[index];
    	  // keep in as true ancestor only if it is comparable to sort
    	  // (i.e., only if sort.code'sbit at index is equal to 1):
    	  wouldBeAncestors.set(index) = sort.code.get(index);
    	}

      //      System.out.println("\t==> "+wouldBeAncestors);

      return wouldBeAncestors;
    }
    
    //////////////////////////////////////////////////////////////////////
    // The following is the old way,. The new way is the version above.
    //////////////////////////////////////////////////////////////////////
    /**
