Giter VIP home page Giter VIP logo

to-do-list's People

Watchers

 avatar  avatar  avatar

to-do-list's Issues

strategy improvement in intersect() using SignatureSB branch

option(redSB);
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(lp(2),lp(1),C);
ideal I = 115*x*y*z^2-67*y^2*z^2,-107*x*y*z^2-10*y^2-148*z;
ideal J = 146*z^3-46*z^2+78*z-93,-119*x^2*y-105*x*y*z;
intersect(I,J);

M2 code:

R = ZZ[x,y,z]

I = ideal { 115*x*y*z^2-67*y^2*z^2, -107*x*y*z^2-10*y^2-148*z }
J = ideal { 146*z^3-46*z^2+78*z-93, -119*x^2*y-105*x*y*z }

IJ = intersect(I,J);

can you reproduce this?

more examples:

option(redSB);
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(lp(2),lp(1),C);
ideal I = 97*x*z+68*y^2,-121*x^3*z-105*y;
ideal J = 132*x*y^2+123*x*z+129*z^2-6,57*x^2+72*x*y;
intersect(I,J);

example with size( std(J) )<>size(std( std(J) )) for global ordering

ring rng = (integer),(x,y,z),(dp(1),dp(2),C);
intvec op = 100663296,16787537;
 option() ;
 option(set, op) ;
int trial = 0;
system("random", 1310165262);
ideal I = 20*x*z+7*y^2;
ideal J = 6*x*y+20*z+6,-5*x-16*y-11,8*x*y+2*y^2;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, size(gJ)== size(ggJ) );
   ? ASSUME failed:           ASSUME(0, size(gJ)== size(ggJ) );

significant performance drop for some examples

the following example drops performance significantly with your patches in comparison to
recent singular spielwiese

// finishes in singular-spielwiese in a bit (correct or not?), but
// does not finish in reasonable time using SignatureSB
ring rng = integer,(x,y,z),dp;
option(redSB); option(redTail);
ideal J = -12xy-59xz+40x-22y2,
-109x-22y2z2-42,
69x2z-97x-115y-19;
ideal stdJ  = std(J);

in M2: (finishes in a bit)

# default is dp ordering:
rng = ZZ[x,y,z]
I = ideal(-12*x*y-59*x*z+40*x-22*y^ 2,-109*x-22*y^ 2*z^ 2-42,69*x^2*z-97*x-115*y-19)
groebnerBasis I

intersect segfault

ring rng = (integer),(x(1)),(lp(1),C);
short = 0 ;
// int trial= 0;
system("random", 1472251352);
ideal I = 4*x(1)^3+35*x(1)^2+24*x(1),45*x(1),35;
ideal J = 18*x(1)^3+43*x(1)^2,-7*x(1)-10,-12*x(1)^2-20*x(1)+13;
ideal I_J =  intersect(I,J);

reduce() bug for local ordering in SignatureSB

ring R = integer,x,dp;
reduce(x,std(2*x));

ring S = integer,x,ls;
reduce(x,std(2*x));

output

> ring R = integer,x,dp;
> reduce(x,std(2*x));
x
> 
. ring S = integer,x,ls;
> reduce(x,std(2*x));
0

std() bug for ds ordering in SignatureSB

ring rng = integer,x,ds;
short = 0 ;
ideal I = -8*x+2*x^2, -16+9*x^2-x^3;
ideal gI =  std(I);
gI;
std(gI);

output

> gI;
gI[1]=16-9*x^2+x^3
gI[2]=8*x-2*x^2
gI[3]=4*x^2-9*x^3
gI[4]=2*x^4
gI[5]=x^5
> std(gI);
_[1]=16-9*x^2+x^3
_[2]=8*x-2*x^2
_[3]=4*x^2-9*x^3
_[4]=x^4

Term wird übersehen??

ring rng = (0),(x,y,z),(ls(3),C);

system("random", 157161605);
ideal I =
68/23_z-142/133_y_z-64/37_x_y+65/71_x_y_z^2+1/3_x^2_y_z,-2/7_x_y_z-61/91_x_y^2_z;
ideal J = 3/53_x_z+47/44_x_y^2_z,-40/107_x_z^2+22_x_z^3;
ideal gI = std(I);
ideal ggI = std(gI);
ideal gJ = std(J);
ideal ggJ = std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) )) );

$;

segfault in std computation using SignatureSB branch

Hello Adi,
I get a segfault for the following example:

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(lp(2),lp(1),C);
int trial = 0;
system("random", 1181381080);
ideal I = 124*x^2+99*x*y,58*x*y+31*y+120*z,65*x^2*z+54*y^2*z+58*y*z+95*y;
ideal J = 52*x*y^3*z+102*y^2,4*x*y^2*z+19*y^3*z-103*y-30;
       ideal gI =  std(I);

