version 1.7, 2011/08/09 07:49:38 |
version 1.11, 2016/11/13 02:09:36 |
|
|
/* $OpenXM: OpenXM/src/asir-contrib/testing/noro/new_pd.rr,v 1.6 2011/07/05 07:46:09 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$ |
static GBCheck,F4,EProcs,Procs,SatHomo,GBRat,SuccSat,RepColon$ |
|
|
|
localf radical_membership_sat$ |
localf witness$ |
localf witness$ |
localf get_lc,tomonic,aa,ideal_intersection_m,redbase$ |
localf get_lc,tomonic,aa,ideal_intersection_m,redbase$ |
localf para_exec,nd_gr_rat,competitive_exec,call_func$ |
localf para_exec,nd_gr_rat,competitive_exec,call_func,call_func_serial$ |
localf call_ideal_list_intersection$ |
localf call_ideal_list_intersection$ |
localf call_colon,call_prime_dec$ |
localf call_colon,call_prime_dec$ |
localf prime_dec2, prime_dec_main2$ |
localf prime_dec2, prime_dec_main2$ |
|
|
localf monodec0,monodec,prod$ |
localf monodec0,monodec,prod$ |
localf extract_qd,primary_check$ |
localf extract_qd,primary_check$ |
localf second$ |
localf second$ |
localf gbrat,comp_third_tdeg,comp_tord$ |
localf gbrat,succsat,repcolon,comp_third_tdeg,comp_tord$ |
localf power$ |
localf power$ |
|
|
localf syci_dec, syc_dec$ |
localf syci_dec, syc_dec$ |
Line 36 localf complete_qdecomp, partial_qdecomp, partial_qdec |
|
Line 37 localf complete_qdecomp, partial_qdecomp, partial_qdec |
|
localf partial_decomp, partial_decomp0, zprimacomp, zprimecomp$ |
localf partial_decomp, partial_decomp0, zprimacomp, zprimecomp$ |
localf fast_gb, incremental_gb, elim_gb, ldim, make_mod_subst$ |
localf fast_gb, incremental_gb, elim_gb, ldim, make_mod_subst$ |
localf rsgn, find_npos, gen_minipoly, indepset$ |
localf rsgn, find_npos, gen_minipoly, indepset$ |
localf maxindep, maxindep2, contraction, 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 51 localf gbcheck,f4,sathomo,qd_check,qdb_check$ |
|
Line 52 localf gbcheck,f4,sathomo,qd_check,qdb_check$ |
|
SatHomo=0$ |
SatHomo=0$ |
GBCheck=1$ |
GBCheck=1$ |
GBRat=0$ |
GBRat=0$ |
|
SuccSat=0$ |
|
RepColon=0$ |
|
|
#define MAX(a,b) ((a)>(b)?(a):(b)) |
#define MAX(a,b) ((a)>(b)?(a):(b)) |
#define ACCUM_TIME(C,R) {T1 = time(); C += (T1[0]-T0[0])+(T1[1]-T0[1]); R += (T1[3]-T0[3]); } |
#define ACCUM_TIME(C,R) {T1 = time(); C += (T1[0]-T0[0])+(T1[1]-T0[1]); R += (T1[3]-T0[3]); } |
|
|
def gbrat(A) |
def gbrat(A) |
{ |
{ |
if ( A ) GBRat = 1; |
GBRat = A; |
else GBRat = 0; |
|
} |
} |
|
|
|
def succsat(A) |
|
{ |
|
SuccSat = A; |
|
} |
|
|
|
def repcolon(A) |
|
{ |
|
RepColon = A; |
|
} |
|
|
def gbcheck(A) |
def gbcheck(A) |
{ |
{ |
if ( A ) GBCheck = 1; |
if ( A ) GBCheck = 1; |
Line 166 def qdb_check(B,V,QD) |
|
Line 178 def qdb_check(B,V,QD) |
|
for ( I = 0, Q = [1]; I < N; I++ ) |
for ( I = 0, Q = [1]; I < N; I++ ) |
for ( J = 0, QL = map(first,QD[I]), L = length(QL); |
for ( J = 0, QL = map(first,QD[I]), L = length(QL); |
J < L; J++ ) |
J < L; J++ ) |
Q = ideal_intersection(Q,QL[J],V,0|mod=Mod); |
Q = ideal_intersection_m(Q,QL[J],V,0|mod=Mod); |
|
Q = nd_gr(Q,V,0,0); |
if ( !gen_gb_comp(G,Q,Mod) ) |
if ( !gen_gb_comp(G,Q,Mod) ) |
return 0; |
return 0; |
for ( I = 0; I < N; I++ ) { |
for ( I = 0; I < N; I++ ) { |
Line 198 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 274 def syci_dec(B,V) |
|
Line 287 def syci_dec(B,V) |
|
if ( type(Ass=getopt(ass)) == -1 ) Ass = 0; |
if ( type(Ass=getopt(ass)) == -1 ) Ass = 0; |
if ( type(Colon=getopt(colon)) == -1 ) Colon = 0; |
if ( type(Colon=getopt(colon)) == -1 ) Colon = 0; |
if ( type(Para=getopt(para)) == -1 ) Para = 0; |
if ( type(Para=getopt(para)) == -1 ) Para = 0; |
|
if ( type(Trace=getopt(trace)) == -1 ) Trace = 0; |
Ord = 0; |
Ord = 0; |
Tiso = Tint = Tpd = Text = Tint2 = 0; |
Tiso = Tint = Tpd = Text = Tint2 = 0; |
RTiso = RTint = RTpd = RText = RTint2 = 0; |
RTiso = RTint = RTpd = RText = RTint2 = 0; |
T00 = time(); |
T00 = time(); |
G = fast_gb(B,V,Mod,Ord|trace=1); |
G = fast_gb(B,V,Mod,Ord|trace=Trace); |
IntQ = [1]; QL = RL = []; First = 1; |
IntQ = [1]; QL = RL = []; First = 1; |
for ( Level = 0; ; Level++ ) { |
for ( Level = 0; ; Level++ ) { |
T0 = time(); |
T0 = time(); |
if ( First ) { |
if ( !Level ) { |
PtR = prime_dec(G,V|indep=1,lexdec=Lexdec,mod=Mod,radical=1); |
PtR = prime_dec(G,V|indep=1,lexdec=Lexdec,mod=Mod,radical=1); |
|
ACCUM_TIME(Tfpd,RTfpd) |
Pt = PtR[0]; IntPt = PtR[1]; Rad = IntPt; |
Pt = PtR[0]; IntPt = PtR[1]; Rad = IntPt; |
if ( gen_gb_comp(G,Rad,Mod) ) { |
if ( gen_gb_comp(G,Rad,Mod) ) { |
/* Gt is radical and Gt = cap Pt */ |
/* Gt is radical and Gt = cap Pt */ |
Line 297 ACCUM_TIME(Tpd,RTpd) |
|
Line 312 ACCUM_TIME(Tpd,RTpd) |
|
T0 = time(); |
T0 = time(); |
Rt = iso_comp(G,Pt,V,Ord|mod=Mod,iso=Iso,para=Para,intq=IntQ); |
Rt = iso_comp(G,Pt,V,Ord|mod=Mod,iso=Iso,para=Para,intq=IntQ); |
ACCUM_TIME(Tiso,RTiso) |
ACCUM_TIME(Tiso,RTiso) |
|
if ( !Level ) { |
|
if ( Iso == 3 ) { |
|
NI = length(Rt); |
|
Q = IntQ; |
T0 = time(); |
T0 = time(); |
if ( Iso != 3 ) { |
if ( Para ) { |
IntQ = ideal_list_intersection(map(first,Rt),V,Ord|mod=Mod,para=Para,isgb=1); |
for ( J = 0, Task = []; J < NI; J++ ) { |
|
T = ["noro_pd.extract_qj",Q,V,Rt[J],Rad,Mod,SI,Colon,-1]; |
|
Task = cons(T,Task); |
|
} |
|
Task = reverse(Task); |
|
print("comps:",2); print(length(Task),2); |
|
Rt = para_exec(Para,Task); |
|
} else { |
|
for ( J = 0, T = []; J < NI; J++ ) { |
|
TJ = extract_qj(Q,V,Rt[J],Rad,Mod,SI,Colon,-1); |
|
T = cons(TJ,T); |
|
} |
|
Rt = reverse(T); |
|
} |
|
ACCUM_TIME(Text,RText) |
|
} |
|
print(""); |
|
T0 = time(); |
|
Int = Rad; |
|
for ( T = Rt; T != []; T = cdr(T) ) |
|
if ( !gb_comp(car(T)[0],car(T)[1]) ) |
|
Int = ideal_intersection_m(Int,car(T)[0],V,Ord|mod=Mod); |
|
IntQ = nd_gr(Int,V,Mod,Ord); |
|
ACCUM_TIME(Tint,RTint) |
RL = append(RL,[Rt]); |
RL = append(RL,[Rt]); |
|
} else if ( Iso != 3 ) { |
|
T0 = time(); |
|
IntQ = ideal_list_intersection(map(first,Rt),V,Ord|mod=Mod,isgb=1); |
|
RL = append(RL,[Rt]); |
|
ACCUM_TIME(Tint,RTint) |
} else { |
} else { |
NI = length(Rt); |
NI = length(Rt); |
Q = IntQ; |
Q = IntQ; |
for ( J = 0, T = []; J < NI; J++ ) { |
if ( Para ) { |
TJ = extract_qj(Q,V,Rt[J],Rad,Mod,SI,Colon,-1); |
for ( J = 0, Task = []; J < NI; J++ ) { |
T = cons(TJ,T); |
T = ["noro_pd.extract_qj",Q,V,Rt[J],Rad,Mod,SI,Colon,-1]; |
IntQ = ideal_intersection_m(IntQ,TJ[0],V,Ord|mod=Mod); |
Task = cons(T,Task); |
|
} |
|
Task = reverse(Task); |
|
print("comps:",2); print(length(Task),2); |
|
T0 = time(); |
|
R = para_exec(Para,Task); |
|
ACCUM_TIME(Text,RText) |
|
print(""); |
|
T0 = time(); |
|
IntQ = ideal_list_intersection(cons(IntQ,map(first,R)),V,Ord|mod=Mod); |
|
ACCUM_TIME(Tint,RTint) |
|
RL = append(RL,[R]); |
|
} else { |
|
for ( J = 0, T = []; J < NI; J++ ) { |
|
T0 = time(); |
|
TJ = extract_qj(Q,V,Rt[J],Rad,Mod,SI,Colon,-1); |
|
ACCUM_TIME(Text,RText) |
|
T = cons(TJ,T); |
|
T0 = time(); |
|
IntQ = ideal_intersection_m(IntQ,TJ[0],V,Ord|mod=Mod); |
|
ACCUM_TIME(Tint,RTint) |
|
} |
|
print(""); |
|
T0 = time(); |
|
IntQ = nd_gr(IntQ,V,Mod,Ord); |
|
ACCUM_TIME(Tint,RTint) |
|
T = reverse(T); RL = append(RL,[T]); |
} |
} |
print(""); |
|
IntQ = nd_gr(IntQ,V,Mod,Ord); |
|
T = reverse(T); RL = append(RL,[T]); |
|
} |
} |
QL = append(QL,[IntQ]); |
QL = append(QL,[IntQ]); |
ACCUM_TIME(Tint,RTint) |
|
if ( gen_gb_comp(IntQ,G,Mod) ) break; |
if ( gen_gb_comp(IntQ,G,Mod) ) break; |
First = 0; |
|
} |
} |
T0 = time(); |
T0 = time(); |
if ( Iso != 3 && !Ass ) |
if ( Iso != 3 && !Ass ) |
Line 326 ACCUM_TIME(Text,RText) |
|
Line 394 ACCUM_TIME(Text,RText) |
|
T1 = time(); |
T1 = time(); |
Tall = T1[0]-T00[0]+T1[1]-T00[1]; RTall += T1[3]-T00[3]; |
Tall = T1[0]-T00[0]+T1[1]-T00[1]; RTall += T1[3]-T00[3]; |
Tass = Tall-Text; RTass = RTall-RText; |
Tass = Tall-Text; RTass = RTall-RText; |
print(["total",Tall,"ass",Tass,"pd",Tpd,"iso",Tiso,"int",Tint,"ext",Text]); |
print(["total",Tall,"ass",Tass,"pd",Tpd,"(fpd)",Tfpd,"iso",Tiso,"int",Tint,"ext",Text]); |
print(["elapsed",RTall,"ass",RTass,"pd",RTpd,"iso",RTiso,"int",RTint,"ext",RText]); |
print(["elapsed",RTall,"ass",RTass,"pd",RTpd,"(fpd)",RTfpd,"iso",RTiso,"int",RTint,"ext",RText]); |
} |
} |
return RL; |
return RL; |
} |
} |
Line 348 def extract_comp(QL,RL,V,Rad) { |
|
Line 416 def extract_comp(QL,RL,V,Rad) { |
|
Task = cons(T,Task); |
Task = cons(T,Task); |
} |
} |
} |
} |
|
Task = reverse(Task); |
print("comps:",2); print(length(Task),2); print(""); |
print("comps:",2); print(length(Task),2); print(""); |
R = para_exec(Para,Task); |
R = para_exec(Para,Task); |
S = vector(L); |
S = vector(L); |
Line 411 def colon_prime_dec(G,IntQ,V) { |
|
Line 480 def colon_prime_dec(G,IntQ,V) { |
|
print("->",2); print(length(M),2); |
print("->",2); print(length(M),2); |
R = pd_simp_comp(R,V|mod=Mod); |
R = pd_simp_comp(R,V|mod=Mod); |
print("->",2); print(length(R)); |
print("->",2); print(length(R)); |
|
#if 1 |
for ( Pt = [], T = R; T != []; T = cdr(T) ) { |
for ( Pt = [], T = R; T != []; T = cdr(T) ) { |
Pi = prime_dec(car(T),V|indep=1,lexdec=Lexdec,mod=Mod); |
Pi = prime_dec(car(T),V|indep=1,lexdec=Lexdec,mod=Mod); |
Pt = append(Pt,Pi); |
Pt = append(Pt,Pi); |
} |
} |
|
#else |
|
J = ideal_list_intersection(R,V,0|mod=Mod); |
|
Pt = prime_dec(J,V|indep=1,lexdec=Lexdec,mod=Mod); |
|
#endif |
} |
} |
|
#if 1 |
Pt = pd_simp_comp(Pt,V|first=1,mod=Mod); |
Pt = pd_simp_comp(Pt,V|first=1,mod=Mod); |
|
#endif |
return Pt; |
return Pt; |
} |
} |
|
|
Line 436 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 455 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 541 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 636 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 679 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 699 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 790 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 848 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 868 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 967 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 985 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 1034 def locsat(G,V,L,S,Mod,IsGB,Iso,Q) |
|
Line 1112 def locsat(G,V,L,S,Mod,IsGB,Iso,Q) |
|
if ( Iso==1 ) { |
if ( Iso==1 ) { |
QI = sat(G,S,V|isgb=IsGB,mod=Mod); |
QI = sat(G,S,V|isgb=IsGB,mod=Mod); |
GI = elim_gb(QI,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
GI = elim_gb(QI,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
GI = nd_gr(contraction(GI,V0|mod=Mod),V,Mod,0); |
GI = nd_gr(contraction(GI,V0|mod=Mod,allv=V),V,Mod,0); |
} else if ( Iso==0 ) { |
} else if ( Iso==0 ) { |
HI = elim_gb(G,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
HI = elim_gb(G,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
GI = nd_gr(contraction(HI,V0|mod=Mod),V,Mod,0); |
GI = nd_gr(contraction(HI,V0|mod=Mod,allv=V),V,Mod,0); |
GI = sat(GI,S,V|isgb=IsGB,mod=Mod); |
GI = sat(GI,S,V|isgb=IsGB,mod=Mod); |
} else if ( Iso==2 ) { |
} else if ( Iso==2 ) { |
HI = elim_gb(G,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
HI = elim_gb(G,V0,PV,Mod,[[0,length(V0)],[0,length(PV)]]); |
Line 1048 def locsat(G,V,L,S,Mod,IsGB,Iso,Q) |
|
Line 1126 def locsat(G,V,L,S,Mod,IsGB,Iso,Q) |
|
GI = nd_gr_trace(append(HI,[TV*S-1]),cons(TV,V0), |
GI = nd_gr_trace(append(HI,[TV*S-1]),cons(TV,V0), |
1,1,[[0,1],[0,length(V0)]]|gbblock=[[0,length(HI)]]); |
1,1,[[0,1],[0,length(V0)]]|gbblock=[[0,length(HI)]]); |
GI = elimination(GI,V); |
GI = elimination(GI,V); |
GI = nd_gr(contraction(GI,V0|mod=Mod),V,Mod,0); |
GI = nd_gr(contraction(GI,V0|mod=Mod,allv=V),V,Mod,0); |
} else if ( Iso==3 ) { |
} else if ( Iso==3 ) { |
GI = sat(G,S,V|isgb=IsGB,mod=Mod); |
GI = sat(G,S,V|isgb=IsGB,mod=Mod); |
} |
} |
Line 1078 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 1110 def prime_dec(B,V) |
|
Line 1188 def prime_dec(B,V) |
|
G = ideal_list_intersection(PD,V,0|mod=Mod); |
G = ideal_list_intersection(PD,V,0|mod=Mod); |
PD = pd_remove_redundant_comp(G,PD,V,0|mod=Mod); |
PD = pd_remove_redundant_comp(G,PD,V,0|mod=Mod); |
} |
} |
R = []; |
R = []; RL = []; |
for ( T = PD; T != []; T = cdr(T) ) |
for ( T = PD; T != []; T = cdr(T) ) { |
R = append(prime_dec_main(car(T),V|indep=Indep,mod=Mod),R); |
PDT = prime_dec_main(car(T),V|indep=Indep,mod=Mod); |
if ( Indep ) { |
R = append(R,PDT[0]); |
G = ideal_list_intersection(map(first,R),V,0|mod=Mod); |
GT = nd_gr(PDT[1],V,Mod,0); |
if ( LexDec ) R = pd_simp_comp(R,V|first=1,mod=Mod); |
RL = append(RL,[GT]); |
} else { |
|
G = ideal_list_intersection(R,V,0|mod=Mod); |
|
if ( LexDec ) R = pd_simp_comp(R,V|mod=Mod); |
|
} |
} |
return Rad ? [R,G] : R; |
if ( LexDec ) R = pd_simp_comp(R,V|first=Indep,mod=Mod); |
|
if ( Rad ) { |
|
G = ideal_list_intersection(RL,V,0|mod=Mod); |
|
return [R,G]; |
|
} else return R; |
} |
} |
|
|
def prime_dec2(B,V) |
def prime_dec2(B,V) |
Line 1152 def prime_dec2(B,V) |
|
Line 1231 def prime_dec2(B,V) |
|
return Rad ? [R,G] : R; |
return Rad ? [R,G] : R; |
} |
} |
|
|
|
/* returns [PD,rad(I)] */ |
|
|
def prime_dec_main(B,V) |
def prime_dec_main(B,V) |
{ |
{ |
|
Tpint = RTpint = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Indep=getopt(indep)) == -1 ) Indep = 0; |
if ( type(Indep=getopt(indep)) == -1 ) Indep = 0; |
G = fast_gb(B,V,Mod,0); |
G = fast_gb(B,V,Mod,0); |
Line 1163 def prime_dec_main(B,V) |
|
Line 1245 def prime_dec_main(B,V) |
|
for ( Ind = [], I = length(G)-1; I >= 0; I-- ) Ind = cons(I,Ind); |
for ( Ind = [], I = length(G)-1; I >= 0; I-- ) Ind = cons(I,Ind); |
if ( Mod ) DG = map(dp_mod,DG,Mod,[]); |
if ( Mod ) DG = map(dp_mod,DG,Mod,[]); |
while ( 1 ) { |
while ( 1 ) { |
|
print([length(PD)],2); |
/* rad(G) subset IntP */ |
/* rad(G) subset IntP */ |
/* check if IntP subset rad(G) */ |
/* check if IntP subset rad(G) */ |
/* print([length(PD),length(IntP)],2); */ |
/* print([length(PD),length(IntP)],2); */ |
for ( T = IntP; T != []; T = cdr(T) ) |
for ( T = IntP; T != []; T = cdr(T) ) |
if ( (G0 = radical_membership(car(T),G,V|mod=Mod,isgb=1,dg=[DG,Ind],sat=1)) ) { |
if ( (G0 = radical_membership_sat(car(T),G,V|mod=Mod,isgb=1,dg=[DG,Ind])) ) { |
F = car(T); |
F = car(T); |
break; |
break; |
} |
} |
if ( T == [] ) return PD; |
if ( T == [] ) { |
|
print(["pint",Tpint,"rpint",RTpint]); |
|
return [PD,IntP]; |
|
} |
PD0 = zprimecomp(G0,V,Indep|mod=Mod); |
PD0 = zprimecomp(G0,V,Indep|mod=Mod); |
Int = ideal_list_intersection(Indep?map(first,PD0):PD0,V,0|mod=Mod); |
Int = ideal_list_intersection(Indep?map(first,PD0):PD0,V,0|mod=Mod); |
PD = append(PD,PD0); |
PD = append(PD,PD0); |
#if 0 |
#if 1 |
|
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); |
|
DC = qsort(DC,noro_pd.comp_tord); IntP = map(dp_dtop,DC,V); |
|
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)]]); |
#endif |
#endif |
} |
} |
} |
} |
|
|
|
localf callsat,callzcomp; |
|
|
|
def callsat(F,G,V,Mod,DG) |
|
{ |
|
return radical_membership(F,G,V|mod=Mod,isgb=1,dg=DG,sat=1); |
|
} |
|
|
|
def callzcomp(F,V,Indep,Mod) |
|
{ |
|
PD0 = zprimecomp(F,V,Indep|mod=Mod); |
|
Int = ideal_list_intersection(Indep?map(first,PD0):PD0,V,0|mod=Mod); |
|
return [PD0,Int]; |
|
} |
|
|
def prime_dec_main2(B,V) |
def prime_dec_main2(B,V) |
{ |
{ |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
Line 1196 def prime_dec_main2(B,V) |
|
Line 1300 def prime_dec_main2(B,V) |
|
DG = ltov(map(dp_ptod,G,V)); |
DG = ltov(map(dp_ptod,G,V)); |
for ( Ind = [], I = length(G)-1; I >= 0; I-- ) Ind = cons(I,Ind); |
for ( Ind = [], I = length(G)-1; I >= 0; I-- ) Ind = cons(I,Ind); |
if ( Mod ) DG = map(dp_mod,DG,Mod,[]); |
if ( Mod ) DG = map(dp_mod,DG,Mod,[]); |
while ( 1 ) { |
if ( NPara ) |
/* rad(G) subset IntP */ |
while ( 1 ) { |
/* check if IntP subset rad(G) */ |
IntPM = mingen(IntP,V); |
/* print([length(PD),length(IntP)],2); */ |
for ( T = IntPM, CallSat = []; T != []; T = cdr(T) ) |
Sat = []; |
CallSat = cons(["noro_pd.callsat",car(T),G,V,Mod,[DG,Ind]],CallSat); |
IntPM = mingen(IntP,V); |
CallSat = reverse(CallSat); |
for ( T = IntPM; T != [] && length(Sat) < 16; T = cdr(T) ) |
/* SatL = [[..],0,[...],...] */ |
if ( G0 = radical_membership(car(T),G,V|mod=Mod,isgb=1,dg=[DG,Ind],sat=1) ) |
SatL = para_exec(Para,CallSat); |
Sat = cons(G0,Sat); |
for ( T = SatL, Sat = []; T != []; T = cdr(T) ) if ( car(T) ) Sat = cons(car(T),Sat); |
if ( Sat == [] ) return PD; |
if ( Sat == [] ) return PD; |
print(length(Sat),2); print("->",2); |
print(length(Sat),2); print("->",2); |
Sat = remove_identical_comp(Sat|mod=Mod); |
Sat = remove_identical_comp(Sat|mod=Mod); |
print(length(Sat)); |
print(length(Sat)); |
for ( T = Sat; T != []; T = cdr(T) ) { |
for ( T = Sat, CallComp = []; T != []; T = cdr(T) ) |
PD0 = zprimecomp(car(T),V,Indep|mod=Mod); |
CallComp = cons(["noro_pd.callzcomp",car(T),V,Indep,Mod],CallComp); |
Int = ideal_list_intersection(Indep?map(first,PD0):PD0,V,0|mod=Mod); |
CallComp = reverse(CallComp); |
PD = append(PD,PD0); |
/* PDL = [[PD0,Int],...] */ |
|
PDL = para_exec(Para,CallComp); |
|
for ( T = PDL; T != []; T = cdr(T) ) PD = append(PD,car(T)[0]); |
|
Int = ideal_list_intersection(map(second,PDL),V,0|mod=Mod); |
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)]]); |
} |
} |
} |
else |
|
while ( 1 ) { |
|
/* rad(G) subset IntP */ |
|
/* check if IntP subset rad(G) */ |
|
/* print([length(PD),length(IntP)],2); */ |
|
Sat = []; |
|
IntPM = mingen(IntP,V); |
|
for ( T = IntPM; T != [] && length(Sat) < 16; T = cdr(T) ) |
|
if ( G0 = radical_membership(car(T),G,V|mod=Mod,isgb=1,dg=[DG,Ind],sat=1) ) |
|
Sat = cons(G0,Sat); |
|
if ( Sat == [] ) return PD; |
|
print(length(Sat),2); print("->",2); |
|
Sat = remove_identical_comp(Sat|mod=Mod); |
|
print(length(Sat)); |
|
for ( T = Sat; T != []; T = cdr(T) ) { |
|
PD0 = zprimecomp(car(T),V,Indep|mod=Mod); PD = append(PD,PD0); |
|
Int = ideal_list_intersection(Indep?map(first,PD0):PD0,V,0|mod=Mod); |
|
IntP = ideal_intersection(IntP,Int,V,0|mod=Mod,gbblock=[[0,length(IntP)]]); |
|
} |
|
} |
} |
} |
|
|
/* pre-decomposition */ |
/* pre-decomposition */ |
Line 1561 def elim_gb(G,V,PV,Mod,Ord) |
|
Line 1687 def elim_gb(G,V,PV,Mod,Ord) |
|
G = competitive_exec(EProcs,Arg0,Arg1); |
G = competitive_exec(EProcs,Arg0,Arg1); |
} else if ( GBRat ) { |
} else if ( GBRat ) { |
G1 = nd_gr(G,append(V,PV),0,O1); |
G1 = nd_gr(G,append(V,PV),0,O1); |
G1 = nd_gr_postproc(G1,V,0,Ord,0); |
if ( GBRat == 1 ) |
|
G1 = nd_gr_postproc(G1,V,0,Ord,0|nora=1); |
return G1; |
return G1; |
} else |
} else |
#if 1 |
#if 1 |
Line 1674 def gen_minipoly(G,V,PV,Ord,VI,Mod) |
|
Line 1801 def gen_minipoly(G,V,PV,Ord,VI,Mod) |
|
G = elimination(G,cdr(V1)); |
G = elimination(G,cdr(V1)); |
} |
} |
} |
} |
#elif 0 |
#elif 1 |
if ( Mod ) { |
if ( Mod ) { |
V1 = append(W,PV1); |
V1 = append(W,PV1); |
G = nd_gr(G,V1,Mod,[[0,length(W)],[0,length(PV1)]]); |
G = nd_gr(G,V1,Mod,[[0,length(W)],[0,length(PV1)]]); |
Line 1776 def maxindep2(B,V,O) |
|
Line 1903 def maxindep2(B,V,O) |
|
/* ideal operations */ |
/* ideal operations */ |
def contraction(G,V) |
def contraction(G,V) |
{ |
{ |
|
if ( type(AllV=getopt(allv)) == -1 ) AllV = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
|
|
if ( RepColon ) return contraction_m(G,V|allv=AllV,mod=Mod); |
|
|
C = []; |
C = []; |
for ( T = G; T != []; T = cdr(T) ) { |
for ( T = G; T != []; T = cdr(T) ) { |
C1 = dp_hc(dp_ptod(car(T),V)); |
C1 = dp_hc(dp_ptod(car(T),V)); |
Line 1786 def contraction(G,V) |
|
Line 1917 def contraction(G,V) |
|
} |
} |
W = vars(G); |
W = vars(G); |
PV = setminus(W,V); |
PV = setminus(W,V); |
W = append(V,PV); |
if ( AllV ) W = AllV; |
|
else W = append(V,PV); |
NV = ttttt; |
NV = ttttt; |
for ( T = C, S = 1; T != []; T = cdr(T) ) |
if ( SuccSat ) { |
S *= car(T); |
W1 = cons(NV,W); |
G = saturation([G,NV],S,W|mod=Mod); |
O1 = [[0,1],[0,length(W)]]; |
|
Block = []; |
|
for ( T = C; T != []; T = cdr(T) ) { |
|
G1 = nd_gr(append(G,[NV*car(T)-1]),W1,Mod,O1|gbblock=Block); |
|
G = elimination(G1,W); |
|
Block = [[0,length(G)]]; |
|
} |
|
} else { |
|
for ( T = C, S = 1; T != []; T = cdr(T) ) |
|
S *= car(T); |
|
G = saturation([G,NV],S,W|mod=Mod); |
|
} |
return G; |
return G; |
} |
} |
|
|
|
def contraction_m(G,V) |
|
{ |
|
if ( type(AllV=getopt(allv)) == -1 ) AllV = 0; |
|
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
C = []; |
|
for ( T = G; T != []; T = cdr(T) ) { |
|
C1 = dp_hc(dp_ptod(car(T),V)); |
|
S = gen_fctr(C1,Mod); |
|
for ( S = cdr(S); S != []; S = cdr(S) ) |
|
if ( !member(S[0][0],C) ) C = cons(S[0][0],C); |
|
} |
|
W = vars(G); |
|
PV = setminus(W,V); |
|
if ( AllV ) W = AllV; |
|
else W = append(V,PV); |
|
H = H0 = G; |
|
while ( 1 ) { |
|
for ( T = C; T != []; T = cdr(T) ) |
|
H = map(sdiv,ideal_intersection_m([car(T)],H,W,0),car(T)); |
|
H = nd_gr(H,W,0,0); |
|
if ( gb_comp(H0,H) ) break; |
|
else H0 = H; |
|
} |
|
return H; |
|
} |
|
|
def ideal_list_intersection(L,V,Ord) |
def ideal_list_intersection(L,V,Ord) |
{ |
{ |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(IsGB=getopt(isgb)) == -1 ) IsGB = 0; |
if ( type(IsGB=getopt(isgb)) == -1 ) IsGB = 0; |
if ( type(Para=getopt(para)) == -1 || type(Para) != 4 ) Para = []; |
|
N = length(L); |
N = length(L); |
if ( N == 0 ) return [1]; |
if ( N == 0 ) return [1]; |
if ( N == 1 ) |
if ( N == 1 ) |
return IsGB ? L[0] : fast_gb(L[0],V,Mod,Ord); |
return IsGB ? L[0] : fast_gb(L[0],V,Mod,Ord); |
if ( N > 2 && (Len = length(Para)) >= 2 ) { |
else { |
Div = N >= 2*Len ? Len : 2; |
|
QR = iqr(N,Div); Q = QR[0]; R = QR[1]; |
|
T = []; K = 0; |
|
for ( I = 0; I < Div; I++ ) { |
|
LenI = I<R? Q+1 : Q; |
|
if ( LenI ) { |
|
for ( LI = [], J = 0; J < LenI; J++ ) LI = cons(L[K++],LI); |
|
TI = ["noro_pd.call_ideal_list_intersection",LI,V,Mod,Ord,IsGB]; |
|
T = cons(TI,T); |
|
} |
|
} |
|
Tint = para_exec(Para,T); |
|
return ideal_list_intersection(Tint,V,Ord|mod=Mod,para=Para,isgb=IsGB); |
|
} else { |
|
for ( I = 0, T = [1]; I < N; I++ ) |
for ( I = 0, T = [1]; I < N; I++ ) |
T = ideal_intersection_m(T,L[I],V,Ord|mod=Mod); |
T = ideal_intersection_m(T,L[I],V,Ord|mod=Mod); |
T = nd_gr(T,V,Mod,Ord); |
T = nd_gr(T,V,Mod,Ord); |
Line 1927 def radical_membership(F,G,V) { |
|
Line 2081 def radical_membership(F,G,V) { |
|
} else return [T,NV]; |
} else return [T,NV]; |
} |
} |
|
|
|
def radical_membership_sat(F,G,V) { |
|
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
if ( type(IsGB=getopt(isgb)) == -1 ) IsGB = 0; |
|
if ( type(L=getopt(dg)) == -1 ) L = 0; |
|
dp_ord(0); |
|
if ( L ) { DG = L[0]; Ind = L[1]; } |
|
else { |
|
DG = ltov(map(dp_ptod,G,V)); |
|
if ( Mod ) DG = map(dp_mod,DG,Mod,[]); |
|
for ( Ind = [], I = length(G)-1; I >= 0; I-- ) Ind = cons(I,Ind); |
|
} |
|
DF = dp_ptod(F,V); DFI = dp_ptod(1,V); |
|
if ( Mod ) { |
|
DF = dp_mod(DF,Mod,[]); DFI = dp_mod(DFI,Mod,[]); |
|
setmod(Mod); |
|
} |
|
for ( I = 0; I < 3; I++ ) { |
|
DFI = Mod?dp_nf_mod(Ind,DF*DFI,DG,0,Mod):dp_nf(Ind,DF*DFI,DG,0); |
|
if ( !DFI ) return 0; |
|
} |
|
NV = ttttt; |
|
if ( IsGB ) |
|
T = nd_gr(append(G,[NV*F-1]),cons(NV,V),Mod,[[0,1],[0,length(V)]] |
|
|gbblock=[[0,length(G)]]); |
|
else |
|
T = nd_gr(append(G,[NV*F-1]),cons(NV,V),Mod,[[0,1],[0,length(V)]]); |
|
if ( type(car(T)) == 1 ) return 0; |
|
G0 = elimination(T,V); |
|
return G0; |
|
} |
|
|
def modular_radical_membership(F,G,V) { |
def modular_radical_membership(F,G,V) { |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( Mod ) |
if ( Mod ) |
Line 1981 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 2049 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 2086 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 2123 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 2654 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 2715 def call_func(Arg) |
|
Line 2921 def call_func(Arg) |
|
return call(strtov(F),cdr(Arg)); |
return call(strtov(F),cdr(Arg)); |
} |
} |
|
|
|
def call_func_serial(Arg,Serial) |
|
{ |
|
F = car(Arg); |
|
return [call(strtov(F),cdr(Arg)),Serial]; |
|
} |
|
|
def competitive_exec(P,Arg0,Arg1) |
def competitive_exec(P,Arg0,Arg1) |
{ |
{ |
P0 = P[0]; P1 = P[1]; |
P0 = P[0]; P1 = P[1]; |
Line 2745 def para_exec(Proc,Task) { |
|
Line 2957 def para_exec(Proc,Task) { |
|
Free = Proc; |
Free = Proc; |
N = length(Task); |
N = length(Task); |
R = []; |
R = []; |
|
print([N],2); print("->",2); |
|
Serial = 0; |
while ( N ) { |
while ( N ) { |
while ( Task != [] && Free != [] ) { |
while ( Task != [] && Free != [] ) { |
T = car(Task); Task = cdr(Task); |
T = car(Task); Task = cdr(Task); |
ox_cmo_rpc(car(Free),"noro_pd.call_func",T); |
ox_rpc(car(Free),"noro_pd.call_func_serial",T,Serial++); |
ox_push_cmd(car(Free),258); Free = cdr(Free); |
ox_push_cmd(car(Free),258); Free = cdr(Free); |
} |
} |
Finish0 = Finish = ox_select(Proc); |
Finish0 = Finish = ox_select(Proc); |
Line 2758 def para_exec(Proc,Task) { |
|
Line 2972 def para_exec(Proc,Task) { |
|
R = cons(L,R); |
R = cons(L,R); |
N--; |
N--; |
} |
} |
|
print([N],2); |
Free = append(Free,Finish0); |
Free = append(Free,Finish0); |
} |
} |
print(""); |
print(""); |
return reverse(R); |
R = qsort(R,noro_pd.comp_by_second); |
|
R = map(first,R); |
|
return R; |
} |
} |
|
|
def redbase(B,V,Mod,Ord) |
def redbase(B,V,Mod,Ord) |
Line 2778 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); |
} |
} |
|
|