Section EVENTVAL.
(** Symbol environment used to translate between global variable names and their block identifiers. *)
Variable ge: Senv.t.
(** Translation between values and event values. *)
Inductive eventval_match: eventval -> typ -> val -> Prop :=
| ev_match_int: forall i,
eventval_match (EVint i) Tint (Vint i)
| ev_match_long: forall i,
eventval_match (EVlong i) Tlong (Vlong i)
| ev_match_float: forall f,
eventval_match (EVfloat f) Tfloat (Vfloat f)
| ev_match_single: forall f,
eventval_match (EVsingle f) Tsingle (Vsingle f)
| ev_match_ptr: forall id b ofs,
Senv.public_symbol ge id = true ->
Senv.find_symbol ge id = Some b ->
eventval_match (EVptr_global id ofs) Tptr (Vptr b ofs).
Inductive eventval_list_match: list eventval -> list typ -> list val -> Prop :=
| evl_match_nil:
eventval_list_match nil nil nil
| evl_match_cons:
forall ev1 evl ty1 tyl v1 vl,
eventval_match ev1 ty1 v1 ->
eventval_list_match evl tyl vl ->
eventval_list_match (ev1::evl) (ty1::tyl) (v1::vl).
(** Some properties of these translation predicates. *)
(** Determinism *)
(** Validity *)
Definition eventval_valid (ev: eventval) : Prop :=
match ev with
| EVint _ => True
| EVlong _ => True
| EVfloat _ => True
| EVsingle _ => True
| EVptr_global id ofs => Senv.public_symbol ge id = true
end.
Definition eventval_type (ev: eventval) : typ :=
match ev with
| EVint _ => Tint
| EVlong _ => Tlong
| EVfloat _ => Tfloat
| EVsingle _ => Tsingle
| EVptr_global id ofs => Tptr
end.

Lemma eventval_match_valid:
forall ev ty v, eventval_match ev ty v -> eventval_valid ev.