Ralf Hemmecke wrote:
> 
> Hi Waldek,
> 
> Concerning the new domain SmallOrdinal that you've just committed.
> 
>      N ==> NonNegativeInteger
>      PR ==> PolynomialRing(N, %)
>      Rep := PR
> 
>      p1 + p2  == p1::Rep +$Rep p2::Rep
> 
> I am a bit worried about this line.
> What is the compiler doing here? With full types, is it
> 
> [A]  (p1: %) + (p2: %): % == ...
> 

Yes.
> 
> Addition on ordinals is non-commutative. Your implementation of + 
> doesn't look like that. Instead you've introduced ordinalAdd.
>

Look at documentation: 

++  SmallOrdinal implements ordinal numbers up to epsilon_0.  \spad{+}
++  and \spad{*} are "natural" addition and multiplication of ordinals.

Natural operations are commutative, as opposed to "ordered"
definitions (which are usually given without any extra qualification
on the name).  Given that natural operations have better properties
it seems reasnable to give '+' and '*' for them.  If you do not
agree then define category for "near rings" and define new domain
uses SmallOrdinal as Rep and renames operations.
 
> I think your implementation is not in the spirit of PanAxiom. One 
> usually would like to write + even when dealing with ordinals. What 
> exactly is the semantics of your +? It's a commutative one, which 
> doesn't exist in the ordinals.

See books on set theory.  Unfortunately, top Google hits are to
books and I saw no short online source.

> With your implementation you currently allow.
> 
> om := omega()
> 
> x := 1 + om
> y := om + 1
> 
> And I bet, if I compare the two they will be equal, but actually shouldn't.
> 
> I'd rather want that + is the same as ordinalAdd. Otherwise it can get 
> confusing for the user of that domain. In fact, I wouldn't export 
> ordinalAdd, but immediately overload +.
>

If you seriously study ordinal arithmetic you almost immediatly
arrive to natural operations.  Technically, natural operations
allow easy implementation and "ordered" operations require
extra work (using natural ones).

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to