procedure SLat(G, ~classes, ~len, sgr, sgrincl, incls, ~wlat); incls2:=[]; weight := []; if classes eq [] then classes := [G]; incls := [{0}]; sgr := [x`subgroup : x in MaximalSubgroups(G) ]; sgrincl := [[1,Truncate(#G/#Normalizer(G,x`subgroup))]: x in MaximalSubgroups(G)]; end if; while not(sgr eq []) do max, nmax := Max([#sgr[i] : i in [1..#sgr]]); h := sgr[nmax]; nh := #h; test := true; for i := #classes to 1 by -1 do if #classes[i] eq nh and IsConjugate(G,classes[i],h) then test := false; test2 := true; incls[i]:= incls[i] join {sgrincl[nmax][1]}; for j := 1 to #incls2 do if [sgrincl[nmax][1],i] eq incls2[j] then weight[j] := weight[j]+sgrincl[nmax][2]; test2 := false; break; end if; end for; if test2 then Append(~incls2,[sgrincl[nmax][1],i]); Append(~weight,sgrincl[nmax][2]); end if; break; else if #classes[i] gt nh then break i;end if; end if; end for; if test then Append(~classes,sgr[nmax]); Append(~incls,{sgrincl[nmax][1]}); Append(~incls2,[sgrincl[nmax][1],#classes]); Append(~weight,sgrincl[nmax][2]); hh,phi := DegreeReduction(h); s := MaximalSubgroups(hh); sgr cat:= [x`subgroup@@phi : x in s]; sgrincl cat:= [[#classes,Truncate(#hh/#Normalizer(hh,x`subgroup))] : x in s]; end if; Remove(~sgr,nmax); Remove(~sgrincl,nmax); end while; len := [[i,#classes[i],Truncate(#G/#Normalizer(G,classes[i]))] : i in [1..#classes] ]; wlat := []; for i := 1 to #incls2 do a := incls2[i]; Append(~a,weight[i]); Append(~a,Truncate((len[a[1]][3]*a[3])/len[a[2]][3])); Append(~wlat,a); end for; end procedure;