(*
Definition agree_except (x: var) (s s': state) : Prop :=
   (forall x', x' <> x -> stack_get (stk s) (Some x') = stack_get (stk s') (Some x')) /\ hp s = hp s'.

Lemma agree_except_refl: forall x s, agree_except x s s.
Proof. unfold agree_except; intuition.
Qed.
Hint Resolve agree_except_refl.

Definition existsv (nextv: var) (P: spred) : spred :=
   fun s => exists s', agree_except nextv s s' /\ P s'.
*)

Definition existsv (nextv: var) (P: spred) : spred :=
   fun s => exists y,  P (State (env_set nextv y (stk s)) (hp s)).Definition fresh {A} (f: A -> var) (a: A) (x: var) : Prop :=  Ident.lt (f a) x.

(* Specifications: *)
Lemma list_denote_separate': forall (X Y: Type) (f: X -> spred) (g: Y -> spred) (base: spred) l1 l2, list_denote f (@sepcon _ _) (list_denote g (@sepcon _ _) base l2) l1 = sepcon (list_denote f (@sepcon _ _) emp l1) (sepcon (list_denote g (@sepcon _ _) emp l2) base).