Module ValObsEq.
(** Strong injections on values *)
Inductive val_obs (mi : memren) : val -> val -> Prop :=
obs_int : forall i : int, val_obs mi (Vint i) (Vint i)
| obs_long : forall i : int64, val_obs mi (Vlong i) (Vlong i)
| obs_float : forall f : Floats.float,
val_obs mi (Vfloat f) (Vfloat f)
| obs_single : forall f : Floats.float32,
val_obs mi (Vsingle f) (Vsingle f)
| obs_ptr : forall (b1 b2 : block) (ofs : ptrofs),
mi b1 = Some b2 ->
val_obs mi (Vptr b1 ofs) (Vptr b2 ofs)
| obs_undef : val_obs mi Vundef Vundef.
(** Strong injections on memory values*)
Inductive memval_obs_eq (f : memren) : memval -> memval -> Prop :=
| memval_obs_byte : forall n : byte,
memval_obs_eq f (Byte n) (Byte n)
| memval_obs_frag : forall (v1 v2 : val) (q : quantity) (n : nat)
(Hval_obs: val_obs f v1 v2),
memval_obs_eq f (Fragment v1 q n) (Fragment v2 q n)
| memval_obs_undef : memval_obs_eq f Undef Undef.
Inductive val_obs_list (mi : memren) : seq val -> seq val -> Prop :=
val_obs_list_nil : val_obs_list mi [::] [::]
| val_obs_list_cons : forall (v v' : val) (vl vl' : seq val),
val_obs mi v v' ->
val_obs_list mi vl vl' ->
val_obs_list mi (v :: vl) (v' :: vl').
Hint Constructors val_obs : val_renamings.
Proof with eauto with val_renamings.
intros.
destruct v; inversion Hval_obs; subst...
Qed.
Proof with eauto with val_renamings.
intros v v' v'' f f' f'' Hval'' Hval' Hf.
inversion Hval'; subst; inversion Hval''; subst...
Qed.

(** Two values that are equal are related by the id injection on a valid memory*)
Lemma val_obs_id:
forall f v
(Hvalid: valid_val f v)
(Hid: forall b b', f b = Some b' -> b = b'),
val_obs f v v.