let compare (s, i) (t, j) = assert(if i == j then s = t else not(s = t)); if i < j then -1 else if i == j then 0 else 1