% Constructing orthonormalized system from a list of vectors l0 % given in the form v,l; the first one must be timelike vector l; procedure ort(l0); begin scalar l2,l3,x,w,y1,y2; l2:={}; y1:=0; for each v in l0 do << y2:=0; for each w in l2 do << x:=v*w; index l; x:=x; remind l; y2:=y2+1; v:=v-x*w*(if y2=y1 then 1 else -1) >>; x:=v^2; index l; x:=x; remind l; y1:=y1+1; v:=v/sqrt(x*(if y1=1 then 1 else -1)); l2:=v.l2 >>; return reverse(l2) end$ % Substituting ex (in the form v.l) for ax in x procedure epol(ax,ex,x); begin scalar x0,x1,e1; x0:=sub(ax=0*ax,x); x1:=x-x0; index l; e1:=ex*ax.l; remind l; index ax; x1:=x0+x1*e1; remind ax; return x1 end$ end;