Bill Allombert on Fri, 2 Nov 2001 16:02:49 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: subst() broken |
On Fri, Nov 02, 2001 at 12:57:38AM -0500, Ilya Zakharevich wrote: > ? subst(Mod(1+y,z),y,Mod(x,z)) > %78 = 0 > ? subst(Mod(y,-b*a^2+t^3),y,Mod(x,-b*a^2+t^3)) > %75 = 0 > ? subst(Mod(1+y,-b*a^2+t^3),y,Mod(x,-b*a^2+t^3)) > %76 = Mod(Mod(1, -b*a^2 + t^3), -b*a^2 + t^3) > > The first two are "just wrong". The last one is such, and also very > unusable... I am not sure subst is broken at all. Maybe Mod is broken from some point of vue but the behaviour you spot is perfectly correct. Remember variable priority is very important in multivariate expression and especially in POLMOD. Assuming the variable order in your examples is ? reorder() %4 = [x, a, b, t, y, z ] (it is the only possibility that make your example works.) Then ? Mod(1+y,z) %2 = 0 ? Mod(x,-b*a^2+t^3) %3 = 0 Mod(1+y,z) involve a division in the ring Q(Z)[Y]. Probably you mean (1+y)*Mod(1,z), but it is not the same thing: it is a polynomial not a POLMOD. So at least %78 and %75 are correct. %76 seems good to me. Why not just writing subst(Mod(1+y,-b*a^2+t^3),y,x) if it what you want ? What were you expecting ? HTH, Bill.