[BACK]Return to demo.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib / restriction

Annotation of OpenXM/src/k097/lib/restriction/demo.k, Revision 1.6

1.6     ! takayama    1: /* $OpenXM: OpenXM/src/k097/lib/restriction/demo.k,v 1.5 2000/12/28 00:08:14 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)))); }; ");
1.4       takayama   11:   a.executeString(" def mygeneric_bfct(F,VV,DD,WW) { print([F,VV,DD,WW]); return(generic_bfct(F,VV,DD,WW));}; ");
1.1       takayama   12: }
                     13:
                     14: as = startAsir();
                     15: asssssir = as;
                     16: demoSendAsirCommand(as);
                     17: RingD("x,y,z,s");
                     18:
                     19: def asirBfunction(a,f) {
                     20:   local p,b;
                     21:   p = ToString(f);
                     22:   Println(p);
                     23:   b = a.rpc("mybfct",[p]);
                     24:   sm1(" b . /b set ");
                     25:   return(b);
                     26: }
                     27:
                     28: def asirAnnfsXYZ(a,f) {
                     29:   local p,b;
                     30:   RingD("x,y,z,s");  /* Fix!! See the definition of myann() */
                     31:   p = ToString(f);
                     32:   b = a.rpc("myann",[p]);
                     33:   return(b);
                     34: }
                     35:
1.3       takayama   36:
1.4       takayama   37: def asir_generic_bfct(a,ii,vv,dd,ww) {
1.3       takayama   38:    local ans;
1.4       takayama   39:    ans = a.rpc_str("mygeneric_bfct",[ii,vv,dd,ww]);
1.3       takayama   40:    return(ans);
                     41: }
1.4       takayama   42: /* a=startAsir();
                     43:    asir_generic_bfct(a,[Dx^2+Dy^2-1,Dx*Dy-4],[x,y],[Dx,Dy],[1,1]): */
                     44:
                     45: /* usage: misc/tmp/complex-ja.texi */
1.6     ! takayama   46: def ChangeRing(f) {
1.5       takayama   47:   local r;
                     48:   r = GetRing(f);
                     49:   if (Tag(r) == 14) {
                     50:     SetRing(r);
                     51:     return(true);
                     52:   }else{
                     53:     return(false);
1.4       takayama   54:   }
                     55: }
1.3       takayama   56:
                     57: def asir_BfRoots2(G) {
                     58:    local bb,ans,ss;
                     59:    sm1(" G flatten {dehomogenize} map /G set ");
1.6     ! takayama   60:    ChangeRing(G);
1.4       takayama   61:    ss = asir_generic_bfct(asssssir,G,[x,y],[Dx,Dy],[1,1]);
1.3       takayama   62:    bb = [ss];
                     63:    sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");
                     64:    return([ans, bb]);
                     65: }
                     66: def asir_BfRoots3(G) {
                     67:    local bb,ans,ss;
                     68:    sm1(" G flatten {dehomogenize} map /G set ");
1.6     ! takayama   69:    ChangeRing(G);
1.4       takayama   70:    ss = asir_generic_bfct(asssssir,G,[x,y,z],[Dx,Dy,Dz],[1,1,1]);
1.3       takayama   71:    bb = [ss];
                     72:    sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");
                     73:    return([ans, bb]);
                     74: }
                     75:
1.1       takayama   76: def findMinSol(f) {
                     77:   sm1(" f (string) dc findIntegralRoots 0 get (universalNumber) dc /FunctionValue set ");
                     78: }
                     79:
                     80: def asirAnnXYZ(a,f) {
                     81:   local p,b,b0,k1;
                     82:   RingD("x,y,z,s");  /* Fix!! See the definition of myann() */
                     83:   p = ToString(f);
                     84:   b = a.rpc("myann",[p]);
                     85:   Print("Annhilating ideal with s is "); Println(b);
                     86:   b0 = asirBfunction(a,f);
                     87:   Print("bfunction is "); Println(b0);
                     88:   k1 = findMinSol(b0);
                     89:   Print("Minimal integral root is "); Println(k1);
                     90:   sm1(" b { [[(s). k1 (string) dc .]] replace } map /b set ");
                     91:   return(b);
                     92: }
                     93:
