Burge(TA) := Burgeaux(TA[1],TA[2],[],[]); Burgeaux(TA1,TA2,t1,t2) := IF Length(TA1)=0 THEN [t1, t2] ELSE Block([res],res:Insert(First(TA2),t1), Burgeaux(Rest(TA1),Rest(TA2),First(res), Place(First(TA1),t2,Last(res)))); Place(e,t,c):=IF c=Length(t)+1 THEN EndCons([e],t) ELSE SubstInPart(EndCons(e,t[c]),t,c); /* Insert performs column bumping as follows: Let c=1 While c<=Length(t) Do If Last(t[c]) > e then find the first entry e_new >= e in t[c] replace e_new in t[c] by e increase c by 1, let e=e_new else append e to column c of t stop end while Its return value is [new tableau, column where last bumping occurred] */ Insert(e,t) := Insertaux(e,t,1,Length(t)+1); Insertaux(e,t,c,l):= IF c=l THEN [EndCons([e],t),l] ELSE Block([p],p:Position(e,t[c],lambda([e,f],e<=f)), IF p=Length(t[c])+1 THEN [SubstInPart(EndCons(e,t[c]),t,c),c] ELSE Insertaux(t[c][p],SubstInPart(e,t,c,p),c+1,l)); /* Position(element,list,test:e,f->[T,F]) gives the first index i such that test(e,l[i]) is true, otherwise Length(l)+1 */ Position(e, l, test) := BLOCK([len], len:Length(l)+1, FOR i:1 THRU len DO IF i=len or Apply(test, [e,l[i]]) THEN return(i));