version 1.8, 2011/11/01 00:35:56 |
version 1.11, 2016/11/13 02:09:36 |
|
|
/* $OpenXM: OpenXM/src/asir-contrib/testing/noro/new_pd.rr,v 1.7 2011/08/09 07:49:38 noro Exp $ */ |
/* $OpenXM: OpenXM/src/asir-contrib/testing/noro/new_pd.rr,v 1.10 2014/09/19 00:48:50 ohara Exp $ */ |
import("gr")$ |
import("gr")$ |
module noro_pd$ |
module noro_pd$ |
static GBCheck,F4,EProcs,Procs,SatHomo,GBRat,SuccSat,RepColon$ |
static GBCheck,F4,EProcs,Procs,SatHomo,GBRat,SuccSat,RepColon$ |
Line 40 localf rsgn, find_npos, gen_minipoly, indepset$ |
|
Line 40 localf rsgn, find_npos, gen_minipoly, indepset$ |
|
localf maxindep, maxindep2, contraction, contraction_m, ideal_list_intersection, ideal_intersection$ |
localf maxindep, maxindep2, contraction, contraction_m, ideal_list_intersection, ideal_intersection$ |
localf radical_membership, modular_radical_membership$ |
localf radical_membership, modular_radical_membership$ |
localf radical_membership_rep, ideal_product, saturation$ |
localf radical_membership_rep, ideal_product, saturation$ |
localf sat, satind, sat_ind, colon, isat$ |
localf sat, satind, sat_ind, sat_ind_var, colon, isat$ |
localf ideal_colon, ideal_sat, ideal_inclusion, qd_simp_comp, qd_remove_redundant_comp$ |
localf ideal_colon, ideal_sat, ideal_inclusion, qd_simp_comp, qd_remove_redundant_comp$ |
localf pd_simp_comp, remove_identical_comp$ |
localf pd_simp_comp, remove_identical_comp$ |
localf pd_remove_redundant_comp, ppart, sq, gen_fctr, gen_nf, gen_gb_comp$ |
localf pd_remove_redundant_comp, ppart, sq, gen_fctr, gen_nf, gen_gb_comp$ |
Line 211 def extract_qd(QD,V,Ind) |
|
Line 211 def extract_qd(QD,V,Ind) |
|
def syc_dec(B,V) |
def syc_dec(B,V) |
{ |
{ |
if ( type(SI=getopt(si)) == -1 ) SI = 2; |
if ( type(SI=getopt(si)) == -1 ) SI = 2; |
SIFList=[find_ssi0, find_ssi1,find_ssi2]; |
SIFList=[noro_pd.find_ssi0, noro_pd.find_ssi1, noro_pd.find_ssi2]; |
if ( SI<0 || SI>2 ) error("sycb_dec : si should be 0,1,2"); |
if ( SI<0 || SI>2 ) error("sycb_dec : si should be 0,1,2"); |
SIF = SIFList[SI]; |
SIF = SIFList[SI]; |
|
|
Line 512 def call_prime_dec(G,V,Indep,Lexdec,Mod) |
|
Line 512 def call_prime_dec(G,V,Indep,Lexdec,Mod) |
|
|
|
def extract_qj(Q,V,QL,Rad,Mod,SI,Colon,Level) |
def extract_qj(Q,V,QL,Rad,Mod,SI,Colon,Level) |
{ |
{ |
SIFList=[find_ssi0, find_ssi1,find_ssi2]; |
SIFList=[noro_pd.find_ssi0, noro_pd.find_ssi1, noro_pd.find_ssi2]; |
SIF = SIFList[SI]; |
SIF = SIFList[SI]; |
G = QL[0]; P = QL[1]; PV = QL[2]; |
G = QL[0]; P = QL[1]; PV = QL[2]; |
if ( Q != [1] ) { |
if ( Q != [1] ) { |
Line 531 def syca_dec(B,V) |
|
Line 531 def syca_dec(B,V) |
|
{ |
{ |
T00 = time(); |
T00 = time(); |
if ( type(SI=getopt(si)) == -1 ) SI = 2; |
if ( type(SI=getopt(si)) == -1 ) SI = 2; |
SIFList=[find_si0, find_si1,find_si2]; SIF = SIFList[SI]; |
SIFList=[noro_pd.find_si0, noro_pd.find_si1, noro_pd.find_si2]; |
|
SIF = SIFList[SI]; |
if ( !SIF ) error("syca_dec : si should be 0,1,2"); |
if ( !SIF ) error("syca_dec : si should be 0,1,2"); |
|
|
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
Line 617 def syc0_dec(B,V) |
|
Line 618 def syc0_dec(B,V) |
|
{ |
{ |
T00 = time(); |
T00 = time(); |
if ( type(SI=getopt(si)) == -1 ) SI = 1; |
if ( type(SI=getopt(si)) == -1 ) SI = 1; |
SIFList=[find_si0, find_si1,find_si2,find_ssi0,find_ssi1,find_ssi2]; SIF = SIFList[SI]; |
SIFList=[noro_pd.find_si0, noro_pd.find_si1, noro_pd.find_si2, noro_pd.find_ssi0, noro_pd.find_ssi1, noro_pd.find_ssi2]; |
|
SIF = SIFList[SI]; |
if ( !SIF ) error("syc0_dec : si should be 0,1,2"); |
if ( !SIF ) error("syc0_dec : si should be 0,1,2"); |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Lexdec=getopt(lexdec)) == -1 ) Lexdec = 0; |
if ( type(Lexdec=getopt(lexdec)) == -1 ) Lexdec = 0; |
Line 712 def find_si1(C,G,Q,Rad,V,Ord) { |
|
Line 714 def find_si1(C,G,Q,Rad,V,Ord) { |
|
/* check whether (Q cap (G+S)) = G */ |
/* check whether (Q cap (G+S)) = G */ |
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
|
|
C = qsort(C,comp_tdeg); |
C = qsort(C,noro_pd.comp_tdeg); |
|
|
Tmp = ttttt; TV = cons(Tmp,V); Ord1 = [[0,1],[Ord,length(V)]]; |
Tmp = ttttt; TV = cons(Tmp,V); Ord1 = [[0,1],[Ord,length(V)]]; |
Int0 = incremental_gb(append(vtol(ltov(G)*Tmp),vtol(ltov(Q)*(1-Tmp))), |
Int0 = incremental_gb(append(vtol(ltov(G)*Tmp),vtol(ltov(Q)*(1-Tmp))), |
Line 755 def find_si2(C,G,Q,Rad,V,Ord) { |
|
Line 757 def find_si2(C,G,Q,Rad,V,Ord) { |
|
/* check whether (Q cap (G+S)) = G */ |
/* check whether (Q cap (G+S)) = G */ |
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
|
|
C = qsort(C,comp_tdeg); |
C = qsort(C,noro_pd.comp_tdeg); |
|
|
Dp = dp_gr_print(); dp_gr_print(0); |
Dp = dp_gr_print(); dp_gr_print(0); |
Tmp = ttttt; TV = cons(Tmp,V); Ord1 = [[0,1],[Ord,length(V)]]; |
Tmp = ttttt; TV = cons(Tmp,V); Ord1 = [[0,1],[Ord,length(V)]]; |
Line 775 def find_si2(C,G,Q,Rad,V,Ord) { |
|
Line 777 def find_si2(C,G,Q,Rad,V,Ord) { |
|
print([length(T),I],2); |
print([length(T),I],2); |
S = cons(Ui,S); |
S = cons(Ui,S); |
} |
} |
S = qsort(S,comp_tdeg); |
S = qsort(S,noro_pd.comp_tdeg); |
print(""); |
print(""); |
End = Len = length(S); |
End = Len = length(S); |
|
|
Line 866 def find_ssi1(C,G,Q,Rad,V,Ord) { |
|
Line 868 def find_ssi1(C,G,Q,Rad,V,Ord) { |
|
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
if ( gen_gb_comp(Int,G,Mod) ) { print([0]); return reverse(S); } |
|
|
dp_ord(Ord); DC = map(dp_ptod,C,V); |
dp_ord(Ord); DC = map(dp_ptod,C,V); |
DC = qsort(DC,comp_tord); C = map(dp_dtop,DC,V); |
DC = qsort(DC,noro_pd.comp_tord); C = map(dp_dtop,DC,V); |
print(length(C),2); |
print(length(C),2); |
if ( Reduce ) { |
if ( Reduce ) { |
SC = map(sq,C,Mod); |
SC = map(sq,C,Mod); |
Line 924 def find_ssi2(C,G,Q,Rad,V,Ord) { |
|
Line 926 def find_ssi2(C,G,Q,Rad,V,Ord) { |
|
|
|
#if 0 |
#if 0 |
dp_ord(Ord); DC = map(dp_ptod,C,V); |
dp_ord(Ord); DC = map(dp_ptod,C,V); |
DC = qsort(DC,comp_tord); C = map(dp_dtop,DC,V); |
DC = qsort(DC,noro_pd.comp_tord); C = map(dp_dtop,DC,V); |
#else |
#else |
C = qsort(C,comp_tdeg); |
C = qsort(C,noro_pd.comp_tdeg); |
#endif |
#endif |
if ( Reduce ) { |
if ( Reduce ) { |
for ( T = C, C1 = [], R1 = Rad; T != []; T = cdr(T) ) { |
for ( T = C, C1 = [], R1 = Rad; T != []; T = cdr(T) ) { |
Line 944 def find_ssi2(C,G,Q,Rad,V,Ord) { |
|
Line 946 def find_ssi2(C,G,Q,Rad,V,Ord) { |
|
Ui = U = car(T); |
Ui = U = car(T); |
S = cons([Ui,U],S); |
S = cons([Ui,U],S); |
} |
} |
S = qsort(S,comp_tdeg_first); |
S = qsort(S,noro_pd.comp_tdeg_first); |
print(""); |
print(""); |
|
|
Dp = dp_gr_print(); dp_gr_print(0); |
Dp = dp_gr_print(); dp_gr_print(0); |
Line 1043 def pseudo_dec(G,L,V,Ord) |
|
Line 1045 def pseudo_dec(G,L,V,Ord) |
|
for ( I = 0; I < N; I++ ) { |
for ( I = 0; I < N; I++ ) { |
LI = setminus(L0,[L0[I]]); |
LI = setminus(L0,[L0[I]]); |
PI = ideal_list_intersection(LI,V,Ord|mod=Mod); |
PI = ideal_list_intersection(LI,V,Ord|mod=Mod); |
PI = qsort(PI,comp_tdeg); |
PI = qsort(PI,noro_pd.comp_tdeg); |
for ( T = PI; T != []; T = cdr(T) ) |
for ( T = PI; T != []; T = cdr(T) ) |
if ( gen_nf(car(T),L0[I],V,Ord,Mod) ) break; |
if ( gen_nf(car(T),L0[I],V,Ord,Mod) ) break; |
if ( T == [] ) error("separator : cannot happen"); |
if ( T == [] ) error("separator : cannot happen"); |
SI = satind(G,car(T),V|mod=Mod); |
SI = sat_ind(G,car(T),V|mod=Mod); |
QI = SI[0]; |
QI = SI[0]; |
S[I] = car(T)^SI[1]; |
S[I] = car(T)^SI[1]; |
PV = L[I][1]; |
PV = L[I][1]; |
Line 1061 def pseudo_dec(G,L,V,Ord) |
|
Line 1063 def pseudo_dec(G,L,V,Ord) |
|
#endif |
#endif |
LCFI = lcfactor(GI,V0,Ord,Mod); |
LCFI = lcfactor(GI,V0,Ord,Mod); |
for ( F = 1, T = LCFI, Gt = QI; T != []; T = cdr(T) ) { |
for ( F = 1, T = LCFI, Gt = QI; T != []; T = cdr(T) ) { |
St = satind(Gt,T[0],V|mod=Mod); |
St = sat_ind(Gt,T[0],V|mod=Mod); |
Gt = St[0]; F *= T[0]^St[1]; |
Gt = St[0]; F *= T[0]^St[1]; |
} |
} |
Q[I] = [Gt,L0[I]]; |
Q[I] = [Gt,L0[I]]; |
Line 1154 def prima_dec(B,V) |
|
Line 1156 def prima_dec(B,V) |
|
L = zprimacomp(G,V0|mod=Mod); |
L = zprimacomp(G,V0|mod=Mod); |
F = 1; |
F = 1; |
for ( T = LCF, G2 = G; T != []; T = cdr(T) ) { |
for ( T = LCF, G2 = G; T != []; T = cdr(T) ) { |
S = satind(G2,T[0],V1|mod=Mod); |
S = sat_ind(G2,T[0],V1|mod=Mod); |
G2 = S[0]; F *= T[0]^S[1]; |
G2 = S[0]; F *= T[0]^S[1]; |
} |
} |
for ( T = L, QL = []; T != []; T = cdr(T) ) |
for ( T = L, QL = []; T != []; T = cdr(T) ) |
Line 1263 def prime_dec_main(B,V) |
|
Line 1265 def prime_dec_main(B,V) |
|
T0=time(); |
T0=time(); |
IntP = ideal_intersection_m(IntP,Int,V,0|mod=Mod); |
IntP = ideal_intersection_m(IntP,Int,V,0|mod=Mod); |
dp_ord(0); DC = map(dp_ptod,IntP,V); |
dp_ord(0); DC = map(dp_ptod,IntP,V); |
DC = qsort(DC,comp_tord); IntP = map(dp_dtop,DC,V); |
DC = qsort(DC,noro_pd.comp_tord); IntP = map(dp_dtop,DC,V); |
ACCUM_TIME(Tpint,RTpint) |
ACCUM_TIME(Tpint,RTpint) |
#else |
#else |
IntP = ideal_intersection(IntP,Int,V,0|mod=Mod,gbblock=[[0,length(IntP)]]); |
IntP = ideal_intersection(IntP,Int,V,0|mod=Mod,gbblock=[[0,length(IntP)]]); |
Line 2164 def ideal_product(A,B,V) |
|
Line 2166 def ideal_product(A,B,V) |
|
for ( T = PA; T != []; T = cdr(T) ) |
for ( T = PA; T != []; T = cdr(T) ) |
for ( S = PB; S != []; S = cdr(S) ) |
for ( S = PB; S != []; S = cdr(S) ) |
R = cons([car(T)[0]*car(S)[0],car(T)[1]+car(S)[1]],R); |
R = cons([car(T)[0]*car(S)[0],car(T)[1]+car(S)[1]],R); |
T = qsort(R,comp_by_second); |
T = qsort(R,noro_pd.comp_by_second); |
T = map(first,T); |
T = map(first,T); |
Len = length(A)>length(B)?length(A):length(B); |
Len = length(A)>length(B)?length(A):length(B); |
Len *= 2; |
Len *= 2; |
Line 2232 def isat(B,S,V) |
|
Line 2234 def isat(B,S,V) |
|
return R; |
return R; |
} |
} |
|
|
|
/* buggy; do not use */ |
def satind(G,F,V) |
def satind(G,F,V) |
{ |
{ |
if ( type(Block=getopt(gbblock)) == -1 ) Block = 0; |
if ( type(Block=getopt(gbblock)) == -1 ) Block = 0; |
Line 2269 def satind(G,F,V) |
|
Line 2272 def satind(G,F,V) |
|
return [reverse(R),D1]; |
return [reverse(R),D1]; |
} |
} |
|
|
|
def sat_ind_var(G,F,V) |
|
{ |
|
if ( type(Ord=getopt(ord)) == -1 ) Ord = 0; |
|
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
V0 = append(setminus(V,[F]),[F]); |
|
G0 = nd_gr(G,V0,Mod,0); |
|
M = 0; |
|
for ( G1 = [], T = G0; T != []; T = cdr(T) ) { |
|
S = car(T); |
|
M1 = mindeg(S,F); |
|
S = sdiv(S,F^M1); |
|
G1 = cons(S,G1); |
|
if ( M1 > M ) M = M1; |
|
} |
|
G1 = nd_gr(G1,V,Mod,Ord); |
|
return [G1,M]; |
|
} |
|
|
def sat_ind(G,F,V) |
def sat_ind(G,F,V) |
{ |
{ |
if ( type(Ord=getopt(ord)) == -1 ) Ord = 0; |
if ( type(Ord=getopt(ord)) == -1 ) Ord = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
if ( F == var(F) ) |
|
return sat_ind_var(G,F,V|ord=Ord,mod=Mod); |
NV = ttttt; |
NV = ttttt; |
F = gen_nf(F,G,V,Ord,Mod); |
F = gen_nf(F,G,V,Ord,Mod); |
for ( I = 0, GI = G; ; I++ ) { |
for ( I = 0, GI = G; ; I++ ) { |
Line 2306 def ideal_colon(G,F,V) |
|
Line 2329 def ideal_colon(G,F,V) |
|
G = nd_gr(G,V,Mod,0); |
G = nd_gr(G,V,Mod,0); |
C = [1]; |
C = [1]; |
TV = ttttt; |
TV = ttttt; |
F = qsort(F,comp_tdeg); |
F = qsort(F,noro_pd.comp_tdeg); |
for ( T = F; T != []; T = cdr(T) ) { |
for ( T = F; T != []; T = cdr(T) ) { |
S = colon(G,car(T),V|isgb=1,mod=Mod); |
S = colon(G,car(T),V|isgb=1,mod=Mod); |
if ( type(S[0])!= 1 ) { |
if ( type(S[0])!= 1 ) { |
Line 2837 def separator(P,V) |
|
Line 2860 def separator(P,V) |
|
N = length(P); |
N = length(P); |
dp_ord(0); |
dp_ord(0); |
DP = vector(N); |
DP = vector(N); |
for ( I = 0; I < N; I++ ) DP[I] = qsort(ltov(map(dp_ptod,P[I][0],V)),comp_tord); |
for ( I = 0; I < N; I++ ) DP[I] = qsort(ltov(map(dp_ptod,P[I][0],V)),noro_pd.comp_tord); |
if ( Mod ) |
if ( Mod ) |
for ( I = 0; I < N; I++ ) DP[I] = map(dp_mod,DP[I],Mod,[]); |
for ( I = 0; I < N; I++ ) DP[I] = map(dp_mod,DP[I],Mod,[]); |
Ind = vector(N); |
Ind = vector(N); |
Line 2953 def para_exec(Proc,Task) { |
|
Line 2976 def para_exec(Proc,Task) { |
|
Free = append(Free,Finish0); |
Free = append(Free,Finish0); |
} |
} |
print(""); |
print(""); |
R = qsort(R,comp_by_second); |
R = qsort(R,noro_pd.comp_by_second); |
R = map(first,R); |
R = map(first,R); |
return R; |
return R; |
} |
} |
Line 2972 def redbase(B,V,Mod,Ord) |
|
Line 2995 def redbase(B,V,Mod,Ord) |
|
D = Mod?dp_nf_mod(Ind,D,DM,1,Mod):dp_nf(Ind,D,DM,1); |
D = Mod?dp_nf_mod(Ind,D,DM,1,Mod):dp_nf(Ind,D,DM,1); |
if ( D ) R = cons(D,R); |
if ( D ) R = cons(D,R); |
} |
} |
D = qsort(R,comp_tord); |
D = qsort(R,noro_pd.comp_tord); |
return map(dp_dtop,D,V); |
return map(dp_dtop,D,V); |
} |
} |
|
|