Hint Immediate ren_incr_refl ren_separated_refl : renamings.
Hint Resolve id_ren_correct id_ren_domain id_ren_validblock
id_ren_invalidblock : id_renamings.
End Renamings.
(** ** Well-Defined values with respect to a renaming*)
Module ValueWD.
Hint Immediate ren_domain_incr_refl : wd.
(** Valid values are the ones that have no pointers outside the domain of f*)
Definition valid_val (f: memren) (v : val) : Prop :=
match v with
| Vptr b _ =>
exists b', f b = Some b'
| _ => True
end.
Inductive valid_val_list (f: memren) : seq val -> Prop :=
| vs_nil: valid_val_list f [::]
| vs_cons: forall v vs,
valid_val f v ->
valid_val_list f vs ->
valid_val_list f (v :: vs).
Definition valid_memval (f: memren) (mv : memval) : Prop :=
match mv with
| Fragment v _ _ =>
valid_val f v
| _ => True
end.
Inductive valid_memval_list (f : memren) : seq memval -> Prop :=
|  mvs_nil : valid_memval_list f [::]
| mvs_cons : forall (v : memval) (vs : seq memval),
valid_memval f v ->
valid_memval_list f vs -> valid_memval_list f (v :: vs).

(* Specifications: *)
Lemma valid_val_incr:
forall f f' v
(Hvalid: valid_val f v)
(Hincr: ren_domain_incr f f'),
valid_val f' v.
Lemma valid_val_list_incr:
forall f f' vs
(Hvalid: valid_val_list f vs)
(Hincr: ren_domain_incr f f'),
valid_val_list f' vs.
Lemma valid_val_domain:
forall f f' m v,
valid_val f v ->
domain_memren f m ->
domain_memren f' m ->
valid_val f' v.
Lemma valid_val_list_domain:
forall f f' m vs
(Hvalid: valid_val_list f vs)
(Hdomain: domain_memren f m)
(Hdomain': domain_memren f' m),
valid_val_list f' vs.
Lemma ofs_val_lt :
forall ofs chunk v,
ofs < ofs + Z.of_nat (length (encode_val chunk v)).