(** * Soundness of the compile-time evaluator *)
(** A global environment [ge] induces a memory injection mapping our symbolic pointers [Vptr id ofs] to run-time pointers [Vptr b ofs] where [Genv.find_symbol ge id = Some b]. *)
Definition inj (b: block) :=
match Genv.find_symbol ge b with
| Some b' => Some (b', 0)
| None => None
end.

(* Specifications: *)
Lemma mem_empty_not_valid_pointer:
forall b ofs, Mem.valid_pointer Mem.empty b ofs = false.
Lemma mem_empty_not_weak_valid_pointer:
forall b ofs, Mem.weak_valid_pointer Mem.empty b ofs = false.
Lemma sem_cast_match:
forall v1 ty1 ty2 m v2 v1' v2',
sem_cast v1 ty1 ty2 m = Some v2 ->
do_cast v1' ty1 ty2 = OK v2' ->
Val.inject inj v1' v1 ->
Val.inject inj v2' v2.
Lemma bool_val_match:
forall v ty b v' m,
bool_val v ty Mem.empty = Some b ->
Val.inject inj v v' ->
bool_val v' ty m = Some b.