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 local2list_soundness: forall P Q R T1 T2 Q',
local2list Q T1 T2 Q' ->
PROPx P (LOCALx Q (SEPx R)) = PROPx P (LOCALx (LocallistD T1 T2 Q') (SEPx R)).