let rec map is_equal f b =
match b with
| App(Arrays(Create), [a]) ->
let a' = map is_equal f a in
if a == a' then b else
mk_create a'
| App(Arrays(Update), [a; i; x]) ->
let a' = map is_equal f a and i' = map is_equal f i and x' = map is_equal f x in
if a == a' && i == i' && x == x' then b else
mk_update is_equal a' i' x'
| App(Arrays(Select), [a; j]) ->
let a' = map is_equal f a and j' = map is_equal f j in
if a == a' && j == j' then b else
mk_select is_equal a' j'
| _ ->
f b