| LIB "decodegb.lib";
intvec v = option(get);
//correct 2 errors in [7,3] 8-ary code RS code
int t=2; int q=8; int n=7; int redun=4;
ring r=(q,a),x,dp;
matrix h_full=genMDSMat(n,a);
matrix h=submat(h_full,1..redun,1..n);
matrix g=dual_code(h);
matrix x[1][3]=0,0,1,0;
matrix y[1][7]=encode(x,g);
//disturb with 2 errors
matrix rec[1][7]=errorInsert(y,list(2,4),list(1,a));
//generate the system
def A=sysQE(h,rec,t);
setring A;
print(qe);
==> U(1)+a^3,
==> U(2)+a^2,
==> U(3)+a^6,
==> U(4),
==> V(1)*U(1)+V(2)*U(2)+U(3),
==> V(1)*U(2)+V(2)*U(3)+U(4),
==> V(1)*U(3)+V(2)*U(4)+U(5),
==> V(1)*U(4)+V(2)*U(5)+U(6),
==> V(1)*U(5)+V(2)*U(6)+U(7),
==> V(1)*U(6)+V(2)*U(7)+U(1),
==> V(2)*U(1)+V(1)*U(7)+U(2)
//let us decode
option(redSB);
ideal sys_qe=std(qe);
print(sys_qe);
==> U(7)+a,
==> U(6)+a^3,
==> U(5)+a^3,
==> U(4),
==> U(3)+a^6,
==> U(2)+a^2,
==> U(1)+a^3,
==> V(2)+1,
==> V(1)+a^4
option(set,v);
|