Procedure from library gaussman.lib (see gaussman_lib).
gaussman.lib
ncols(e)=size(w)=size(m)=size(V); typeof(V[i])=="module"
order (a[i][,w[i]][,V[i]]) with multiplicity m[i] lexicographically