let
vars e =
exp_fold
~var:(
fun
x collect -> x :: collect)
~int:(
fun
n collect -> collect)
~plus:(
fun
ve1 ve2 collect -> ve1 (ve2 collect))
e
[]
;;
vars e;;