Annotation of OpenXM/src/k097/lib/restriction/demo.k, Revision 1.2
1.2 ! takayama 1: /* $OpenXM: OpenXM/src/k097/lib/restriction/demo.k,v 1.1 2000/12/14 13:18:41 takayama Exp $ */
1.1 takayama 2:
3: load["restriction.k"];;
4: load("../ox/ox.k");;
5:
6: def demoSendAsirCommand(a) {
7: a.executeString("load(\"bfct\");");
8: 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])); }; ");
1.2 ! takayama 9: 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])); }; ");
1.1 takayama 10: a.executeString(" def mybfct(F) { return(rtostr(bfct(eval_str(F)))); }; ");
11: }
12:
13: as = startAsir();
14: asssssir = as;
15: demoSendAsirCommand(as);
16: RingD("x,y,z,s");
17:
18: def asirBfunction(a,f) {
19: local p,b;
20: p = ToString(f);
21: Println(p);
22: b = a.rpc("mybfct",[p]);
23: sm1(" b . /b set ");
24: return(b);
25: }
26:
27: def asirAnnfsXYZ(a,f) {
28: local p,b;
29: RingD("x,y,z,s"); /* Fix!! See the definition of myann() */
30: p = ToString(f);
31: b = a.rpc("myann",[p]);
32: return(b);
33: }
34:
35: def findMinSol(f) {
36: sm1(" f (string) dc findIntegralRoots 0 get (universalNumber) dc /FunctionValue set ");
37: }
38:
39: def asirAnnXYZ(a,f) {
40: local p,b,b0,k1;
41: RingD("x,y,z,s"); /* Fix!! See the definition of myann() */
42: p = ToString(f);
43: b = a.rpc("myann",[p]);
44: Print("Annhilating ideal with s is "); Println(b);
45: b0 = asirBfunction(a,f);
46: Print("bfunction is "); Println(b0);
47: k1 = findMinSol(b0);
48: Print("Minimal integral root is "); Println(k1);
49: sm1(" b { [[(s). k1 (string) dc .]] replace } map /b set ");
50: return(b);
51: }
52:
1.2 ! takayama 53:
1.1 takayama 54: def nonquasi2(p,q) {
55: local s,ans,f;
56: f = x^p+y^q+x*y^(q-1);
57: Print("f=");Println(f);
58: s = ToString(f);
59: sm1(" Onverbose ");
60: ans = asirAnnfsXYZ(asssssir,f);
61: sm1(" ans 0 get (ring) dc ring_def ");
62: sm1("[ ans { [[(s). (-1).]] replace } map ] /II set ");
63: Println("Step 1: Annhilating ideal (II)"); Println(II);
64: sm1(" II 0 get { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
65: Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
66: pp = Map(II,"Spoly");
67: Res = Sminimal(pp);
68: Res0 = Res[0];
69: Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
70: R = BfRoots1(Res0[0],"x,y");
71: Println("Step3: computing the cohomology of the truncated complex.");
72: Print("Roots and b-function are "); Println(R);
73: R0 = R[0];
74: Ans=Srestall(Res0, ["x", "y"], ["x", "y"], R0[Length(R0)-1]);
75: Print("Answer is "); Println(Ans[0]);
1.2 ! takayama 76: return(Ans);
! 77: }
! 78:
! 79: def asirAnn0XYZ(a,f) {
! 80: local p,b,b0;
! 81: RingD("x,y,z,s"); /* Fix!! See the definition of myann() */
! 82: p = ToString(f);
! 83: b = a.rpc("myann0",[p]);
! 84: Print("Annhilating ideal of f^r is "); Println(b);
! 85: return(b);
! 86: }
! 87:
! 88: def DeRham2WithAsir(f) {
! 89: local s;
! 90: s = ToString(f);
! 91: II = asirAnn0XYZ(asssssir,f);
! 92: Print("Step 1: Annhilating ideal (II)"); Println(II);
! 93: sm1(" II { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
! 94: Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
! 95: pp = Map(II,"Spoly");
! 96: Res = Sminimal(pp);
! 97: Res0 = Res[0];
! 98: Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
! 99: R = BfRoots1(Res0[0],"x,y");
! 100: Println("Step3: computing the cohomology of the truncated complex.");
! 101: Print("Roots and b-function are "); Println(R);
! 102: R0 = R[0];
! 103: Ans=Srestall(Res0, ["x", "y"], ["x", "y"],R0[Length(R0)-1] );
! 104: Print("Answer is ");Println(Ans[0]);
! 105: return(Ans);
! 106: }
! 107: def DeRham3WithAsir(f) {
! 108: local s;
! 109: s = ToString(f);
! 110: II = asirAnn0XYZ(asssssir,f);
! 111: Print("Step 1: Annhilating ideal (II)"); Println(II);
! 112: sm1(" II { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /II set ");
! 113: Sweyl("x,y,z",[["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]]);
! 114: pp = Map(II,"Spoly");
! 115: Res = Sminimal(pp);
! 116: Res0 = Res[0];
! 117: Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
! 118: R = BfRoots1(Res0[0],"x,y,z");
! 119: Println("Step3: computing the cohomology of the truncated complex.");
! 120: Print("Roots and b-function are "); Println(R);
! 121: R0 = R[0];
! 122: Ans=Srestall(Res0, ["x", "y", "z"], ["x", "y", "z"],R0[Length(R0)-1] );
! 123: Print("Answer is ");Println(Ans[0]);
1.1 takayama 124: return(Ans);
125: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>