=================================================================== RCS file: /home/cvs/OpenXM/src/k097/lib/minimal/minimal.k,v retrieving revision 1.9 retrieving revision 1.12 diff -u -p -r1.9 -r1.12 --- OpenXM/src/k097/lib/minimal/minimal.k 2000/05/06 13:41:12 1.9 +++ OpenXM/src/k097/lib/minimal/minimal.k 2000/05/24 15:24:54 1.12 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.8 2000/05/06 10:45:43 takayama Exp $ */ +/* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.11 2000/05/19 11:16:51 takayama Exp $ */ #define DEBUG 1 /* #define ORDINARY 1 */ /* If you run this program on openxm version 1.1.2 (FreeBSD), @@ -6,7 +6,7 @@ ln -s /usr/bin/cpp /lib/cpp */ #define OFFSET 0 -#define TOTAL_STRATEGY +/* #define TOTAL_STRATEGY */ /* #define OFFSET 20*/ /* Test sequences. Use load["minimal.k"];; @@ -1044,12 +1044,25 @@ def Sannfs2(f) { Sweyl("x,y",[["x",1,"y",1,"Dx",1,"Dy",1,"h",1], ["x",-1,"y",-1,"Dx",1,"Dy",1]]); */ /* Sweyl("x,y",[["x",1,"y",1,"Dx",1,"Dy",1,"h",1]]); */ + Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]); pp = Map(p,"Spoly"); return(Sminimal_v(pp)); /* return(Sminimal(pp)); */ } +HelpAdd(["Sannfs2", +["Sannfs2(f) constructs the V-minimal free resolution for the weight (-1,1)", + "of the Laplace transform of the annihilating ideal of the polynomial f in x,y.", + "See also Sminimal_v, Sannfs3.", + "Example: a=Sannfs2(\"x^3-y^2\");", + " b=a[0]; sm1_pmat(b);", + " b[1]*b[0]:", + "Example: a=Sannfs2(\"x*y*(x-y)*(x+y)\");", + " b=a[0]; sm1_pmat(b);", + " b[1]*b[0]:" +]]); + /* Do not forget to turn on TOTAL_STRATEGY */ def Sannfs2_laScala(f) { local p,pp; @@ -1063,6 +1076,17 @@ def Sannfs2_laScala(f) { return(Sminimal(pp)); } +def Sannfs2_laScala2(f) { + local p,pp; + p = Sannfs(f,"x,y"); + sm1(" p 0 get { [(x) (y) (Dx) (Dy)] laplace0 } map /p set "); + p = [p]; + Sweyl("x,y",[["x",1,"y",1,"Dx",1,"Dy",1,"h",1], + ["x",-1,"y",-1,"Dx",1,"Dy",1]]); + pp = Map(p[0],"Spoly"); + return(Sminimal(pp)); +} + def Sannfs3(f) { local p,pp; p = Sannfs(f,"x,y,z"); @@ -1072,6 +1096,14 @@ def Sannfs3(f) { return(Sminimal_v(pp)); } +HelpAdd(["Sannfs3", +["Sannfs3(f) constructs the V-minimal free resolution for the weight (-1,1)", + "of the Laplace transform of the annihilating ideal of the polynomial f in x,y,z.", + "See also Sminimal_v, Sannfs2.", + "Example: a=Sannfs3(\"x^3-y^2*z^2\");", + " b=a[0]; sm1_pmat(b);", + " b[1]*b[0]: b[2]*b[1]:"]]); + /* The betti numbers of most examples are 2,1. (0-th and 1-th). a=Sannfs2("x*y*(x+y-1)"); ==> The betti numbers are 3, 2. @@ -1080,6 +1112,15 @@ def Sannfs3(f) { */ +def Sannfs3_laScala2(f) { + local p,pp; + p = Sannfs(f,"x,y,z"); + sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set "); + Sweyl("x,y,z",[["x",1,"y",1,"z",1,"Dx",1,"Dy",1,"Dz",1,"h",1], + ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]]); + pp = Map(p,"Spoly"); + return(Sminimal(pp)); +} /* The below does not use LaScala-Stillman's algorithm. */ @@ -1331,6 +1372,16 @@ def SpairAndReduction2(skel,level,ii,freeRes,tower,ww, Print("vdegree of the original = "); Println(vdeg); Print("vdegree of the remainder = "); Println(vdeg_reduced); + if (!IsNull(vdeg_reduced)) { + if (vdeg_reduced < vdeg) { + Println("--- Special in V-minimal!"); + Println(tmp[0]); + Println("syzygy="); sm1_pmat(t_syz); + Print("[vdeg, vdeg_reduced] = "); Println([vdeg,vdeg_reduced]); + } + } + + pos = SwhereInTower(syzHead,tower[level]); pos2 = SwhereInTower(tmp[0],tower[level-1]); ans = [tmp[0],t_syz,pos,pos2,vdeg,vdeg_reduced,c2]; @@ -1341,10 +1392,23 @@ def SpairAndReduction2(skel,level,ii,freeRes,tower,ww, return(ans); } +HelpAdd(["Sminimal_v", +["It constructs the V-minimal free resolution from the Schreyer resolution", + "step by step.", + "Example: Sweyl(\"x,y\",[[\"x\",-1,\"y\",-1,\"Dx\",1,\"Dy\",1]]);", + " v=[[2*x*Dx + 3*y*Dy+6, 0],", + " [3*x^2*Dy + 2*y*Dx, 0],", + " [0, x^2+y^2],", + " [0, x*y]];", + " a=Sminimal_v(v);", + " sm1_pmat(a[0]); b=a[0]; b[1]*b[0]:", + "Note: a[0] is the V-minimal resolution. a[3] is the Schreyer resolution."]]); + + def Sminimal_v(g) { local r, freeRes, redundantTable, reducer, maxLevel, minRes, seq, maxSeq, level, betti, q, bases, dr, - betti_levelplus, newbases, i, j,qq; + betti_levelplus, newbases, i, j,qq,tminRes; r = Sschreyer(g); sm1_pmat(r); Debug_Sminimal_v = r; @@ -1399,10 +1463,201 @@ def Sminimal_v(g) { } } } - return([Stetris(minRes,redundantTable), + tminRes = Stetris(minRes,redundantTable); + return([SpruneZeroRow(tminRes), tminRes, [ minRes, redundantTable, reducer,r[3],r[4]],r[0]]); /* r[4] is the redundantTable_ordinary */ /* r[0] is the freeResolution */ } /* Sannfs2("x*y*(x-y)*(x+y)"); is a test problem */ +/* x y (x+y-1)(x-2), x^3-y^2, x^3 - y^2 z^2, + x y z (x+y+z-1) seems to be interesting, because the first syzygy + contains 1. +*/ + +def CopyArray(m) { + local ans,i,n; + if (IsArray(m)) { + n = Length(m); + ans = NewArray(n); + for (i=0; i