Ecco mostrato il testo dell'algoritmo deterministico. I simboli sottolineati sono dei link.

n = value read "n? "

k = value read "k? "

N = binomial (n+1,k+1)

l = toList ((0,0)..(k,n-k-1))

a = h -> (j -> x_(flatten append({j},toList l_h)))

b = i -> apply( #l,h -> (a(h))(i))

anello = apply (toList(2..S), j -> QQ [apply(j,h->t_h),flatten apply (j,i -> b(i)), apply(toList (1..N-1),i -> z_i), MonomialOrder=>Lex])

T = apply (S-1,j -> apply (j+2,i -> (flatten entries vars anello_j)_i))

V = apply(S-1,j -> apply (toList (j+2..(j+1)+(j+2)*(n-k)*(k+1)), i-> (flatten entries vars anello_j)_i))

Z = apply (S-1,j -> apply (toList (j+2+(j+2)*(n-k)*(k+1)..(j+2)+(j+2)*(n-k)*(k+1)+N-2), i -> (flatten entries vars anello_j)_i))

f = map(ZZ,QQ)

H = apply (n-1,j -> f((#V_j)/((n-k)*(k+1))))

MI = apply (n-1,i -> apply (H_i,j -> id_((anello_i)^(k+1))| transpose genericMatrix (anello_i,V_i_(j*(n-k)*(k+1)),n-k,k+1)))

par = apply (n-1,j -> apply (H_j,i -> matrix ({apply(toList(1..N-1), u -> (flatten entries exteriorPower(k+1,MI_j_i))_u)})))

le 2- secanti:


L2 = ideal flatten entries (T_0_0*par_0_0+T_0_1*par_0_1)

I2 = ideal flatten (apply (N-1,i -> (Z_0_i)-(flatten entries gens L2)_i))

S2 = selectInSubring (#T_0 + #V_0-1, gens gb I2)

#flatten entries S2

le 3- secanti:

L3 = ideal flatten entries (T_1_0*par_1_0+T_1_1*par_1_1+T_1_2*par_1_2)

I3 = ideal apply (N,i->(Z_1_i)-(flatten entries gens L3)_i)

S3 = selectInSubring (#T_1 + #V_1-1, gens gb I3)

per le {2,3,..,S}- secanti:

S = toList(2..S)

L = apply (n-1,j -> ideal flatten entries sum (S_j,i->T_j_i*par_j_i))

I = apply (n-1,j -> ideal apply(N,i->(Z_j_i)-(flatten entries gens L_j)_i))

I_0 == I2

è l'ideale per le 2- secanti

I_1 == I3

è l'ideale per le 3- secanti

time Se = apply (n-1,j -> selectInSubring (#T_j+#V_j-1,gens gb I_j))

apply(n-1,j->#flatten entries S_j)

S_0 == S2

S_1 == S3.