>> https://github.com/hemmecke/fricas/commit/1ea2f36f0a2bf8dd251cbb0fb6ab810b734d2c88.patch
>>
> 
> Looks good.  However, comment:
> 
> -- Reduce the non-leading terms of x (which is assumed to be non-zero).
>                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> looks strange: I see no check preventing zero and no mathematical
> reason for zero (AFAICS one use 'reduce' to get representation of ideal
> members, in such case polynomial part of x is 0).  Probably
> 'tailReduce' needs quick exit for 0.

Indeed that comment looks strange. I've removed it and also added the
zero test.

However, the code was not wrong, because the loop in tailReduce runs
with the condition zero?(p). There was only a "leadingMonomial(0)" and
"reductum(0)". But both of them yield 0 according to the specification
in FiniteAbelianMonoidRing

http://fricas.github.io/api/AbelianMonoidRing.html#l-abelian-monoid-ring-reductum

Oh... I just now see that for leadingMonomial the specification is not
so explicit, but at least the implementation of PolynomialRing is fine.

http://fricas.github.io/api/AbelianMonoidRing.html#l-abelian-monoid-ring-leading-monomial

https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/poly.spad#L348

but at least the implementation of PolynomialRing is fine.

Actually, I don't think that code should rely on leadingMonomial(0)=0 or
reductum(0)=0. Waldek, what's your opinion on that?

Ralf

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to