//---[CLO, Using ..., p. 445], Reed-Solomon [8,4,8-4+1] //--- si possono correggere 2 errori //--- c = x^7 + 2*x^5 + x^2 + 2x +1 //--- y = x^7 + a*x^5 + (a-1)*x^2 + 2*x + 1 //--- posizioni di informazione: x^7,x^6,x^5,x^4 //--- posizioni di controllo: x^3,x^2,x^1,1 ring s = (3,a),x,(lp,c); minpoly = a^2+a+2; s; // characteristic : 3 // 1 parameter : a // minpoly : (a2+a-1) // number of vars : 1 // block 1 : ordering lp // : names x // block 2 : ordering c poly w = x^7 + 2*x^5; proc codifica (poly w) { poly g = (x-a)*(x-a^2)*(x-a^3)*(x-a^4); return(w - reduce(w,g)); }; c = codifica(w); poly c = codifica(w); c; x7-x5+x2-x+1 //---decodifica di y poly y = x^7 + a*x^5 + (a+2)*x^2 + 2*x + 1; proc decodifica (poly y) { poly syndrome = subst(y,x,a)+subst(y,x,a^2)*x+subst(y,x,a^3)*x^2+subst(y,x,a^4)*x^3; vector v1 = [x^4,0]; // 2*t = 4, d = 5 vector v2 = [syndrome,1]; module K = v1, v2; option(redSB); module G = std(K); //base ridotta di Groebner per il modulo K if (G[1]