Hint Resolve areg_sound aregs_sound: va.
(** * Interface with other optimizations *)
Ltac InvSoundState :=
match goal with
| H1: sound_state ?prog ?st, H2: linkorder ?cunit ?prog |- _ =>
let S := fresh "S" in generalize (sound_state_inv _ _ _ H1 H2); intros S; inv S
end.
Definition avalue (a: VA.t) (r: reg) : aval :=
match a with
| VA.Bot => Vbot
| VA.State ae am => AE.get r ae
end.

(* Specifications: *)
Lemma avalue_sound:
forall cunit prog s f sp pc e m r,
sound_state prog (State s f (Vptr sp Ptrofs.zero) pc e m) ->
linkorder cunit prog ->
exists bc,
vmatch bc e#r (avalue (analyze (romem_for cunit) f)!!pc r)
/\ genv_match bc (Genv.globalenv prog)
/\ bc sp = BCstack.