let find s x = let rec loop x = try let (y, _) = apply s x in if Term.eq x y then y else loop y with Not_found -> x in (loop x, None)