Definition total_map (A:Type) := key -> A.Definition t_empty {A:Type} (v : A) : total_map A :=
  (fun _ => v).Definition combine {A} (pivot: key) (m1 m2: total_map A) : total_map A :=
  fun x : key => if zlt x pivot  then m1 x else m2 x.Inductive Abs:  tree val -> total_map val -> Prop :=
| Abs_E: Abs E (t_empty nullval)
| Abs_T: forall a b l k v r,
      Abs l a ->
      Abs r b ->
      Abs (T l k v r)  (t_update (combine k a b) k v).Inductive Abs:  tree val -> total_map val -> Prop :=
| Abs_E: Abs E (t_empty nullval)
| Abs_T: forall a b l k v r,
      Abs l a ->
      Abs r b ->
      Abs (T l k v r)  (t_update (combine k a b) k v).Inductive Abs:  tree val -> total_map val -> Prop :=
| Abs_E: Abs E (t_empty nullval)
| Abs_T: forall a b l k v r,
      Abs l a ->
      Abs r b ->
      Abs (T l k v r)  (t_update (combine k a b) k v).

(* Specifications: *)
Theorem insert_relate: forall k v t cts, Abs t cts -> Abs (insert k v t) (t_update cts k v).
Theorem lookup_relate: forall k t cts , Abs t cts -> lookup nullval k t = cts k.
Lemma subsume_insert: subsume_funspec (snd insert_spec) (snd abs_insert_spec).
Lemma subsume_treebox_new: subsume_funspec (snd treebox_new_spec) (snd abs_treebox_new_spec).
Lemma subsume_treebox_free: subsume_funspec (snd treebox_free_spec) (snd abs_treebox_free_spec).
Lemma body_main: semax_body Vprog Gprog f_main main_spec.