[BACK]Return to bfct CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / lib

Annotation of OpenXM_contrib2/asir2000/lib/bfct, Revision 1.4

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.4     ! noro       48:  * $OpenXM: OpenXM_contrib2/asir2000/lib/bfct,v 1.3 2000/08/22 05:04:20 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:        dp_nelim(2);
1.4     ! noro       67:        G0 = dp_weyl_gr_main(B,append(W,DW),0,0,6);
1.1       noro       68:        G1 = [];
                     69:        for ( T = G0; T != []; T = cdr(T) ) {
                     70:                E = car(T); VL = vars(E);
                     71:                if ( !member(y1,VL) && !member(y2,VL) )
                     72:                        G1 = cons(E,G1);
                     73:        }
                     74:        G2 = map(subst,G1,dt,1);
                     75:        G3 = map(b_subst,G2,t);
                     76:        G4 = map(subst,G3,t,-1-s);
                     77:        return G4;
                     78: }
                     79:
                     80: /* b-function of F ? */
                     81:
                     82: def bfct(F)
                     83: {
                     84:        G4 = ann(F);
                     85:
                     86:        V = vars(F);
                     87:        N = length(V);
                     88:        for ( I = N-1, DV = []; I >= 0; I-- )
                     89:                DV = cons(strtov("d"+rtostr(V[I])),DV);
                     90:
                     91:        N1 = 2*(N+1);
                     92:
                     93:        M = newmat(N1+1,N1);
                     94:        for ( J = N+1; J < N1; J++ )
                     95:                M[0][J] = 1;
                     96:        for ( J = 0; J < N+1; J++ )
                     97:                M[1][J] = 1;
                     98: #if 0
                     99:        for ( I = 0; I < N+1; I++ )
                    100:                M[I+2][N-I] = -1;
                    101:        for ( I = 0; I < N; I++ )
                    102:                M[I+2+N+1][N1-1-I] = -1;
                    103: #elif 1
                    104:        for ( I = 0; I < N1-1; I++ )
                    105:                M[I+2][N1-I-1] = 1;
                    106: #else
                    107:        for ( I = 0; I < N1-1; I++ )
                    108:                M[I+2][I] = 1;
                    109: #endif
                    110:        V1 = cons(s,V); DV1 = cons(ds,DV);
1.4     ! noro      111:        G5 = dp_weyl_gr_main(cons(F,G4),append(V1,DV1),0,0,M);
1.1       noro      112:        for ( T = G5, G6 = []; T != []; T = cdr(T) ) {
                    113:                E = car(T);
                    114:                if ( intersection(vars(E),DV1) == [] )
                    115:                        G6 = cons(E,G6);
                    116:        }
                    117:        G6_0 = remove_zero(map(z_subst,G6,V));
                    118:        F0 = flatmf(cdr(fctr(dp_gr_main(G6_0,[s],0,0,0)[0])));
                    119:        for ( T = F0, BF = []; T != []; T = cdr(T) ) {
                    120:                FI = car(T);
                    121:                for ( J = 1; ; J++ ) {
                    122:                        S = map(srem,map(z_subst,idealquo(G6,[FI^J],V1,0),V),FI);
                    123:                        for ( ; S != [] && !car(S); S = cdr(S) );
                    124:                        if ( S != [] )
                    125:                                break;
                    126:                }
                    127:                BF = cons([FI,J],BF);
                    128:        }
                    129:        return BF;
                    130: }
                    131:
                    132: def remove_zero(L)
                    133: {
                    134:        for ( R = []; L != []; L = cdr(L) )
                    135:                if ( car(L) )
                    136:                        R = cons(car(L),R);
                    137:        return R;
                    138: }
                    139:
                    140: def z_subst(F,V)
                    141: {
                    142:        for ( ; V != []; V = cdr(V) )
                    143:                F = subst(F,car(V),0);
                    144:        return F;
                    145: }
                    146:
                    147: def flatmf(L) {
                    148:     for ( S = []; L != []; L = cdr(L) )
                    149:                if ( type(F=car(car(L))) != NUM )
                    150:                        S = append(S,[F]);
                    151:        return S;
                    152: }
                    153:
                    154: def member(A,L) {
                    155:     for ( ; L != []; L = cdr(L) )
                    156:                if ( A == car(L) )
                    157:                        return 1;
                    158:        return 0;
                    159: }
                    160:
                    161: def intersection(A,B)
                    162: {
                    163:        for ( L = []; A != []; A = cdr(A) )
                    164:        if ( member(car(A),B) )
                    165:                L = cons(car(A),L);
                    166:        return L;
                    167: }
                    168:
                    169: def b_subst(F,V)
                    170: {
                    171:        D = deg(F,V);
                    172:        C = newvect(D+1);
                    173:        for ( I = D; I >= 0; I-- )
                    174:                C[I] = coef(F,I,V);
                    175:        for ( I = 0, R = 0; I <= D; I++ )
                    176:                if ( C[I] )
                    177:                        R += C[I]*v_factorial(V,I);
                    178:        return R;
                    179: }
                    180:
                    181: def v_factorial(V,N)
                    182: {
                    183:        for ( J = N-1, R = 1; J >= 0; J-- )
                    184:                R *= V-J;
                    185:        return R;
                    186: }
                    187: end$
                    188:

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