Section Core.
(* The following definition ties together worlds and states *)
Definition hooks_consistent (c : context) (h : hooks) : Prop :=
forall z lc ls t, ((z, lc), (ls, t)) \in dom h ->
(lc \in dom c) && (ls \in dom c).
Definition hook_complete w := hooks_consistent (getc w) (geth w).

Lemma locE i n k x y :
k \in dom i -> valid i -> valid (dstate (getStatelet i k)) ->
getLocal n (getStatelet (upd k
{| dstate := upd n x (dstate (getStatelet i k));
dsoup := y |} i) k) = x.