let status (a, b, _) =
match Term.status a, Term.status b with
| (Term.Mixed _ as s1), _ -> s1
| _, (Term.Mixed _ as s2) -> s2
| Term.Variable, Term.Variable -> Term.Variable
| Term.Pure(i), (Term.Pure(j) as s2) ->
if i = j then s2 else Term.Mixed(i, a)
| (Term.Pure(i) as s1), Term.Variable -> s1
| Term.Variable, (Term.Pure(j) as s2) -> s2