Temp
for each tuple T in Rel { T' = mkTuple([attrs],T) write T' to Temp } sort Temp on [attrs] for each tuple T in Temp { if (T == Prev) continue write T to Result Prev = T }