Help:=proc(): print(`RT(S)`):end: #RT(S):The set of labelled rooted trees on the set of labels S RT:=proc(S) local Par,SetPartitions,r,Rtrees: Rtrees:={}: for r in S do for i from 1 to nops(S)-1 do Par:=SetPartition(S minus {r}, i): od: od: end: