Instance Sep_state: Sep_alg state.
Definition expr_denote (e : expr) (s : state) : val :=
match e with Nil => nil_val | Var x => stack_get (stk s) (Some x) end.
Definition var_eq (x y : expr) (s : state) := expr_denote x s = expr_denote y s.
Hint Unfold var_eq : spred.
Infix "===" := var_eq (at level 35, no associativity).

(* Specifications: *)
Lemma var_eq_refl : forall x s, (x === x) s.
Definition neg (P : spred) : spred := fun s : state => ~P s.