can you reproduce this?
(I merged recent Singular into SignatureSB and didn't use your last commit)

medium size failing examples

ring rng = (integer),(x,y),rp;
short = 0 ;
ideal I = -4*y^2+x-1,2*y^2+6*x*y-5*y;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
gI;
ggI;       
reduce (I,gI );
reduce (I,ggI );
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );

////////////////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y),(lp(1),lp(1),C);
short = 0 ;
ideal J = -x^2-3*x,6*x*y^2+10*x*y+5*y^2;
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, idealsEqual(gJ,ggJ ));
ASSUME(0, size(gJ)== size(ggJ) );

segfault in qring over integers

ring rng = (integer),(x,y,z),(dp(3),C);
ideal Q = x,yz2+5;
qring QR = std(Q);
poly a = z;
ideal J = 5,z,x;
ideal aJJ =  quotient( a*J, J );

Bug

ring r = integer,(a,d,g,h,i,j),ws(-1,-1,-1,-1,-1,-1);
ideal inI= gh+2i, dh+j, d+2g+aj, d+2g+ai;
ideal g= std(inI);

M2 - (not sure if correct)

rng = ZZ[a,d,g,h,i,j, MonomialOrder=>RevLex, Weights=>{-1,-1,-1,-1,-1,-1},Global=>false]
inI = ideal(g_h+2_i,d_h+j,d+2_g+a_j,d+2_g+a*i)
groebnerBasis inI

ring rng = (integer),(x,y,z),(ws(-1,-1,-1),C);
ideal I = 6yz-6,6xy-6yz-8y;
ideal gI =std(I);

sba(): tail not reduced

example:

ring rng = (integer),(x,y,z),dp;
option(redSB);
option(redTail);
ideal I = 24*z^2+33*y,-20*y-42,-29*y-39*z;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal sI =  sba(I);
       ideal ssI =  sba(sI);
sI;
ssI;

output:

> sI;
sI[1]=y+351z-546
sI[2]=3z-44142
sI[3]=182154
> ssI;
ssI[1]=182154
ssI[2]=3z-44142
ssI[3]=y+63756

(351 = 3*117)

ẁhat happens with this example?

option(prot);
  ring rng =  (integer),(x(1),x(3),x(4),x(5)),(dp(4),C);
short = 0;
ideal Q = x(4)^2-x(3)*x(5),
x(3)*x(4)-x(5),
x(3)^2-x(4),
x(1)^2-121*x(5)^2-11*x(5)-1;

Q = std(Q);
qring qr = Q;

 ideal a = x(5)-2;
 ideal j = 6,x(5)-2,x(4)+2,x(3)-2,x(1)+3;
 ideal aJJ = quotient(a*j,j); // ?

correct result can be obtained by

// correct result

proc quotient_alternative(i,j1,j2) 
"USAGE:   quotient_alternative(i,j1,j2);
@*        i,j1,j2 = ideals   
RETURN:   the quotient ideal (j1:j2) in the ring r/i
EXAMPLE:  example quotient_alternative;  shows an example"
{  
  /*ASSUME( 0 , isCommutative( ) );
  ASSUME( 0 , hasGlobalOrdering( basering ) );  

  if ( baseringIsExtensionField()   ||   
         not (  baseringHasIntegerCoefficientRing()  ||
                baseringHasRationalCoefficientField() ||
                baseringHasPrimeCoefficientField()
           ) 
      )
  { 
      ERROR("quotient_alternative does not support given ring type");
  }
   */

   def BAS = basering;                                                  
   int j,k;
   ideal q = 1;                                                        
   for(j = 1; j <= ncols(j2); j++)
   {                                      
      ideal s = j2[j], -j1, -i; 
      matrix m = matrix(syz(s));                                                       
      m = m[1,1..ncols(m)];                                        
      matrix n[1][ncols(m)] = m[1,1..ncols(m)];
      ideal qq = n;
      qq = simplify(qq,2);
      q = std( intersect(q,qq) );
      for(k=1; k <= ncols(q); k++)
      {
         if (leadcoef(q[k]) < 0)
         {
            //ERROR("quotient_alternative::Warning: negative leadcoef occured");
            q[k] = -q[k];
         }
      }
      kill m,n,qq,s;
   }
   return(q);
}

// option(prot);

ring rng =  (integer),(s,x,y,z),(dp(4),C);
ideal Q = y^2-x*z, x*y-z, x^2-y, s^2-121*z^2-11*z-1 ;

Q = std(Q);

 ideal a = z-2;
 ideal j = 6,z-2,y+2,x-2,s+3;

 ideal aJJ = quotient_alternative(Q, a*j,j) ;
