=================================================================== RCS file: /home/cvs/OpenXM/src/k097/lib/minimal/minimal.k,v retrieving revision 1.27 retrieving revision 1.31 diff -u -p -r1.27 -r1.31 --- OpenXM/src/k097/lib/minimal/minimal.k 2000/08/16 22:38:52 1.27 +++ OpenXM/src/k097/lib/minimal/minimal.k 2000/12/10 03:12:20 1.31 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.26 2000/08/10 02:59:08 takayama Exp $ */ +/* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.30 2000/11/19 05:50:30 takayama Exp $ */ #define DEBUG 1 Sordinary = false; /* If you run this program on openxm version 1.1.2 (FreeBSD), @@ -44,13 +44,25 @@ def Sprint2(s) { */ +/* We cannot use load command in the if statement. */ +load("lib/minimal/cohom.k"); -load("cohom.k"); def load_tower() { + local ppp; if (Boundp("k0-tower.sm1.loaded")) { }else{ - sm1(" [(parse) (k0-tower.sm1) pushfile ] extension "); - sm1(" [(parse) (new.sm1) pushfile ] extension "); + if (Tag(GetPathName("k0-tower.sm1")) == 0) { + ppp = GetPathName("lib/minimal/k0-tower.sm1"); + sm1(" [(parse) ppp pushfile ] extension "); + }else{ + sm1(" [(parse) (k0-tower.sm1) pushfile ] extension "); + } + if (Tag(GetPathName("new.sm1")) == 0) { + ppp = GetPathName("lib/minimal/new.sm1"); + sm1(" [(parse) ppp pushfile ] extension "); + }else{ + sm1(" [(parse) (new.sm1) pushfile ] extension "); + } sm1(" /k0-tower.sm1.loaded 1 def "); } sm1(" oxNoX "); @@ -145,6 +157,28 @@ def Max(v) { HelpAdd(["Max", ["Max(v) returns the maximal element in v."]]); +def Kernel(f) { + sm1(" [f] syz /FunctionValue set "); +} +def Syz(f) { + sm1(" [f] syz /FunctionValue set "); +} +HelpAdd(["Kernel", +["Kernel(f) returns the syzygy of f.", + "Return value [b, c]: b is a set of generators of the syzygies of f", + " : c=[gb, backward transformation, syzygy without", + " dehomogenization", + "Example: Weyl(\"x,y\",[[\"x\",-1,\"Dx\",1]]); ", + " s=Kernel([x*Dx+1,Dx^2+x^5]); s[0]:"]]); +/* cf. sm1_syz in cohom.k */ +def Gb(f) { + sm1(" [f] gb /FunctionValue set "); +} +HelpAdd(["Gb", +["Gb(f) returns the Groebner basis of f.", + "cf. Kernel, Weyl."]]); + + /* End of standard functions that should be moved to standard libraries. */ def test0() { local f; @@ -165,7 +199,6 @@ def test1() { } - def Sweyl(v,w) { /* extern WeightOfSweyl ; */ local ww,i,n; @@ -1006,7 +1039,7 @@ def Sminimal(g,opt) { redundantTable = r[1]; reducer = r[2]; bettiTable = SbettiTable(redundantTable); - Sprintln2("Betti numbers are ------"); + Sprintln2("BettiTable ------"); if (Sverbose || Sverbose2) {sm1_pmat(bettiTable);} minRes = SnewArrayOfFormat(freeRes); seq = 0; @@ -1070,9 +1103,9 @@ def Sminimal(g,opt) { Println("0: minimal resolution, 3: Schreyer resolution "); Println("------------ Resolution Summary --------------"); Print("Betti numbers : "); - Println(Map(ansSminimal[0],"Length")); + Println(Join([Length(ansSminimal[0,0,0])],Map(ansSminimal[0],"Length"))); Print("Betti numbers of the Schreyer frame: "); - Println(Map(ansSminimal[3],"Length")); + Println(Join([Length(ansSminimal[3,0,0])],Map(ansSminimal[3],"Length"))); Println("-----------------------------------------------"); sm1(" restoreEnvAfterResolution "); @@ -1509,10 +1542,10 @@ HelpAdd(["SgetShift", def SgetShifts(resmat,w) { local i,n,ans,m0; n = Length(resmat); - ans = NewArray(n); + ans = NewArray(n+1); m0 = NewArray(Length(resmat[0,0])); ans[0] = m0; - for (i=0; i