Hint Resolve tree_rep_nullval: saturate_local.

(* Lemma bst_left_entail: forall (t1 t1' t2: tree val) k (v p1 p2 p b: val), Int.min_signed <= k <= Int.max_signed -> is_pointer_or_null v -> data_at Tsh (tptr t_struct_tree) p b * data_at Tsh t_struct_tree (Vint (Int.repr k), (v, (p1, p2))) p * tree_rep t1 p1 * tree_rep t2 p2 |-- treebox_rep t1 (field_address t_struct_tree [StructField _left] p) * (treebox_rep t1' (field_address t_struct_tree [StructField _left] p) -* treebox_rep (T t1' k v t2) b).  Lemma bst_right_entail: forall (t1 t2 t2': tree val) k (v p1 p2 p b: val), Int.min_signed <= k <= Int.max_signed -> is_pointer_or_null v -> data_at Tsh (tptr t_struct_tree) p b * data_at Tsh t_struct_tree (Vint (Int.repr k), (v, (p1, p2))) p * tree_rep t1 p1 * tree_rep t2 p2 |-- treebox_rep t2 (field_address t_struct_tree [StructField _right] p) * (treebox_rep t2' (field_address t_struct_tree [StructField _right] p) -* treebox_rep (T t1 k v t2') b).  Lemma modus_ponens_wand' {A}{ND: NatDed A}{SL: SepLog A}: forall P Q R: A, P |-- Q -> P * (Q -* R) |-- R. *)
Lemma if_trueb: forall {A: Type} b (a1 a2: A), b = true -> (if b then a1 else a2) = a1.
Definition lookup_inv (b0 p0: val) (t0: tree val) (x: Z): environ -> mpred :=
EX p: val, EX t: tree val,
PROP(lookup nullval x t = lookup nullval x t0)
LOCAL(temp _p p; temp _x (Vint (Int.repr x)))
SEP(tree_rep t p;  (tree_rep t p -* tree_rep t0 p0)).