(***********************************************)
(* Reflection lemmas                           *)
(* The following series of lemmas establish a  *)
(* bridge between syntax and semantics         *)
(***********************************************)

(* Specifications: *)
Lemma domR i (x : nat) t :
def (interp i t) -> has (ptreq x) t ->
plook' i x \in dom (interp i t).
Lemma lookR i t x :
def (interp i t) -> has (ptreq x) t ->
look (plook' i x) (interp i t) = pread' x t.
Lemma defR i t : def (interp i t) -> uniq (ptrs t).
Lemma freeR i t x :
def (interp i t) -> has (ptreq x) t ->
free (plook' i x) (interp i t) = interp i (pfree x t).
Lemma cancel_sound' i sh1 sh2 unm fs :
interp i sh2 = interp i (sh1 ++ unm) ->
def (interp i sh2) -> eval i fs ->
eval i (cancel' i sh1 sh2 unm fs).
(* Main lemma: the cancel algorithm is correct *)
Lemma cancel_sound i t1 t2 :
def (interp i t1) -> interp i t1 = interp i t2 ->
eval i (cancel i t1 t2).