let rec map f a =
try
(match d_interp a with
| Sym.Apply, [x; y] ->
let x' = map f x and y' = map f y in
if x == x' && y == y' then a else
mk_apply x' y'
| Sym.Apply, op :: al ->
let op' = map f op in
let al' = Term.mapl (map f) al in
if op == op' && al == al' then a else
mk_apply_star op' al'
| _ , [] ->
a
| _ ->
f a)
with
Not_found -> f a