First, you should use the data type
ideal, when working
with a collection of polynomials; it offers more functionality than
the data type
list, which must be used when objects of different type should grouped together.
As I understand, you want to define a set of variables, and then
select those polynomials, which depend on all, but only on,
these variables.
Is this what you want to do?
Some ingredients how to do this.
There is a command
variables which, applied to a polynomial, returns an ideal of the variables which occur in the polynomial.
To check if this coincides with those you want to consider,
you have to verify equality of ideals. You do this with the command
reduce by vice versa checking the inclusion.
Best you define a reference polynmial, which is built on the
variables you want to have. Then call this
Code:
proc dependent(ideal I,poly f)
"
USAGE: dependent(I,f); I ideal, f poly
RETURN: ideal, entries of I which contain the same variables as f
0 if no such entry exist
"
{
ideal refvars = variables(f);
ideal J;
int i,j;
for (i=1;i<=ncols(I);i++)
{
if ((reduce(I[i],std(refvars))+0 == 0) and
(reduce(refvars,std(I[i]))+0 == 0) )
{
j++;
J[j]=I[i];
}
}
return(J);
}
Be aware, I don't have tested but just coded it.
Your example then should work as follows:
Code:
> ring r =0,(a,b,c,d,x,y),dp;
> ideal I = a+b+c,x+ab+d^3,y+c;
> dependent(I,abc);
_[1] = a+b+c