aJJ;

M2 code?

R = ZZ[s,x,y,z]

Q = ideal    {y^2-x*z, x*y-z, x^2-y, s^2-121*z^2-11*z-1 }

S = R/Q

A = ideal{z-2}

J = ideal(6,z-2,y+2,x-2,s+3);

AJJ = quotient(A*J,J)

// lift AJJ to R and compute gb
gens gb lift( AJJ, R )

simplified bug in std() over integers with ws ordering

ring r = integer,(a,d,g,h,i,j),ws(-1,-1,-1,-1,-1,-1);
ideal inI= gh+2i, dh+j, d+2g+aj, d+2g+ai;
ideal g= std(inI); 


# M2 - (not sure if correct)

 rng = ZZ[a,d,g,h,i,j, MonomialOrder=>RevLex, Weights=>{-1,-1,-1,-1,-1,-1},Global=>false]
 inI = ideal(g*h+2*i,d*h+j,d+2*g+a*j,d+2*g+a*i)
toString entries groebnerBasis inI

simple failing examples over ZZ

ring rng = integer,x,lp;
short = 0 ;
option(noredSB) ;
option(noredTail) ;
ideal I   = -8*x^3+7*x^2-7*x, 8*x^2+10*x-2;
ideal gI  =  std(I);
ideal ggI =  std(gI);
reduce (I,gI ); // <>0 !!
gI;
ggI;

output

> ring rng = integer,x,lp;
> short = 0 ;
> option(noredSB) ;
> option(noredTail) ;
> ideal I   = -8*x^3+7*x^2-7*x, 8*x^2+10*x-2;
> ideal gI  =  std(I);
> ideal ggI =  std(gI);
> reduce (I,gI ); // <>0 !!
_[1]=371464849600
_[2]=0
> gI;
gI[1]=3200
gI[2]=2*x-5554
gI[3]=x^2+6023*x
> ggI;
ggI[1]=1600
ggI[2]=2*x-2354
ggI[3]=x^2+2823*x

examples ok now:

The patches in SignatureSB fixes several bugs, but now I hit a new one:

//options: redefine loadLib usage prompt

ring rng = (integer),(x(1),x(2),x(3),x(4),x(5)),(dp(5),C);
ideal I  = x(4)^2-x(3)*x(5),x(3)*x(4)-x(5),x(3)^2-x(4),x(1)^2-121*x(5)^2-11*x(5)-1,2*x(3)^3-3*x(3)*x(4)+x(5),-4*x(1)*x(4)^2-2*x(1)*x(3)*x(5),2*x(1)*x(3)*x(4)+2*x(1)*x(5),2*x(1)*x(3)^2-4*x(1)*x(4),484*x(4)^2*x(5)+242*x(3)*x(5)^2+22*x(4)^2+11*x(3)*x(5),-8*x(1)*x(3)*x(4)+2*x(1)*x(5),4*x(1)*x(3)^2,-2*x(1)*x(3),968*x(3)*x(4)*x(5)+44*x(3)*x(4)-242*x(5)^2-11*x(5),-4*x(1)*x(3)^2-2*x(1)*x(4),4*x(1)*x(3),-2*x(1),484*x(3)^2*x(5)+22*x(3)^2+242*x(4)*x(5)+11*x(4);
ideal J  = std(I); // error

update: seems ok now

ring rng = (integer),(x,y),(dp(2),C);
ideal I  = xy-2x-8y,y-2,x-8;
ideal J  = std(I);

finishes now

ring rng = (integer),(x,y),(dp(2),C);
poly  a = 2x;
ideal J = 3y,2x,xy;
ideal aJJ =  quotient( a*J, J );

finishes now

LIB("primdec.lib");
ring rng = (integer),(xs,xp,xm),(lp(2),lp(1),C);
ideal I = 4*xm^2-8,14*xm^2+1;
ideal J = -5*xs-14;
ideal A = intersect(std(I),std(J)); //ok
ideal B= intersect(I,J); // takes long time or hangs

seems ok now

problem with parser?


LIB("ring.lib");

