Section EXTEN.
Variable valu1: valuation.
Variable upto: valnum.
Variable valu2: valuation.
Hypothesis AGREE: valu_agree valu1 valu2 upto.
Variable ge: genv.
Variable sp: val.
Variable rs: regset.
Variable m: mem.
End EXTEN.
Ltac splitall := repeat (match goal with |- _ /\ _ => split end).
Remark in_remove:
forall (A: Type) (eq: forall (x y: A), {x=y}+{x<>y}) x y l,
In y (List.remove eq x l) <-> x <> y /\ In y l.
Proof with (try discriminate).
unfold shift_memcpy_eq; intros.
destruct e. destruct r... destruct a...
try (rename i into ofs).
destruct (zle src (Ptrofs.unsigned ofs) &&
zle (Ptrofs.unsigned ofs + size_chunk m) (src + sz) &&
zeq (delta mod align_chunk m) 0 && zle 0 (Ptrofs.unsigned ofs + delta) &&
zle (Ptrofs.unsigned ofs + delta) Ptrofs.max_unsigned)...
inv H. destruct H0. split. auto. red; simpl; tauto.
Qed.

Lemma shift_memcpy_eq_holds:
forall src dst sz e e' m sp bytes m' valu ge,
shift_memcpy_eq src sz (dst - src) e = Some e' ->
Mem.loadbytes m sp src sz = Some bytes ->
Mem.storebytes m sp dst bytes = Some m' ->
equation_holds valu ge (Vptr sp Ptrofs.zero) m e ->
equation_holds valu ge (Vptr sp Ptrofs.zero) m' e'.