let rec vars_of a = match a with | Var _ -> Var.Set.singleton a | App(_, al, _) -> List.fold_left (fun acc b -> Var.Set.union (vars_of b) acc) Var.Set.empty al