Module TEST.
Goal False.
evar (T1: list (ident * val)).
evar (T2: list (ident * (type * val))).
evar (Q' : list (environ -> Prop)).
assert (local2list  ((`(eq Vundef) (eval_id 1%positive)) :: (`(eq (Vint (Int.repr 1))) (eval_id 1%positive)) ::
(`(eq 1 3)) :: nil)
T1 T2 Q').
subst T1 T2 Q'.
repeat constructor; repeat simpl; auto.
simpl in H.
Abort.
Goal False.
evar (T1: list (ident * val)).
evar (T2: list (ident * (type * val))).
evar (Q' : list (environ -> Prop)).
assert (local2list ((`(eq Vundef) (eval_id 1%positive))::nil) T1 T2 Q').
subst T1 T2 Q'.
repeat constructor; repeat simpl; auto.
Abort.
End TEST.
Definition localtempD (p : (ident * val)) := let (i, v) := p in `(eq v) (eval_id i).
Definition localvarD (p : ident * (type * val))  := let (i, tv) := p in `(eq (snd tv)) (eval_var i (fst tv)).
Definition LocallistD (T1: list (ident * val)) (T2: list (ident * (type * val))) (Q: list (environ -> Prop)) :=
map localtempD T1 ++ map localvarD T2 ++ Q.

Lemma PTree_elements_set: forall {A} i (v: A) elm T,
In elm (PTree.elements (PTree.set i v T)) ->
elm = (i, v) \/ In elm (PTree.elements T).