(** 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.

(* Specifications: *)
Lemma eventval_match_receptive: forall ev1 ty v1 ev2, eventval_match ev1 ty v1 -> eventval_valid ev1 -> eventval_valid ev2 -> eventval_type ev1 = eventval_type ev2 -> exists v2, eventval_match ev2 ty v2.
Lemma eventval_match_valid: forall ev ty v, eventval_match ev ty v -> eventval_valid ev.
Lemma eventval_match_same_type: forall ev1 ty v1 ev2 v2, eventval_match ev1 ty v1 -> eventval_match ev2 ty v2 -> eventval_type ev1 = eventval_type ev2.
Lemma eventval_valid_preserved: forall ev, eventval_valid ge1 ev -> eventval_valid ge2 ev.
Lemma eventval_match_preserved: forall ev ty v, eventval_match ge1 ev ty v -> eventval_match ge2 ev ty v.
Lemma eventval_list_match_preserved: forall evl tyl vl, eventval_list_match ge1 evl tyl vl -> eventval_list_match ge2 evl tyl vl.