At 20:12 +0000 1999/04/27, Kevin Atkinson wrote:
>> So one defines a global total order on the elements of all classes and
>> instances, which then can be used to create maps and sets which are
>> balanced trees, just as in C++ STL. This total order is normally different
>> from any derivation of Ord, and is just used for sorting purposes.
>
>How is this different. Do you mean that some times the ordering is just
>an ordering and as no meanings to humans like an alphabet order does?
Well, to the computer, the main thing is that it exists, as it is needed
for producing the balanced trees. Within that framework, you can do
whatever you wish to please the humans.
Some examples perhaps:
If you have a finite Boolean algebra on n atoms (and 2^n elements), then
there is a natural lattice order (defined by setting x <= y if and only if
x + y = y), but this is not a total order. But if you choose a lexical
order on the atoms, you can extend it to a lexical order on the elements of
the Boolean algebra, which is a total order.
But this total order is unusable for mathematical purposes; it does not
belong to the Boolean algebra as a mathematical object. But it can be used
to list the elements of the Boolean algebra, and to build a balanced tree
as in the C++ STL sets and maps. If you have names on the atoms, you can
use that, but if they are numbered, then you may prefer using that to
produce the total order.
Similarly, for if a class already has a total order, then one can define a
total order on the set of lists with elements in that class, by taking a
lexical order, say by taking lower indices having higher order priority.
But as in the case of the Boolean algebra, this total order needs not
having anything to do with the Ord one is using for mathematical purposes.
Hans Aberg
* Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
* Home Page: <http://www.matematik.su.se/~haberg/>
* AMS member listing: <http://www.ams.org/cml/>