proc intersect_via_eliminate(def i, def j) 
"USAGE:   intersect_via_eliminate(i,j);
@*        i,j = ideals
ASSUME:   i,j = ideals over the integers or a field
RETURN:   ideal, the intersection of i and j
EXAMPLE:  example intersect_via_eliminate;  shows an example" 
{

  i = std(i);
  j = std(j);


  int bIsQring =   isQuotientRing( basering );
  ideal q = ideal(basering);

  def BAS = basering;

  // add one new variable "t" to a copy of basering
  int numVariables = nvars(basering);  
  int pos_t = numVariables + 1; // position of new variable 't' is numVariables + 1

  // introduce new variable called "t" 
  // hardcoded, but does not hurt, since there are no parameters. and 'x' is not in conflict with 't'
  string tempstr = "ring pr2=" + charstr(BAS) + ",(x(1.."+  string(numVariables) + "), t), dp;"; 
  execute(tempstr);   

  if ( not bIsQring )
  {
     def r2 = pr2;
  }
  else 
  {
     ideal   q = imap(BAS,q);
     qring r2 = q;
  }

  /*
  list rl = ringlist(basering);

  rl[2] =  indexedVariables("x", numVariables) + list("t");;
  dbprint(printlevel-voice, "rl[2] = ", rl[2] );
  // change variable ordering to dp:
  rl =  changeRingListVarOrderTo_dp (rl);
  dbprint(printlevel-voice, "rl[2] = ", rl[2] );

  // difference to previous variant: if basering is a qring, then r2 is also a qring.
  def r2 = ring(rl);
  setring r2;
  // */
  //dbprint(printlevel-voice, "intersect_via_eliminate:: r2 = ", basering );
  //dbprint(printlevel-voice, "intersect_via_eliminate:: var(pos_t)= ", var(pos_t) );


  // for i=(f_1,...,f_s) and j=(g_1,...,g_t) compute the ideal
  // J=(tf_1,...,tf_s,(1-t)g_1,...,(1-t)g_t)
  // then we eliminate "t" from J and map the new J to our basering
  ideal J = 0;

  int k;
  ideal ii = fetch(BAS,i);
  ii = std(ii); //not necessary due to Anne
  for(k=1; k <= ncols(ii); k++) 
  {
     J = J,var(pos_t)*ii[k];
  }
  ideal jj = fetch(BAS,j);
  jj = std(jj); //not necessary due to Anne
  for(k=1; k <= ncols(jj); k++)
  {
     J = J,(1 - var(pos_t) )*jj[k];
  }

  ideal e = eliminate(J, var(pos_t) );
  setring BAS;

  ideal result1 = fetch(r2,e); 

  for(k=1; k <= ncols(result1); k++)
  {
     if(leadcoef(result1[k]) < 0)
     {
        //ERROR("intersect_via_eliminate::Warning: negative leadcoef occured");
        result1[k] = -result1[k];
     }
  }
  return(result1);
}


//system("random",1412595701);
ring rng = (integer),(xn,xl,xf),(lp(2),lp(1),C);
//int trial: =14;
// ** redefining I **
// ** redefining J **
ideal I = -9*xl-10*xf,-10*xl^2-xf;
ideal J = 15*xl*xf-10*xl,-4*xl*xf+9*xl;
 intersect(I,J);
 intersect(std(I),std(J) );
intersect_via_eliminate(std(I),std(J));

ASSUME(0, idealsEqual(      intersect(I,J), intersect( std(I),  std(J) )      ) );
ASSUME(0, idealsEqual( intersect(I,J), intersect_via_eliminate(I,J) ) );
ideal stdI = std(I);
ideal stdJ = std(J);
ASSUME(0, idealsEqual( intersect(stdI,stdJ), intersect_via_eliminate(stdI,stdJ) ) );
 intersect(std(I),std(J));
 intersect_via_eliminate(std(I),std(J));  // segfault

ok now

ring rng = (integer),(xm,xv,xa),(lp(2),lp(1),C);
//int trial: =2;
// ** redefining I **
// ** redefining J **
ideal I = 4*xm-4,-6*xm+11;
ideal J = -2*xv+11,-15*xm*xv;
 intersect(I,J);
 intersect(std(I),std(J) ); //segfault
 intersect(I,J);
 intersect(std(I),std(J) );

seems ok now

simple example for remaining segfaults

the following example leads to a segfault and
to omError_NullSizeAlloc: alloc of size 0 in debug mode:

ring rng = integer,x,ds;
short = 0 ;
ideal J = -7, -3-15*x^2, -6+18*x-x^2;
ideal gJ =  std(J);

hilb

Make the slice Roune algorithm properly (a function, change the old hilb with this one)

Bug from Gerhard

ring q = (integer,2,3),(r,s,a,b,b_2,b_1,b_0),lp;
poly p0 = b -1_b_0 -2_b_1 -4_b_2;
poly p1 = r-a_b_0;
poly p2 = s_b_0;
poly p3 = s_b_1;
poly p4 = s_b_2;
ideal I = (p0,p1,p2,p3,p4);
poly goal = r- a_b;
poly p = 1 - s;
I = std(I);
I,p;
print("-------std(I,p)-------");
std(I,p); //Segmentation Fault

$;

tail not reduced example

LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(lp(1),lp(2),C);
intvec op = 100663296,16787537;
 option() ;
 option(set, op) ;
 ASSUME(0, optionIsSet("redTail"));
int trial = 5;
system("random", 226841520);
ideal I = -4*x*y*z+9*x*z^2+9*y,-4*x*y*z-3*y;
ideal J = 5*x*y*z+6,8*x*z^2-10*y;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, size(gJ)== size(ggJ) );
ASSUME(0, size(gI)== size(ggI) );
ASSUME(0, idealsEqual(gI,ggI ));
ASSUME(0, idealsEqual(gJ,ggJ ));
ASSUME(0, idealsAreEqual(gI,ggI ));
ASSUME(0, idealsAreEqual(gJ,ggJ ));
ASSUME(0, idealRepresentationReducedTail(gI ));// fails
// idealRepresentationReducedTail :  I[3]4xyz-9xz2-9y
//  idealRepresentationReducedTail: lead(I[2])9xz2
ASSUME(0, idealRepresentationReducedTail(gJ ));
ASSUME(0, idealRepresentationReducedTail(ggI ));
ASSUME(0, idealRepresentationReducedTail(ggJ ));


observed a segfault on SignatureSB branch

// lipmanresolve-with-flint/infiniteTests/log/test.std.correct.04/bugs$ more id_1.4.bug

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
int trial = 3;
system("random", 158291770);
ideal I = -10*x*y*z,12*z^2-8*y-14*x*z+14*x^2*y*z,-7*y^4+4*x^2+9*x^2*y;
ideal J = -1+7*y^3*z,-15+14*x+14*x*y*z,15*z+7*x-10*x*z+5*x*y^2;
       ideal gI =  std(I); // segfault

update: the example failed before commit
adipopescu/Sources@97ae278

detailed example for the intersect() bug in the SignatureSB branch

LIB("primdec.lib");
ring rng = (integer),(x,y,z),lp;
option(redSB);
option(redTail);
ideal I = -4*z+10;
ideal J = -7*x+4*z,-13;
ideal gI = std(I);
ideal gJ = std(J);
ideal IJ   = intersect(I,J) ;
ideal gIJ = intersect( gI,gJ ); // falsch!
ASSUME(0, idealsEqual(IJ , gIJ )   ) ;
gI;
gJ;
IJ;
gIJ;
attrib(gI,"isSB",0);
attrib(gJ,"isSB",0);
ideal ngIJ = intersect(gI,gJ ); // wrong
ngIJ;

output

> ASSUME(0, idealsEqual(IJ , stdI_stdJ )   ) ;
   ? ASSUME failed:ASSUME(0, idealsEqual(IJ , stdI_stdJ )   ) ;
   ? error occurred in or before STDIN line 11: `  return(0);`
> stdI;
stdI[1]=4z-10
> stdJ;
stdJ[1]=13
stdJ[2]=x-8z
> IJ;
IJ[1]=52z-130
IJ[2]=4xz-10x-240z2+15992z-38480
> stdI_stdJ;
stdI_stdJ[1]=52z-130

segfault for 'sba' example

option(redSB);
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
system("random", 1979129011);
ideal I = 40*y*z-35,-8,25*x^2+4*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
ideal sI =  sba(I); //segfault

more examples:

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
int trial = 1;
system("random", 1923388056);
ideal I = -12,23*y+46,26*x*z-31*z;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal sI =  sba(I);


option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
int trial = 0;
system("random", 784341798);
ideal I = -49*y^2+40*z^2+17,-34*z^2-3,-25*y*z-28*z;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal sI =  sba(I);

interesting example for 'idealsEqual'

Assuming that the 'gI' and 'ggI' is ok (please check!)
this is an example for which 'Primdec::idealsEqual' does not work correctly. (Then the documentation
or the implementation of 'idealsEqual' should be updated)

otherwise it is a bug in std():

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
//option("redTail");
option(redSB);
system("random", 1022116625);
ideal I = -14*y*z^2+7*x-11*x*y,-15*x*y,-8*y^2*z^2+5*x*y*z,5*y*z^2-15*y^2*z+8*x^2*z^2+3*x^2*y^2;
ideal gI =  std(I);
ideal ggI =  std(gI);
idealsEqual(gI,ggI ); //0 
quit;

It seems ok after adding 'redTail' option:

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
option(redTail);
system("random", 1022116625);
ideal I = -14*y*z^2+7*x-11*x*y,-15*x*y,-8*y^2*z^2+5*x*y*z,5*y*z^2-15*y^2*z+8*x^2*z^2+3*x^2*y^2;
ideal gI =  std(I);
ideal ggI =  std(gI);
idealsEqual(gI,ggI ); //1
quit;

