version 1.1, 2010/05/09 13:40:23 |
version 1.5, 2010/05/21 00:29:46 |
Line 9 localf sy_dec, pseudo_dec, iso_comp, prima_dec$ |
|
Line 9 localf sy_dec, pseudo_dec, iso_comp, prima_dec$ |
|
localf prime_dec, prime_dec_main, lex_predec1, zprimedec, zprimadec$ |
localf prime_dec, prime_dec_main, lex_predec1, zprimedec, zprimadec$ |
localf complete_qdecomp, partial_qdecomp, partial_qdecomp0, complete_decomp$ |
localf complete_qdecomp, partial_qdecomp, partial_qdecomp0, complete_decomp$ |
localf partial_decomp, partial_decomp0, zprimacomp, zprimecomp$ |
localf partial_decomp, partial_decomp0, zprimacomp, zprimecomp$ |
localf fast_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, contraction, ideal_list_intersection, ideal_intersection$ |
localf maxindep, contraction, ideal_list_intersection, ideal_intersection$ |
localf radical_membership, quick_radical_membership, modular_radical_membership$ |
localf radical_membership, quick_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$ |
localf sat, satind, sat_ind, colon$ |
localf ideal_colon, ideal_inclusion, qd_simp_comp, qd_remove_redundant_comp$ |
localf ideal_colon, ideal_sat, ideal_inclusion, qd_simp_comp, qd_remove_redundant_comp$ |
localf remove_redundant_comp, remove_redundant_comp_first, ppart, sq$ |
localf remove_redundant_comp, remove_redundant_comp_first, ppart, sq$ |
localf lcfactor, compute_deg0, compute_deg, member$ |
localf lcfactor, compute_deg0, compute_deg, member$ |
localf elimination, setintersection, setminus, sep_list$ |
localf elimination, setintersection, setminus, sep_list$ |
|
|
def gbcheck(A) |
def gbcheck(A) |
{ |
{ |
if ( A ) GBCheck = 1; |
if ( A ) GBCheck = 1; |
else GBcheck = -1; |
else GBCheck = -1; |
} |
} |
|
|
def f4(A) |
def f4(A) |
|
|
T0 = time(); |
T0 = time(); |
C = ideal_colon(Gt,IntQt,V); |
C = ideal_colon(Gt,IntQt,V); |
T1 = time(); Tcolon += T1[0]-T0[0]+T1[1]-T0[1]; Rcolon += T1[3]-T0[3]; |
T1 = time(); Tcolon += T1[0]-T0[0]+T1[1]-T0[1]; Rcolon += T1[3]-T0[3]; |
|
T0 = time(); |
if ( SepIdeal == 0 ) |
if ( SepIdeal == 0 ) |
Ok = find_separating_ideal0(C,Gt,IntQt,IntPt,V,Ord); |
Ok = find_separating_ideal0(C,Gt,IntQt,IntPt,V,Ord); |
else if ( SepIdeal == 1 ) |
else if ( SepIdeal == 1 ) |
|
|
else if ( SepIdeal == 2 ) |
else if ( SepIdeal == 2 ) |
Ok = find_separating_ideal2(C,Gt,IntQt,IntPt,V,Ord); |
Ok = find_separating_ideal2(C,Gt,IntQt,IntPt,V,Ord); |
G1 = append(Ok,Gt); |
G1 = append(Ok,Gt); |
T0 = time(); |
|
Gt = fast_gb(G1,V,0,Ord); |
Gt = fast_gb(G1,V,0,Ord); |
T1 = time(); Tsep += T1[0]-T0[0]+T1[1]-T0[1]; Rsep += T1[3]-T0[3]; |
T1 = time(); Tsep += T1[0]-T0[0]+T1[1]-T0[1]; Rsep += T1[3]-T0[3]; |
} |
} |
Line 233 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
Line 233 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
/* check whether (Q cap (G+S)) = G */ |
/* check whether (Q cap (G+S)) = G */ |
if ( gb_comp(Int,G) ) return reverse(S); |
if ( gb_comp(Int,G) ) return reverse(S); |
|
|
|
/* or qsort(C,comp_tdeg) */ |
C = qsort(S,comp_tdeg); |
C = qsort(S,comp_tdeg); |
|
|
|
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))), |
|
TV,Ord1|gbblock=[[0,length(G)]]); |
for ( T = C, S = []; T != []; T = cdr(T) ) { |
for ( T = C, S = []; T != []; T = cdr(T) ) { |
if ( !nd_nf(car(T),Rad,V,Ord,0) ) continue; |
if ( !nd_nf(car(T),Rad,V,Ord,0) ) continue; |
Ui = U = car(T); |
Ui = U = car(T); |
Line 244 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
Line 249 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
else |
else |
Ui = nd_nf(Ui*U,G,V,Ord,0); |
Ui = nd_nf(Ui*U,G,V,Ord,0); |
} |
} |
if ( length(S) ) { |
Int1 = incremental_gb(append(Int0,[Tmp*Ui]),TV,Ord1 |
G1 = append(cons(Ui,S),G); |
|gbblock=[[0,length(Int0)]]); |
Int = ideal_intersection(G1,Q,V,Ord); |
Int = elimination(Int1,V); |
if ( !gb_comp(Int,G) ) |
if ( !gb_comp(Int,G) ) |
break; |
break; |
|
else { |
|
Int0 = Int1; |
|
S = cons(Ui,S); |
} |
} |
S = cons(Ui,S); |
|
} |
} |
return reverse(S); |
return reverse(S); |
} |
} |
Line 265 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
Line 272 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
/* check whether (Q cap (G+S)) = G */ |
/* check whether (Q cap (G+S)) = G */ |
if ( gb_comp(Int,G) ) return reverse(S); |
if ( gb_comp(Int,G) ) return reverse(S); |
|
|
|
/* or qsort(S,comp_tdeg) */ |
C = qsort(C,comp_tdeg); |
C = qsort(C,comp_tdeg); |
|
Dp = dp_gr_print(); dp_gr_print(0); |
for ( T = C, S = []; T != []; T = cdr(T) ) { |
for ( T = C, S = []; T != []; T = cdr(T) ) { |
|
print(length(T)); |
if ( !nd_nf(car(T),Rad,V,Ord,0) ) continue; |
if ( !nd_nf(car(T),Rad,V,Ord,0) ) continue; |
Ui = U = car(T); |
Ui = U = car(T); |
for ( I = 1; ; I++ ) { |
for ( I = 1; ; I++ ) { |
Line 278 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
Line 288 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
} |
} |
S = cons(Ui,S); |
S = cons(Ui,S); |
} |
} |
S = reverse(S); |
S = qsort(S,comp_tdeg); |
|
/* S = reverse(S); */ |
Len = length(S); |
Len = length(S); |
Ok = [S[0]]; |
|
|
Tmp = ttttt; TV = cons(Tmp,V); Ord1 = [[0,1],[Ord,length(V)]]; |
if ( Len > 1 ) { |
if ( Len > 1 ) { |
K = 2; |
Prev = 1; |
while ( 1 ) { |
Cur = 2; |
for ( St = [], I = 0; I < K; I++ ) St = cons(S[I],St); |
G1 = append(G,[S[0]]); |
G1 = append(St,G); |
Int0 = incremental_gb(append(vtol(ltov(G1)*Tmp),vtol(ltov(Q)*(1-Tmp))), |
Int = ideal_intersection(G1,Q,V,Ord); |
TV,Ord1|gbblock=[[0,length(G)]]); |
if ( !gb_comp(Int,G) ) break; |
while ( Prev < Cur ) { |
Ok = St; |
for ( St = [], I = Prev; I < Cur; I++ ) St = cons(Tmp*S[I],St); |
if ( K == Len ) break; |
Int1 = incremental_gb(append(Int0,St),TV,Ord1 |
else { |
|gbblock=[[0,length(Int0)]]); |
K = 2*K; |
Int = elimination(Int1,V); |
if ( K > Len ) K = Len; |
if ( gb_comp(Int,G) ) { |
|
print(Cur); |
|
Prev = Cur; |
|
Cur = Cur+idiv(Len-Cur+1,2); |
|
Int0 = Int1; |
|
} else { |
|
Cur = Prev + idiv(Cur-Prev,2); |
} |
} |
} |
} |
} |
for ( St = [], I = 0; I < Prev; I++ ) St = cons(S[I],St); |
|
Ok = reverse(St); |
|
} else |
|
Ok = [S[0]]; |
|
print([length(S),length(Ok)]); |
|
dp_gr_print(Dp); |
return Ok; |
return Ok; |
} |
} |
|
|
Line 382 def iso_comp(G,L,V,Ord) |
|
Line 405 def iso_comp(G,L,V,Ord) |
|
Ind = vector(N); |
Ind = vector(N); |
Q = vector(N); |
Q = vector(N); |
L0 = map(first_element,L); |
L0 = map(first_element,L); |
|
G = nd_gr(G,V,0,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); |
PI = ideal_list_intersection(LI,V,Ord); |
Line 389 def iso_comp(G,L,V,Ord) |
|
Line 413 def iso_comp(G,L,V,Ord) |
|
if ( p_nf(car(T),L0[I],V,Ord) ) break; |
if ( p_nf(car(T),L0[I],V,Ord) ) break; |
if ( T == [] ) error("separator : cannot happen"); |
if ( T == [] ) error("separator : cannot happen"); |
S[I] = car(T); |
S[I] = car(T); |
QI = sat(G,S[I],V); |
QI = sat(G,S[I],V|isgb=1); |
PV = L[I][1]; |
PV = L[I][1]; |
V0 = setminus(V,PV); |
V0 = setminus(V,PV); |
GI = elim_gb(QI,V0,PV,0,[[0,length(V0)],[0,length(PV)]]); |
GI = elim_gb(QI,V0,PV,0,[[0,length(V0)],[0,length(PV)]]); |
Line 448 def prime_dec(B,V) |
|
Line 472 def prime_dec(B,V) |
|
R = append(prime_dec_main(car(T),V|indep=Indep),R); |
R = append(prime_dec_main(car(T),V|indep=Indep),R); |
if ( Indep ) { |
if ( Indep ) { |
G = ideal_list_intersection(map(first_element,R),V,0); |
G = ideal_list_intersection(map(first_element,R),V,0); |
R = remove_redundant_comp_first(G,R,V,0); |
if ( !NoLexDec ) R = remove_redundant_comp_first(G,R,V,0); |
} else { |
} else { |
G = ideal_list_intersection(R,V,0); |
G = ideal_list_intersection(R,V,0); |
R = remove_redundant_comp(G,[],R,V,0); |
if ( !NoLexDec ) R = remove_redundant_comp(G,[],R,V,0); |
} |
} |
return R; |
return R; |
} |
} |
Line 781 def fast_gb(B,V,Mod,Ord) |
|
Line 805 def fast_gb(B,V,Mod,Ord) |
|
return G; |
return G; |
} |
} |
|
|
|
def incremental_gb(A,V,Ord) |
|
{ |
|
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
|
if ( type(Block=getopt(gbblock)) == -1 ) Block = 0; |
|
if ( Mod ) |
|
G = nd_gr(A,V,Mod,Ord); |
|
else if ( Procs ) { |
|
Arg0 = ["nd_gr",A,V,0,Ord]; |
|
Arg1 = ["nd_gr_trace",A,V,1,GBCheck,Ord]; |
|
G = competitive_exec(Procs,Arg0,Arg1); |
|
} else if ( Block ) |
|
G = nd_gr(A,V,0,Ord|gbblock=Block); |
|
else |
|
G = nd_gr(A,V,0,Ord); |
|
return G; |
|
} |
|
|
def elim_gb(G,V,PV,Mod,Ord) |
def elim_gb(G,V,PV,Mod,Ord) |
{ |
{ |
Line 1116 def saturation(GNV,F,V) |
|
Line 1156 def saturation(GNV,F,V) |
|
|
|
def sat(G,F,V) |
def sat(G,F,V) |
{ |
{ |
|
if ( type(IsGB=getopt(isgb)) == -1 ) IsGB = 0; |
NV = ttttt; |
NV = ttttt; |
if ( Procs ) { |
if ( Procs ) { |
Arg0 = ["nd_gr_trace", |
Arg0 = ["nd_gr_trace", |
|
|
Arg1 = ["nd_gr_trace", |
Arg1 = ["nd_gr_trace", |
cons(NV*F-1,G),cons(NV,V),1,GBCheck,[[0,1],[0,length(V)]]]; |
cons(NV*F-1,G),cons(NV,V),1,GBCheck,[[0,1],[0,length(V)]]]; |
G1 = competitive_exec(Procs,Arg0,Arg1); |
G1 = competitive_exec(Procs,Arg0,Arg1); |
} else |
} else { |
G1 = nd_gr_trace(cons(NV*F-1,G),cons(NV,V),SatHomo,GBCheck,[[0,1],[0,length(V)]]); |
B1 = append(G,[NV*F-1]); |
|
V1 = cons(NV,V); |
|
Ord1 = [[0,1],[0,length(V)]]; |
|
if ( IsGB ) |
|
G1 = nd_gr_trace(B1,V1,SatHomo,GBCheck,Ord1| |
|
gbblock=[[0,length(G)]]); |
|
else |
|
G1 = nd_gr_trace(B1,V1,SatHomo,GBCheck,Ord1); |
|
} |
return elimination(G1,V); |
return elimination(G1,V); |
} |
} |
|
|
Line 1167 def sat_ind(G,F,V) |
|
Line 1216 def sat_ind(G,F,V) |
|
|
|
def colon(G,F,V) |
def colon(G,F,V) |
{ |
{ |
|
if ( type(IsGB=getopt(isgb)) == -1 ) IsGB = 0; |
F = p_nf(F,G,V,0); |
F = p_nf(F,G,V,0); |
if ( !F ) return [1]; |
if ( !F ) return [1]; |
NV = ttttt; |
if ( IsGB ) |
V1 = cons(NV,V); |
T = ideal_intersection(G,[F],V,0|gbblock=[[0,length(G)]]); |
T = nd_gr_trace(append(vtol(NV*ltov(G)),[(1-NV)*F]),V1,1,GBCheck, |
else |
[[0,1],[0,length(V)]]|gbblock=[[0,length(G)]],nora=1); |
T = ideal_intersection(G,[F],V,0); |
T = elimination(T,V); |
|
return map(ptozp,map(sdiv,T,F)); |
return map(ptozp,map(sdiv,T,F)); |
} |
} |
|
|
def ideal_colon(G,F,V) |
def ideal_colon(G,F,V) |
{ |
{ |
G = nd_gr(G,V,0,0); |
G = nd_gr(G,V,0,0); |
L = mapat(colon,1,G,F,V); |
for ( T = F, L = []; T != []; T = cdr(T) ) |
|
L = cons(colon(G,car(T),V|isgb=1),L); |
|
L = reverse(L); |
|
return ideal_list_intersection(L,V,0); |
|
} |
|
|
|
def ideal_sat(G,F,V) |
|
{ |
|
G = nd_gr(G,V,0,0); |
|
L = mapat(sat,1,G,F,V); |
return ideal_list_intersection(L,V,0); |
return ideal_list_intersection(L,V,0); |
} |
} |
|
|