let rec mk_update is_equal a j y =
try
let (b, i, x) = d_update a in
(match is_equal i j with
| Three.Yes ->
update b i y
| Three.No when Term.cmp i j > 0 ->
mk_update is_equal (mk_update is_equal b j y) i x
| _ ->
update a j y)
with
Not_found -> update a j y