more examples:

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
int trial = 3;
system("random", 820791554);
ideal I = 1+7*y*z^3,-4*x+2*x*z+14*x^2,-9-10*z^2+8*x*z;
ideal J = -14*x*z^3+5*x^2*y*z,15*z-7*x*y+12*x*y*z^2-11*x*y^2;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, idealsEqual(gI,ggI ));
ASSUME(0, idealsEqual(gJ,ggJ ));
// /lipmanresolve-with-flint/infiniteTests/log/test.std.correct.04/bugs$ more id_1.2.bug

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
int trial = 8;
system("random", 774004311);
ideal I = -3+8*x+3*x*y^2*z-8*x^2*y,8-4*z+2*y;
ideal J = 9*x*z+10*x^2*y*z,-3*y*z^2-8*x-4*x*y*z-4*x^2*z,-9*y^2*z+4*x+5*x*y+x^2;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, idealsEqual(gI,ggI ));
ASSUME(0, idealsEqual(gJ,ggJ ));

//lipmanresolve-with-flint/infiniteTests/log/test.std.correct.04/bugs$ more id_1.3.bug

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(ls(3),C);
int trial = 4;
system("random", 1143393520);
ideal I = -13*z^2-3*y-13*y*z^2-3*x^2*y^2,-11*z+12*y+14*y^2*z-9*x*y*z^2,-12*x+4*x*y*z^2,-7*y*z^3+7*x^2*z+10*x^3*y;
ideal J = -11+9*x*y*z;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
       ideal ggJ =  std(gJ);
ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );
ASSUME(0, idealsEqual(gI,ggI ));

reduce fails for example ; std(J)<> std( std(J) )

option(redSB);
LIB "primdec.lib";
ring rng = (integer),(x,y,z),dp;
ideal I = -25*x^3+104*x*y^3-23*y^2*z-128;
ideal J = -118*x*y^3*z+50*x*y^2*z^2-50*x*y*z-49*y,149*x*y^2*z^2-142*y^2-112;
ideal gI =  std(I);
ideal gJ =  std(J);
reduce (I,gI );
reduce (J,gJ );

ASSUME(0, 0== size( std(reduce (I,gI ) ))  );
ASSUME(0, 0== size( std(reduce (J,gJ ) ))  );

check in M2 says that J == gJ:

R = ZZ[x,y,z]

gJ = ideal(16756*y^4-7100*y^3*z+7301*y^2*z+20316*y^2-5600*y*z+5600,4172000*x*z^2+9383360*y^3*z-3976000*y^2*z^2+9383360*y^2+4088560*y*z^2+7400960*y*z-3136000*z^2+4088560*z+7400960,7450*x*y*z^2+16756*y^3-7100*y^2*z+7301*y*z+13216*y-5600*z,13216*x*y^2*z-5600*x*y*z^2+5600*x*z+5488,x*y^2*z^2-537600*x*y*z^3+537600*x*z^2+1209130*y^2+526848*z+953680,118*x*y^3*z-26880000*x*y*z^3+50*x*y*z+26880000*x*z^2+60456500*y^2+49*y+26342400*z+47684000)

J = ideal(-118*x*y^3*z+50*x*y^2*z^2-50*x*y*z-49*y,149*x*y^2*z^2-142*y^2-112)

J == gJ -- true !

also weird is that std(J) differs from std(std(J)) (look at the second generator):

> gJ;
gJ[1]=7450*x*y*z^2+16756*y^3-7100*y^2*z+7301*y*z+13216*y-5600*z
gJ[2]=4172000*x^2*z^2+4088560*x*y*z^2+9383360*x*y^2+3424960*x*y*z-3136000*x*z^2+4088560*x*z+7400960*x-3896480*y
gJ[3]=9383360*y^3*z-3976000*y^2*z^2+4172000*x*z^2+4088560*y*z^2+9383360*y^2+7400960*y*z-3136000*z^2+4088560*z+7400960
gJ[4]=13216*x*y^2*z-5600*x*y*z^2+5600*x*z+5488
gJ[5]=16756*y^4-404235155900*y^3*z+171286080000*y^2*z^2+7301*y^2*z-179729760000*x*z^2-176135164800*y*z^2-404235128484*y^2-318833362400*y*z+135098880000*z^2-176135164800*z-318833351200
gJ[6]=x*y^2*z^2-537600*x*y*z^3+537600*x*z^2+1209130*y^2+526848*z+953680
gJ[7]=118*x*y^3*z-26880000*x*y*z^3+50*x*y*z+26880000*x*z^2+60456500*y^2+49*y+26342400*z+47684000
> std(gJ);
_[1]=7450*x*y*z^2+16756*y^3-7100*y^2*z+7301*y*z+13216*y-5600*z
_[2]=834400*x^2*z^2+817712*x*y*z^2+1876672*x*y^2+684992*x*y*z-627200*x*z^2+817712*x*z+1480192*x-779296*y
_[3]=1876672*y^3*z-795200*y^2*z^2+834400*x*z^2+817712*y*z^2+1876672*y^2+1480192*y*z-627200*z^2+817712*z+1480192
_[4]=13216*x*y^2*z-5600*x*y*z^2+5600*x*z+5488
_[5]=16756*y^4-404235155900*y^3*z+171286080000*y^2*z^2+7301*y^2*z-179729760000*x*z^2-176135164800*y*z^2-404235128484*y^2-318833362400*y*z+135098880000*z^2-176135164800*z-318833351200
_[6]=x*y^2*z^2-537600*x*y*z^3+537600*x*z^2+1209130*y^2+526848*z+953680
_[7]=118*x*y^3*z-26880000*x*y*z^3+50*x*y*z+26880000*x*z^2+60456500*y^2+49*y+26342400*z+47684000

