let cmp f g = if f == g then 0 else begin assert(not(equal f g) && hash f <> hash g); if hash f < hash g then -1 else 1 end