Notation val_inject:=Val.inject.
(*A value that is (if its a pointer) not dangling wrt m - a condition like this will probably be need to imposed on after-external return values (and thus also on the values returned by halted)*)
Definition val_valid (v:val) (m:mem):Prop :=
match v with Vptr b ofs => Mem.valid_block m b | _ => True
end.
(*memories that do not contain "dangling pointers"*)
Definition mem_wd m := Mem.inject_neutral (Mem.nextblock m) m.
Inductive valid_genv {F V:Type} (ge:Genv.t F V) (m:mem) : Type :=
mk_valid_genv :
(forall b, isGlobalBlock ge b=true -> val_valid (Vptr b Ptrofs.zero) m) ->
(forall b f, Genv.find_funct_ptr ge b = Some f -> val_valid (Vptr b Ptrofs.zero) m) ->
valid_genv ge m.

Lemma mem_wd_store_zeros: forall m b p n m1
(STORE_ZERO: store_zeros m b p n = Some m1) (WD: mem_wd m), mem_wd m1.