(** Safe expressions are well-formed with respect to l-values and r-values. *)
Definition expr_kind (a: expr) : kind :=
match a with
| Eloc _ _ _ => LV
| Evar _ _ => LV
| Ederef _ _ => LV
| Efield _ _ _ => LV
| _ => RV
end.

Lemma safe_expr_kind:
forall from C f a k e m,
context from RV C ->
safe (ExprState f (C a) k e m) ->
expr_kind a = from.