member-p function fails
davazp opened this issue · comments
David Vázquez Púa commented
If we eval the following chunk of code in the cl-buchberger package:
(defvar f (make-polynomial '((1 1 0)))) ; f = x
(defvar g (make-polynomial '((1 1 0) (1 0 1)))) ; g = x+y
(defvar i (make-ideal (list f g)))
(member-p (ring* g g) i)
a simple-error is signaled:
There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION RING-ZERO-P (2)>
when called with arguments
(#(#<POLYNOMIAL x> #<POLYNOMIAL x+y>)).
[Condition of type SIMPLE-ERROR]
In fact, though I patched this little bug, the member-p function assumes the generators of ideal are a Groebner basis since the last form evals to nil. So, I think it would fine to normalize ideals computing the Groebner basis when the ideal is initialized.
Juan M. Bello-Rivas commented
Thank you for noticing this. I'll fix it ASAP.