all_atoms : term -> term set
Because bound variables are returned as part of the result, alpha-equivalent terms will not necessarily give the same results when all_atoms is applied to them.
> HOLset.listItems (all_atoms ``!v. v /\ p``);
val it = [``p``, ``v``, ``$!``, ``$/\``]: term list
> show_types := true;
val it = () : unit
> HOLset.listItems (all_atoms ``!v. v /\ !f. f v``);
val it =
   [``(f :bool -> bool)``, ``(v :bool)``,
    ``($! :(bool -> bool) -> bool)``,
    ``($! :((bool -> bool) -> bool) -> bool)``,
    ``$/\``]: term list
> HOLset.listItems (all_atoms ``!v:'a. T``);
val it =
   [``(v :'a)``, ``($! :('a -> bool) -> bool)``, ``T``]: term list