Ooops. In OrderedRing I find

     positive? x == x>0
     negative? x == x<0
     sign x ==
         positive? x => 1
         negative? x => -1
         zero? x => 0
         error "x satisfies neither positive?, negative? or zero?"
     abs x ==
         positive? x => x
         negative? x => -x
         zero? x => 0
         error "x satisfies neither positive?, negative? or zero?"

If a ring is equipped with a total order, how can this error case ever occur? It would mean there are elements that are neither 0 nor smaller nor bigger than 0. What kind of total order is this?

Or is it taking care of the Float domain? But Float is only a fake ring for convenience. In the long run I would like to take away the Ring property from Float.

Anyway, if I now provide a patch in moving the above functions to OrderedAbelianGroup, I would like to remove this error case. But I fear that this might change something in other places of FriCAS.

Suggestions?

Ralf


On 6/21/25 13:14, Waldek Hebisch wrote:
On Sat, Jun 21, 2025 at 01:11:12PM +0200, 'Ralf Hemmecke' via FriCAS - computer 
algebra system wrote:
While looking into the generalization of AInterval, I realized that abs is
defined in OrderedRing.

https://fricas.github.io/api/OrderedRing.html#index-1

Technically, it would be OK to define it already in OrderedAbelianGroup.

Basically the definition is

   abs(x) == if x>0 then x else -x

so why is there need to have a multiplication in the structure?

Right, current location of abs is a historical artifact.


--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/2c4d1c1e-008b-427a-a771-fd8cb485adb3%40hemmecke.org.

Reply via email to