version 1.8, 2010/06/09 08:28:57 |
version 1.11, 2010/08/20 04:21:18 |
|
|
|
/* $OpenXM: OpenXM/src/asir-contrib/testing/noro/pd.rr,v 1.10 2010/06/19 08:32:37 noro Exp $ */ |
import("gr")$ |
import("gr")$ |
module noro_pd$ |
module noro_pd$ |
|
|
static GBCheck,F4,Procs,SatHomo$ |
static GBCheck,F4,Procs,SatHomo$ |
|
|
localf init_procs, kill_procs, syca_dec, syc_dec, find_separating_ideal0$ |
localf init_procs, kill_procs, syca_dec, syc_dec, find_separating_ideal0$ |
|
|
Ok = find_separating_ideal1(C,G,IntQ,IntP,V,Ord|mod=Mod); |
Ok = find_separating_ideal1(C,G,IntQ,IntP,V,Ord|mod=Mod); |
else if ( SepIdeal == 2 ) |
else if ( SepIdeal == 2 ) |
Ok = find_separating_ideal2(C,G,IntQ,IntP,V,Ord|mod=Mod); |
Ok = find_separating_ideal2(C,G,IntQ,IntP,V,Ord|mod=Mod); |
else if ( SepIdeal == 3 ) |
|
Ok = find_separating_ideal2(C,G,IntQ,IntP,V,Ord|mod=Mod,complete=1); |
|
G1 = append(Ok,G); |
G1 = append(Ok,G); |
Gt1 = incremental_gb(G1,V,Ord|mod=Mod); |
Gt1 = incremental_gb(G1,V,Ord|mod=Mod); |
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]; |
|
|
Ok = find_separating_ideal1(C,Gt,IntQt,IntPt,V,Ord|mod=Mod); |
Ok = find_separating_ideal1(C,Gt,IntQt,IntPt,V,Ord|mod=Mod); |
else if ( SepIdeal == 2 ) |
else if ( SepIdeal == 2 ) |
Ok = find_separating_ideal2(C,Gt,IntQt,IntPt,V,Ord|mod=Mod); |
Ok = find_separating_ideal2(C,Gt,IntQt,IntPt,V,Ord|mod=Mod); |
else if ( SepIdeal == 3 ) |
|
Ok = find_separating_ideal2(C,Gt,IntQt,IntPt,V,Ord|mod=Mod,complete=1); |
|
G1 = append(Ok,Gt); |
G1 = append(Ok,Gt); |
Gt = incremental_gb(G1,V,Ord|mod=Mod); |
Gt = incremental_gb(G1,V,Ord|mod=Mod); |
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 315 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
Line 311 def find_separating_ideal1(C,G,Q,Rad,V,Ord) { |
|
|
|
def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Mod=getopt(mod)) == -1 ) Mod = 0; |
if ( type(Complete=getopt(complete)) == -1 ) Complete = 0; |
|
for ( T = C, S = []; T != []; T = cdr(T) ) |
for ( T = C, S = []; T != []; T = cdr(T) ) |
if ( gen_nf(car(T),Q,V,Ord,Mod) ) S = cons(car(T),S); |
if ( gen_nf(car(T),Q,V,Ord,Mod) ) S = cons(car(T),S); |
if ( S == [] ) |
if ( S == [] ) |
Line 343 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
Line 338 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
S = cons(Ui,S); |
S = cons(Ui,S); |
} |
} |
print(""); |
print(""); |
#if 1 |
|
S = qsort(S,comp_tdeg); |
S = qsort(S,comp_tdeg); |
#else |
|
S = reverse(S); |
|
#endif |
|
End = Len = length(S); |
End = Len = length(S); |
|
|
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 376 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
Line 367 def find_separating_ideal2(C,G,Q,Rad,V,Ord) { |
|
} else |
} else |
St = [S[0]]; |
St = [S[0]]; |
print(""); |
print(""); |
|
for ( I = Prev; I < Len; I++ ) { |
if ( Complete ) { |
Int1 = incremental_gb(append(Int0,[Tmp*S[I]]),TV,Ord1 |
for ( I = Prev; I < Len; I++ ) { |
|gbblock=[[0,length(Int0)]],mod=Mod); |
Int1 = incremental_gb(append(Int0,[Tmp*S[I]]),TV,Ord1 |
Int = elimination(Int1,V); |
|gbblock=[[0,length(Int0)]],mod=Mod); |
if ( gen_gb_comp(Int,G,Mod) ) { |
Int = elimination(Int1,V); |
print([I],2); |
if ( gen_gb_comp(Int,G,Mod) ) { |
St = cons(S[I],St); |
print([I],2); |
Int0 = Int1; |
St = cons(S[I],St); |
|
Int0 = Int1; |
|
} |
|
} |
} |
} |
} |
Ok = reverse(St); |
Ok = reverse(St); |
Line 452 def pseudo_dec(G,L,V,Ord) |
|
Line 440 def pseudo_dec(G,L,V,Ord) |
|
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 466 def pseudo_dec(G,L,V,Ord) |
|
Line 454 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 522 def prima_dec(B,V) |
|
Line 510 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) ) |