let is_pure i = let rec loop = function | Var _ -> true | App(f, al, _) -> Sym.theory_of f = i && List.for_all loop al in loop