another failing example:

option(redSB);
LIB "primdec.lib";
LIB "wrappers.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
int trial = 0;
system("random", 912758297);
ideal I = -27*x+25*z,-46*x*z+35*x,21*x-42;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal sI =  sba(I);

reduce (I,gI );

ASSUME(0, 0== size( std(reduce (I,gI ) ))  );

new: std(I)<>std(std(I)) in SignatureSB branch

input:

LIB "primdec.lib";
ring rng = (integer),(x,y,z),dp;
option(redSB);
option(redTail);
ideal I = -5*z^2-y*z^2, x^3*y*z-z^2+1, y^2*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
gI;
ggI;
ASSUME(0, size(gI)==size(ggI));

output:

> ring rng = (integer),(x,y,z),dp;
> option(redSB);
> option(redTail);
> ideal I = -5*z^2-y*z^2, x^3*y*z-z^2+1, y^2*z^2+5*x^2*y*z;
> ideal gI =  std(I);
> ideal ggI =  std(gI);
> gI;
gI[1]=5y+25
gI[2]=25x2-25z
gI[3]=125z3-5z2-25x+5
gI[4]=yz2+5z2
gI[5]=5xz2+25z3-5x
gI[6]=x3yz-z2+1
> ggI;
ggI[1]=y+5
ggI[2]=25x2-25z
ggI[3]=125z3-5z2-25x+5
ggI[4]=5xz2+25z3-5x
ggI[5]=25z4-5x3-z3+z
ggI[6]=5x3z+z2-1
ggI[7]=5x4+xz3+5z4-xz-5z2
ggI[8]=xz4+5z5-2xz2-5z3+x

more variants:

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-73*y*z^2, 68*x^3*y*z-129*x*z^2+98, 11*y^3*z^2+85*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);


ASSUME( size(gI)==size(ggI) );


///////////////////////////////////////

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-73*y*z^2, 2*x^3*y*z-129*x*z^2+8, 11*y^3*z^2+85*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////


LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-73*y*z^2, 2*x^3*y*z-129*x*z^2+8, y^3*z^2+85*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-73*y*z^2, 2*x^3*y*z-129*x*z^2+8, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-73*y*z^2, 2*x^3*y*z-9*x*z^2+8, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-11*y*z^2, 2*x^3*y*z-3*x*z^2+8, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-y*z^2, 2*x^3*y*z-3*x*z^2+8, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(noredSB);
option(noredTail);
ideal I = -5*x*z^2-y*z^2, 2*x^3*y*z-3*x*z^2+8, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(noredSB);
option(noredTail);
ideal I = -5*x*z^2-y*z^2, 2*x^3*y*z-3*x*z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(noredSB);
option(noredTail);
ideal I = -5*x*z^2-y*z^2, 2*x^3*y*z-x*z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(noredSB);
option(noredTail);
ideal I = -5*x*z^2-y*z^2, x^3*y*z-x*z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////

LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-y*z^2, x^3*y*z-x*z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*x*z^2-y*z^2, x^3*y*z-z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);
///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*z^2-y*z^2, x^3*y*z-z^2+1, y^3*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

///////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
option(redSB);
option(redTail);
ideal I = -5*z^2-y*z^2, x^3*y*z-z^2+1, y^2*z^2+5*x^2*y*z;
ideal gI =  std(I);
ideal ggI =  std(gI);
size(gI)==size(ggI);

new segfault examples




ring rng = (integer),(x,y),(lp(1),lp(1),C);
short = 0 ;
ideal I = 19*x^2*y+2*x^2+14*x*y^2-33*x*y,-3*x^4-34*x^2*y^2,18*x^3-32*x^2*y^2-9*y-29;
ideal gI =  std(I);

