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).
(** Lemmas about the well-definedness of the various value constructors*)

Lemma valid_val_modls:
forall f v1 v2 v,
Val.modls v1 v2 = Some v ->
valid_val f v.