Changes 
http://wiki.axiom-developer.org/382DivideIfCanUnivariatePolynomialDivisionPackageAlgorithm/diff
--
Due to the change on the computing environment when this page is edited, as 
contrary to simply adding comments, the demonstration I posted previously would 
not show as intended if the page is edited (even to correct some typos). The 
entire page would be in one Axiom session instead of two separate Axiom 
sessions once edited and regenerated. If the page must be edited, please delete 
the first batch (original) of Axiom commands, which is reproduced currently as 
the third batch.

That said, the comments I added should have read (after minor grammatical 
corrections):

Yes, the coefficient domain should be an 'IntegralDomain' but the expected 
message would have been that 'divideIfCan' is not implemented in 
'UP(x,ZMOD(9))'. As this is Axiom, what happens is far more complicated than 
that. Note that both 'a' and 'b' are of type 'POLY ZMOD(9)', not 
'UP(x,ZMOD(9))'. Not finding 'divideIfCan' in 'POLY ZMOD(9)', the Interpreter 
coerces 'a' and 'b' to 'UP(x,ZMOD(9))'. Again, not finding 'divideIfCan' in 
'UP(x,ZMOD(9))', both 'a' and 'b' are coerced into 'UP(x,INT)' and the failure 
occurs there. The sequence of coercion selected depends very much on the 
original types of 'a' and 'b' as well as the computing environment at the time 
(compare the two batches, the second is a re-creation of the original; order of 
the batches, that is, whether '(UP(x,ZMOD(9))' is exposed and instantiated or 
not, is important) and I can only characterize the coercions, in TeX parlance, 
as *fragile*. Note that even when '5*a' is obviously divisible by 'a', after 
coercion!
, exact division may not hold! There is a big difference between 't' and 's'.

The lesson to be learnt is that one should investigate the types and to be 
specific when necessary.

\begin{axiom}
a:UP(x,ZMOD(9)):=5*x^7+3
b:UP(x,ZMOD(9)):=2*x^3+7*x
divideIfCan(a,b)$UP(x,ZMOD(9))
\end{axiom}
--
forwarded from http://wiki.axiom-developer.org/[EMAIL PROTECTED]

Reply via email to