//SINGULAR Procedure4.6.1 proc primaryTest(ideal i, poly p) "USAGE: primaryTest(i,p); i standard basis with respect to lp, p irreducible polynomial in K[var(n)], p^a=i[1] for some a; ASSUME: i is a zero-dimensional ideal. RETURN: an ideal, the radical of i if i is primary and in general position with respect to lp, the zero ideal else. EXAMPLE: primaryTest; shows an example " { int m,e; int n=nvars(basering); poly t; ideal prm=p; for(m=2;m<=size(i);m++) { if(size(ideal(leadexp(i[m])))==1) { n--; //----------------i[m] has a power of var(n) as leading term attrib(prm,"isSB",1); //--- ?? i[m]=(c*var(n)+h)^e modulo prm for h // in K[var(n+1),...], c in K ?? e=deg(lead(i[m])); t=leadcoef(i[m])*e*var(n)+(i[m]-lead(i[m])) /var(n)^(e-1); i[m]=poly(e)^e*leadcoef(i[m])^(e-1)*i[m]; //---if not (0) is returned, else c*var(n)+h is added to prm if (reduce(i[m]-t^e,prm,1) !=0) { return(ideal(0)); } prm = prm,cleardenom(simplify(t,1)); } } return(prm); } ring s=(0,x),(d,e,f,g),lp; ideal i=g^5,(x*f-g)^3,5*e-g^2,x*d^3; primaryTest(i,g);