=================================================================== RCS file: /home/cvs/OpenXM/src/k097/lib/restriction/demo.k,v retrieving revision 1.1 retrieving revision 1.6 diff -u -p -r1.1 -r1.6 --- OpenXM/src/k097/lib/restriction/demo.k 2000/12/14 13:18:41 1.1 +++ OpenXM/src/k097/lib/restriction/demo.k 2001/01/05 11:14:29 1.6 @@ -1,4 +1,4 @@ -/* $OpenXM$ */ +/* $OpenXM: OpenXM/src/k097/lib/restriction/demo.k,v 1.5 2000/12/28 00:08:14 takayama Exp $ */ load["restriction.k"];; load("../ox/ox.k");; @@ -6,7 +6,9 @@ load("../ox/ox.k");; def demoSendAsirCommand(a) { a.executeString("load(\"bfct\");"); a.executeString(" def myann(F) { B=ann(eval_str(F)); print(B); return(map(dp_ptod,B,[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; "); + a.executeString(" def myann0(F) { B=ann0(eval_str(F)); print(B); return(map(dp_ptod,B[1],[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; "); a.executeString(" def mybfct(F) { return(rtostr(bfct(eval_str(F)))); }; "); + a.executeString(" def mygeneric_bfct(F,VV,DD,WW) { print([F,VV,DD,WW]); return(generic_bfct(F,VV,DD,WW));}; "); } as = startAsir(); @@ -31,6 +33,46 @@ def asirAnnfsXYZ(a,f) { return(b); } + +def asir_generic_bfct(a,ii,vv,dd,ww) { + local ans; + ans = a.rpc_str("mygeneric_bfct",[ii,vv,dd,ww]); + return(ans); +} +/* a=startAsir(); + asir_generic_bfct(a,[Dx^2+Dy^2-1,Dx*Dy-4],[x,y],[Dx,Dy],[1,1]): */ + +/* usage: misc/tmp/complex-ja.texi */ +def ChangeRing(f) { + local r; + r = GetRing(f); + if (Tag(r) == 14) { + SetRing(r); + return(true); + }else{ + return(false); + } +} + +def asir_BfRoots2(G) { + local bb,ans,ss; + sm1(" G flatten {dehomogenize} map /G set "); + ChangeRing(G); + ss = asir_generic_bfct(asssssir,G,[x,y],[Dx,Dy],[1,1]); + bb = [ss]; + sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set "); + return([ans, bb]); +} +def asir_BfRoots3(G) { + local bb,ans,ss; + sm1(" G flatten {dehomogenize} map /G set "); + ChangeRing(G); + ss = asir_generic_bfct(asssssir,G,[x,y,z],[Dx,Dy,Dz],[1,1,1]); + bb = [ss]; + sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set "); + return([ans, bb]); +} + def findMinSol(f) { sm1(" f (string) dc findIntegralRoots 0 get (universalNumber) dc /FunctionValue set "); } @@ -49,6 +91,7 @@ def asirAnnXYZ(a,f) { return(b); } + def nonquasi2(p,q) { local s,ans,f; f = x^p+y^q+x*y^(q-1); @@ -65,11 +108,62 @@ def nonquasi2(p,q) { Res = Sminimal(pp); Res0 = Res[0]; Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0); - R = BfRoots1(Res0[0],"x,y"); +/* R = BfRoots1(Res0[0],"x,y"); */ + R = asir_BfRoots2(Res0[0]); Println("Step3: computing the cohomology of the truncated complex."); Print("Roots and b-function are "); Println(R); R0 = R[0]; Ans=Srestall(Res0, ["x", "y"], ["x", "y"], R0[Length(R0)-1]); Print("Answer is "); Println(Ans[0]); + return(Ans); +} + +def asirAnn0XYZ(a,f) { + local p,b,b0; + RingD("x,y,z,s"); /* Fix!! See the definition of myann() */ + p = ToString(f); + b = a.rpc("myann0",[p]); + Print("Annhilating ideal of f^r is "); Println(b); + return(b); +} + +def DeRham2WithAsir(f) { + local s; + s = ToString(f); + II = asirAnn0XYZ(asssssir,f); + Print("Step 1: Annhilating ideal (II)"); Println(II); + sm1(" II { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set "); + Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]); + pp = Map(II,"Spoly"); + Res = Sminimal(pp); + Res0 = Res[0]; + Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0); + /* R = BfRoots1(Res0[0],"x,y"); */ + R = asir_BfRoots2(Res0[0]); + Println("Step3: computing the cohomology of the truncated complex."); + Print("Roots and b-function are "); Println(R); + R0 = R[0]; + Ans=Srestall(Res0, ["x", "y"], ["x", "y"],R0[Length(R0)-1] ); + Print("Answer is ");Println(Ans[0]); + return(Ans); +} +def DeRham3WithAsir(f) { + local s; + s = ToString(f); + II = asirAnn0XYZ(asssssir,f); + Print("Step 1: Annhilating ideal (II)"); Println(II); + sm1(" II { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /II set "); + Sweyl("x,y,z",[["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]]); + pp = Map(II,"Spoly"); + Res = Sminimal(pp); + Res0 = Res[0]; + Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0); + /* R = BfRoots1(Res0[0],"x,y,z"); */ + R = asir_BfRoots3(Res0[0]); + Println("Step3: computing the cohomology of the truncated complex."); + Print("Roots and b-function are "); Println(R); + R0 = R[0]; + Ans=Srestall(Res0, ["x", "y", "z"], ["x", "y", "z"],R0[Length(R0)-1] ); + Print("Answer is ");Println(Ans[0]); return(Ans); }