let occurs =
(* let ht = Pairtbl.create 17 in *) (* hashing slows down the program. *)
fun ((x, a) as p) ->
(* try
Pairtbl.find ht p
with
Not_found -> *)
let rec term_occurs = function
| Var(y) -> Var.eq x y
| App(_, sl) -> List.exists term_occurs sl
in
let result = match a with
| True -> false
| False -> false
| Equal(s, t) -> term_occurs s || term_occurs t
| Diseq(s, t) -> term_occurs s || term_occurs t
| In(s, _) -> term_occurs s
in
(* Pairtbl.add ht p result; *)
result