let rec map f a =
try
(match d_interp a with
| Sym.Cons, [b1; b2] ->
let b1' = map f b1
and b2' = map f b2 in
if b1 == b1' && b2 == b2' then a else mk_cons b1' b2'
| Sym.Car, [b] ->
let b' = map f b in
if b == b' then a else mk_car b'
| Sym.Cdr, [b] ->
let b' = map f b in
if b == b' then a else mk_cdr b'
| _ ->
f a)
with
Not_found -> f a