1.2       takayama   94:
1.1       takayama   95: def nonquasi2(p,q) {
                     96:   local s,ans,f;
                     97:   f = x^p+y^q+x*y^(q-1);
                     98:   Print("f=");Println(f);
                     99:   s = ToString(f);
                    100:   sm1(" Onverbose ");
                    101:   ans = asirAnnfsXYZ(asssssir,f);
                    102:   sm1(" ans 0 get (ring) dc ring_def ");
                    103:   sm1("[ ans { [[(s). (-1).]] replace } map ] /II set ");
                    104:   Println("Step 1: Annhilating ideal (II)"); Println(II);
                    105:   sm1(" II 0 get { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
                    106:   Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
                    107:   pp = Map(II,"Spoly");
                    108:   Res = Sminimal(pp);
                    109:   Res0 = Res[0];
                    110:   Println("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
1.3       takayama  111: /*  R = BfRoots1(Res0[0],"x,y"); */
                    112:   R = asir_BfRoots2(Res0[0]);
1.1       takayama  113:   Println("Step3: computing the cohomology of the truncated complex.");
                    114:   Print("Roots and b-function are "); Println(R);
                    115:   R0 = R[0];
                    116:   Ans=Srestall(Res0, ["x", "y"],  ["x", "y"], R0[Length(R0)-1]);
                    117:   Print("Answer is "); Println(Ans[0]);
1.2       takayama  118:   return(Ans);
                    119: }
                    120:
                    121: def asirAnn0XYZ(a,f) {
                    122:   local p,b,b0;
                    123:   RingD("x,y,z,s");  /* Fix!! See the definition of myann() */
                    124:   p = ToString(f);
                    125:   b = a.rpc("myann0",[p]);
                    126:   Print("Annhilating ideal of f^r is "); Println(b);
                    127:   return(b);
                    128: }
                    129:
                    130: def DeRham2WithAsir(f) {
                    131:   local s;
                    132:   s = ToString(f);
                    133:   II = asirAnn0XYZ(asssssir,f);
                    134:   Print("Step 1: Annhilating ideal (II)"); Println(II);
                    135:   sm1(" II  { [(x) (y) (Dx) (Dy) ] laplace0 } map /II set ");
                    136:   Sweyl("x,y",[["x",-1,"y",-1,"Dx",1,"Dy",1]]);
                    137:   pp = Map(II,"Spoly");
                    138:   Res = Sminimal(pp);
                    139:   Res0 = Res[0];
                    140:   Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
1.3       takayama  141:   /* R = BfRoots1(Res0[0],"x,y"); */
                    142:   R = asir_BfRoots2(Res0[0]);
1.2       takayama  143:   Println("Step3: computing the cohomology of the truncated complex.");
                    144:   Print("Roots and b-function are "); Println(R);
                    145:   R0 = R[0];
                    146:   Ans=Srestall(Res0, ["x", "y"],  ["x", "y"],R0[Length(R0)-1] );
                    147:   Print("Answer is ");Println(Ans[0]);
                    148:   return(Ans);
                    149: }
                    150: def DeRham3WithAsir(f) {
                    151:   local s;
                    152:   s = ToString(f);
                    153:   II = asirAnn0XYZ(asssssir,f);
                    154:   Print("Step 1: Annhilating ideal (II)"); Println(II);
                    155:   sm1(" II  { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /II set ");
                    156:   Sweyl("x,y,z",[["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]]);
                    157:   pp = Map(II,"Spoly");
                    158:   Res = Sminimal(pp);
                    159:   Res0 = Res[0];
                    160:   Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
1.4       takayama  161:   /* R = BfRoots1(Res0[0],"x,y,z");  */
1.3       takayama  162:   R = asir_BfRoots3(Res0[0]);
1.2       takayama  163:   Println("Step3: computing the cohomology of the truncated complex.");
                    164:   Print("Roots and b-function are "); Println(R);
                    165:   R0 = R[0];
                    166:   Ans=Srestall(Res0, ["x", "y", "z"],  ["x", "y", "z"],R0[Length(R0)-1] );
                    167:   Print("Answer is ");Println(Ans[0]);
1.1       takayama  168:   return(Ans);
                    169: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>