DZDjokovic wrote:
However I noticed that there may be a bug in realrad command. I get
an error message if I do the following (using emacs):
LIB "realrad.lib";
ring R=0,(v,q,u,p),lp;
ideal i=v2-4vq+q2+1;
realrad(i);
If I repeat this after changing the ring variable names to say x,y,z,u
then it gives me the answer and there is no error message.
DZ Djokovic
There is indeed a bug in the proc decision.
Consider the following lines, where I have already put a
the buggy part into comments.
Code:
/* line 549 -> */
// perm="varlist="+varstr(r)+";";
// execute(perm); // here BUG
// varlist=delete(varlist,n);
// for (@z=1;@z<n;@z++)
// {
// lessvar=lessvar+","+string(varlist[@z]);
// }
// lessvar=lessvar[2..size(lessvar)];
parvar=string(var(n));
ri="ring r_neu="+charstr(r)+",(@t,"+parvar+","+lessvar+"),dp;";
execute(ri);
/* <- line 559 */
Description of the BUG:
The author of the library wants to replace the
variables v(1),...,var(n) by var(n),var(1),...,var(n-1).
To do this, she passes the ringvariables to a string,
then by using execute to a list, to delete the last element.
This execute has the side effect to
evaluate instead of your ring variables
some local variables, with the same name, used
in the procedure.
Then she builts a new string, puts the last variable name
in front of it and create a new ring by calling execute
again.
Note that this excute does not cause problems.
(Unless a reader wants to know why, I will not explain
why the excute for the ring is OK).
Now the first task can be done without a execute.
Patch of the BUG:
Replace in the 8 lines: 549 - 556
the commented code by the following three lines.
Code:
ideal II = maxideal(1);
varlist = II[1..n-1];
lessvar=string(varlist);
// line 557 ->
parvar=string(var(n));
ri="ring r_neu="+charstr(r)+",(@t,"+parvar+","+lessvar+"),dp;";
execute(ri);
// <- line 559
With this patch, it will work as expected. But
wthout, everybody will run in similar problems when using ringvariables g,f, etc.
Try for instance:
Code:
ring R=0,(v,q,u,p),lp;
ideal i=v2-4vq+q2+1;
realrad(i);
ring Rg=0,(v,g,u,p),lp;
ideal i=v2-4vg+g2+1;
realrad(i);
ring Rf=0,(f,q,u,p),lp;
ideal i=f2-4fq+q2+1;
realrad(i);
C. Gorzel