Commit f2cd21a3 by Dan Frumin

Extend the definition of contextual refinement to cover all EqTypes

parent 6c2be7bd
 ... @@ -188,8 +188,9 @@ Proof. ... @@ -188,8 +188,9 @@ Proof. Qed. Qed. Definition ctx_refines (Γ : stringmap type) Definition ctx_refines (Γ : stringmap type) (e e' : expr) (τ : type) : Prop := ∀ K thp σ v, (e e' : expr) (τ : type) : Prop := ∀ K thp σ v τ', typed_ctx K Γ τ ∅ TUnit → ObsType τ' → typed_ctx K Γ τ ∅ τ' → rtc step ([fill_ctx K e], ∅) (of_val v :: thp, σ) → rtc step ([fill_ctx K e], ∅) (of_val v :: thp, σ) → ∃ thp' σ', rtc step ([fill_ctx K e'], ∅) (of_val v :: thp', σ'). ∃ thp' σ', rtc step ([fill_ctx K e'], ∅) (of_val v :: thp', σ'). Notation "Γ ⊨ e '≤ctx≤' e' : τ" := Notation "Γ ⊨ e '≤ctx≤' e' : τ" := ... ...
 ... @@ -335,6 +335,35 @@ Section logrel. ... @@ -335,6 +335,35 @@ Section logrel. + iDestruct "H1" as ([??]) "[% H1]"; simplify_eq/=. + iDestruct "H1" as ([??]) "[% H1]"; simplify_eq/=. rewrite IHHτ2. by iDestruct "H1" as "%"; subst. rewrite IHHτ2. by iDestruct "H1" as "%"; subst. Qed. Qed. (* Observable types are, at the moment, exactly the types which support equality. *) Definition ObsType : type → Prop := EqType. (* TODO: derive this from [interp_EqType_agree] *) (* This formulation is more suitable for proving soundness of the logical relation in [soundness_binary.v] *) Lemma interp_ObsType_agree τ : ∀ (v v' : val), ⟦ τ ⟧ [] (v, v') ⊢ ⌜ObsType τ → v = v'⌝. Proof. induction τ; iIntros (v v') "HI"; simpl; eauto; try by (iPureIntro; inversion 1). - iDestruct "HI" as "[% %]"; subst; eauto. - iDestruct "HI" as (n) "[% %]"; subst; eauto. - iDestruct "HI" as (b) "[% %]"; subst; eauto. - iDestruct "HI" as ([v1 v1'] [v2 v2']) "/= [% [H1 H2]]". simplify_eq/=. iDestruct (IHτ1 with "H1") as %IH1. iDestruct (IHτ2 with "H2") as %IH2. iPureIntro. inversion 1; simplify_eq. rewrite IH1; auto. by rewrite IH2. - iDestruct "HI" as "[HI | HI]"; iDestruct "HI" as ([w w']) "[% HI]"; simplify_eq/=. + iDestruct (IHτ1 with "HI") as %IH1. iPureIntro. inversion 1. by rewrite IH1. + iDestruct (IHτ2 with "HI") as %IH2. iPureIntro. inversion 1. by rewrite IH2. Qed. End logrel. End logrel. Typeclasses Opaque interp_env. Typeclasses Opaque interp_env. ... ...