Annotation of OpenXM_contrib2/asir2000/lib/bfct, Revision 1.3
1.2 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.3 ! noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.2 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.3 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/lib/bfct,v 1.2 2000/08/21 08:31:40 noro Exp $
1.2 noro 49: */
1.1 noro 50: /* requires 'primdec' */
51:
52: /* annihilating ideal of F^s ? */
53:
54: def ann(F)
55: {
56: V = vars(F);
57: W = append([y1,y2,t],V);
58: N = length(V);
59: B = [1-y1*y2,t-y1*F];
60: for ( I = N-1, DV = []; I >= 0; I-- )
61: DV = cons(strtov("d"+rtostr(V[I])),DV);
62: DW = append([dy1,dy2,dt],DV);
63: for ( I = 0; I < N; I++ ) {
64: B = cons(DV[I]+y1*diff(F,V[I])*dt,B);
65: }
66: ctrl("do_weyl",1);
67: dp_nelim(2);
68: G0 = dp_gr_main(B,append(W,DW),0,0,6);
69: G1 = [];
70: for ( T = G0; T != []; T = cdr(T) ) {
71: E = car(T); VL = vars(E);
72: if ( !member(y1,VL) && !member(y2,VL) )
73: G1 = cons(E,G1);
74: }
75: G2 = map(subst,G1,dt,1);
76: G3 = map(b_subst,G2,t);
77: G4 = map(subst,G3,t,-1-s);
78: ctrl("do_weyl",0);
79: return G4;
80: }
81:
82: /* b-function of F ? */
83:
84: def bfct(F)
85: {
86: G4 = ann(F);
87:
88: ctrl("do_weyl",1);
89: V = vars(F);
90: N = length(V);
91: for ( I = N-1, DV = []; I >= 0; I-- )
92: DV = cons(strtov("d"+rtostr(V[I])),DV);
93:
94: N1 = 2*(N+1);
95:
96: M = newmat(N1+1,N1);
97: for ( J = N+1; J < N1; J++ )
98: M[0][J] = 1;
99: for ( J = 0; J < N+1; J++ )
100: M[1][J] = 1;
101: #if 0
102: for ( I = 0; I < N+1; I++ )
103: M[I+2][N-I] = -1;
104: for ( I = 0; I < N; I++ )
105: M[I+2+N+1][N1-1-I] = -1;
106: #elif 1
107: for ( I = 0; I < N1-1; I++ )
108: M[I+2][N1-I-1] = 1;
109: #else
110: for ( I = 0; I < N1-1; I++ )
111: M[I+2][I] = 1;
112: #endif
113: V1 = cons(s,V); DV1 = cons(ds,DV);
114: G5 = dp_gr_main(cons(F,G4),append(V1,DV1),0,0,M);
115: for ( T = G5, G6 = []; T != []; T = cdr(T) ) {
116: E = car(T);
117: if ( intersection(vars(E),DV1) == [] )
118: G6 = cons(E,G6);
119: }
120: ctrl("do_weyl",0);
121: G6_0 = remove_zero(map(z_subst,G6,V));
122: F0 = flatmf(cdr(fctr(dp_gr_main(G6_0,[s],0,0,0)[0])));
123: for ( T = F0, BF = []; T != []; T = cdr(T) ) {
124: FI = car(T);
125: for ( J = 1; ; J++ ) {
126: S = map(srem,map(z_subst,idealquo(G6,[FI^J],V1,0),V),FI);
127: for ( ; S != [] && !car(S); S = cdr(S) );
128: if ( S != [] )
129: break;
130: }
131: BF = cons([FI,J],BF);
132: }
133: return BF;
134: }
135:
136: def remove_zero(L)
137: {
138: for ( R = []; L != []; L = cdr(L) )
139: if ( car(L) )
140: R = cons(car(L),R);
141: return R;
142: }
143:
144: def z_subst(F,V)
145: {
146: for ( ; V != []; V = cdr(V) )
147: F = subst(F,car(V),0);
148: return F;
149: }
150:
151: def flatmf(L) {
152: for ( S = []; L != []; L = cdr(L) )
153: if ( type(F=car(car(L))) != NUM )
154: S = append(S,[F]);
155: return S;
156: }
157:
158: def member(A,L) {
159: for ( ; L != []; L = cdr(L) )
160: if ( A == car(L) )
161: return 1;
162: return 0;
163: }
164:
165: def intersection(A,B)
166: {
167: for ( L = []; A != []; A = cdr(A) )
168: if ( member(car(A),B) )
169: L = cons(car(A),L);
170: return L;
171: }
172:
173: def b_subst(F,V)
174: {
175: D = deg(F,V);
176: C = newvect(D+1);
177: for ( I = D; I >= 0; I-- )
178: C[I] = coef(F,I,V);
179: for ( I = 0, R = 0; I <= D; I++ )
180: if ( C[I] )
181: R += C[I]*v_factorial(V,I);
182: return R;
183: }
184:
185: def v_factorial(V,N)
186: {
187: for ( J = N-1, R = 1; J >= 0; J-- )
188: R *= V-J;
189: return R;
190: }
191: end$
192:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>