//////////////////////////////////////////////////////////////////////////////////////////////////
ring rng = (integer),(x,y,z),(Wp(4,2,2),C);
short = 0 ;
ideal J = -42*x^2+25*x*y-3*z^3+10*x,29*z^4+18,-14*x^3*y+25*x*y*z^2+5*z;
ideal gJ =  std(J);

//////////////////////////////////////////////////////////////////////////////////////////////////
ring rng = (integer),(x,y,z),(lp(3),C);
short = 0 ;
ideal I = 29*x^2*z-27*x*y*z^2-16*x*y*z-7*y*z,-19*x*z+30*y*z^2-31*y*z+39,28*x^3*z-32*x*y*z^2-41*x*y;
ideal gI =  std(I);

//////////////////////////////////////////////////////////////////////////////////////////////////
// segfault
ring rng = (integer),(x,y,z),(lp(1),lp(1),lp(1),C);
short = 0 ;
intvec op = 100663296,16787537;
option(set, op) ;
option() ;
system("random", 2146987388);
ideal J = -17*x*y*z+18*z^2,-44*x*y^2*z-33*x*y*z+25*y+7,-x^3*z+31*x+19;
ideal gJ =  std(J);
quit;


// no segfault
ring rng = (integer),(x,y,z),(lp(1),lp(1),lp(1),C);
short = 0 ;
intvec op = 100663296,16787537;
option(set, op) ;
// option() ; 
system("random", 2146987388);
ideal J = -17*x*y*z+18*z^2,-44*x*y^2*z-33*x*y*z+25*y+7,-x^3*z+31*x+19;
ideal gJ =  std(J);
quit;

//////////////////////////////////////////////////////////////////////////////////////////////////
// segfault
ring rng = (integer),(x,y,z),(lp(1),dp(2),C);
short = 0 ;
intvec op = 100663298,16787537;
option(set, op) ;
option() ;
system("random", 1117796194);
ideal I = -2*x^2*y*z+41*y^2*z^2-16*y^2+40*z,20*x*y*z^2+43*x*z^2-19*z,-30*x^2*y^2-20*x^2*z^2-44;
ideal J = 21*x*y^2*z-2*x*y+24*y^2,34*x-26*y^3*z-5*y^2*z;
       ideal gI =  std(I);


//no  segfault      
ring rng = (integer),(x,y,z),(lp(1),dp(2),C);
short = 0 ;
intvec op = 100663298,16787537;
//option(set, op) ;
// option() ;
system("random", 1117796194);
ideal I = -2*x^2*y*z+41*y^2*z^2-16*y^2+40*z,20*x*y*z^2+43*x*z^2-19*z,-30*x^2*y^2-20*x^2*z^2-44;
ideal J = 21*x*y^2*z-2*x*y+24*y^2,34*x-26*y^3*z-5*y^2*z;
       ideal gI =  std(I);

//////////////////////////////////////////////////////////////////////////////////////////////////      

// segfault
ring rng = (integer),(x,y,z),(lp(1),dp(2),C);
short = 0 ;
intvec op = 100663296,16787537;
 option(set, op) ;
// option() ;
ideal I = 13*x^2*z^2-22*x*y+20,27*x^2+26*x*y*z^2+45*x*z^2,5*x^2*z+4*x*y^2*z+2*x*y*z-13*x*z^2;
ideal gI =  std(I);
OK 

// no segfault
ring rng = (integer),(x,y,z),(lp(1),dp(2),C);
short = 0 ;
intvec op = 100663296,16787537;
// option(set, op) ;
// option() ;
ideal I = 13*x^2*z^2-22*x*y+20,27*x^2+26*x*y*z^2+45*x*z^2,5*x^2*z+4*x*y^2*z+2*x*y*z-13*x*z^2;
ideal gI =  std(I);

//////////////////////////////////////////////////////////////////////////////////////////////////
LIB "primdec.lib";
ring rng = (integer),(x,y,z),(dp(3),C);
short = 0 ;
ideal I = 9*x*y-1;
ideal J = 13*x^2*y-11*x*y-10*z,12*x^2*z+15*x*z^2-2*y+6,-6*x^2*z-z^3+4*x*y+4;
       ideal gI =  std(I);
       ideal ggI =  std(gI);
       ideal gJ =  std(J);
OK

Make test with

//ring rng = (integer),(x,y,z),dp;
//ideal i = -5*z^2-y*z^2, x^3*y*z-z^2+1, y^2*z^2+5*x^2*y*z;
//ideal gI =  std(i);
//ideal ggI =  std(gI);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.