axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] POLY INT =\\= UP(x, INT)


From: William Sit
Subject: Re: [Axiom-math] POLY INT =\\= UP(x, INT)
Date: Fri, 10 Oct 2003 12:15:22 -0400

> Being forced to define functions that have no semantics is sure to lead
> to trouble. 

You are right on this absolutely.
You'll note that even when the = or print or whatever function is meant to be
inherited, that this inheritance is NOT automatic. A line DEFINING the function
in the new domain is still needed:
   x = y == x$Rep = y$Rep.
Certainly there is no categorical algorithm to define these functions and all
functions must be defined based on some data representation. However, Axiom does
not FORCE any domain to define any required function. If = or print (coerce to
OUT) is not implemented, then when such function is called, it will return an
error. So for groups without a solvable word problem, you just leave =
undefined. Indeed there IS a domain OBJECT which (I vaguely remember) is the
parent of SetCategory, where = is not specified. But most domain simply descend
from SetCategory and leave = undefined when it is meaningless or impossible.

> For instance, suppose I have an algorithm that only works
> if I can actually compare elements for equality (with the standard
> mathematical definition of equality, not equality of representations,
> which is only a vaguely useful heuristic approximation).  How can I tell
> if it's safe to apply it to a particular group?

If the mathematical object has a (and it must have one if computation is to be
done) representation, then your mathematical equality algorithm should be
implementable in general based on that representation. In some cases, this may
be a lazy comparison if the representation is only approximate for some of the
elements: for example, for infinite precision reals using a decimal
representation or continued fraction. On the other hand, for algebraic reals
represented by root of a polynomial, there is no true equality because no one
can tell sqrt(2) from - sqrt(2) (conjugates are indistinguishable, and in
effect, the representation represents the SET of all roots, and these SETS can
be compared). 

> If I understand this code correctly, it's doing just what you suggested
> was a bad idea, using _$streamCount$Lisp (which is a global variable,
> right?) to control how many terms to print if you have a non-terminating
> continued fraction.
Yes, the _$streamCount$Lisp variable is global, and its use in the continued
fraction package is strictly speaking poor design. What should be done is to
define something like two print functions, one with a parameter for the length
of the continued function, and the other in terms of the first using the default
value of _$streamCount$Lisp. This first function then is domain specific (one of
its exports) and the second is categorical.

> By the way, in case anyone things I'm too fanatical: 
We are all fanatical, as far as Axiom goes :-).

William




reply via email to

[Prev in Thread] Current Thread [Next in Thread]