let rec map f a =
match a with
| App(Pp(Expt(n)), [x]) ->
let x' = map f x in
if x == x' then a else
mk_expt n x'
| App(Pp(Mult), xl) ->
let xl' = mapl (map f) xl in
if xl' == xl then a else
mk_multl xl'
| _ ->
f a