Commit ab35b735 authored by Dan Frumin's avatar Dan Frumin

Simplify the notation for the relational judements

{E,E;Δ,Γ} ⊨ ... => {E;Δ,Γ} ⊨ ...
{⊤,⊤;Δ,Γ} ⊨ ... => {Δ,Γ} ⊨ ...
parent cd3dd884
......@@ -121,8 +121,8 @@ Section heapify_refinement.
Lemma heapify_refinement_ez Γ E1 b1 b2 :
logrelN E1
{E1,E1;Δ;Γ} b1 log b2 : bitτ -
{E1,E1;Δ;Γ} heapify b1 log heapify b2 : bitτ.
{E1;Δ;Γ} b1 log b2 : bitτ -
{E1;Δ;Γ} heapify b1 log heapify b2 : bitτ.
Proof.
iIntros (?) "Hb1b2".
iApply bin_log_related_app; eauto.
......
......@@ -77,8 +77,8 @@ Section CG_Counter.
Lemma bin_log_FG_increment_l Γ K E x (n : nat) t τ :
x ↦ᵢ #n -
(x ↦ᵢ # (S n) - {E,E;Δ;Γ} fill K #() log t : τ) -
{E,E;Δ;Γ} fill K (FG_increment #x #()) log t : τ.
(x ↦ᵢ # (S n) - {E;Δ;Γ} fill K #() log t : τ) -
{E;Δ;Γ} fill K (FG_increment #x #()) log t : τ.
Proof.
iIntros "Hx Hlog".
iApply bin_log_related_wp_l.
......@@ -146,7 +146,7 @@ Section CG_Counter.
(( n : nat, x ↦ᵢ #n R n) ={E2,E1}= True)
( m, x ↦ᵢ # (S m) R m - P -
{E2,E1;Δ;Γ} fill K #() log t : τ))
- ({E1,E1;Δ;Γ} fill K ((FG_increment $/ LitV (Loc x)) #()) log t : τ).
- ({E1;Δ;Γ} fill K ((FG_increment $/ LitV (Loc x)) #()) log t : τ).
Proof.
iIntros "HP #H".
iLöb as "IH".
......@@ -189,7 +189,7 @@ Section CG_Counter.
(( n : nat, x ↦ᵢ #n R n) ={E2,E1}= True)
( m : nat, x ↦ᵢ #m R m -
{E2,E1;Δ;Γ} fill K #m log t : τ))
- {E1,E1;Δ;Γ} fill K ((counter_read $/ LitV (Loc x)) #()) log t : τ.
- {E1;Δ;Γ} fill K ((counter_read $/ LitV (Loc x)) #()) log t : τ.
Proof.
iIntros "#H".
unfold counter_read. unlock. simpl.
......@@ -205,7 +205,7 @@ Section CG_Counter.
(* TODO: try to use with_lock rules *)
Lemma FG_CG_increment_refinement l cnt cnt' Γ :
inv counterN (counter_inv l cnt cnt') -
{,;Δ;Γ} FG_increment $/ LitV (Loc cnt) log CG_increment $/ LitV (Loc cnt') $/ LitV (Loc l) : TArrow TUnit TUnit.
{Δ;Γ} FG_increment $/ LitV (Loc cnt) log CG_increment $/ LitV (Loc cnt') $/ LitV (Loc l) : TArrow TUnit TUnit.
Proof.
iIntros "#Hinv".
iApply bin_log_related_arrow_val.
......@@ -236,7 +236,7 @@ Section CG_Counter.
Lemma counter_read_refinement l cnt cnt' Γ :
inv counterN (counter_inv l cnt cnt') -
{,;Δ;Γ} counter_read $/ LitV (Loc cnt) log counter_read $/ LitV (Loc cnt') : TArrow TUnit TNat.
{Δ;Γ} counter_read $/ LitV (Loc cnt) log counter_read $/ LitV (Loc cnt') : TArrow TUnit TNat.
Proof.
iIntros "#Hinv".
iApply bin_log_related_arrow_val.
......@@ -262,7 +262,7 @@ Section CG_Counter.
Qed.
Lemma FG_CG_counter_refinement :
{,;Δ;} FG_counter log CG_counter :
{Δ;} FG_counter log CG_counter :
TArrow TUnit (TProd (TArrow TUnit TUnit) (TArrow TUnit TNat)).
Proof.
unfold FG_counter, CG_counter.
......
......@@ -38,8 +38,8 @@ Section Refinement.
Lemma rand_l Δ Γ E1 K ρ t τ :
choiceN E1
spec_ctx ρ - ( b : bool, {E1,E1;Δ;Γ} fill K #b log t : τ) -
{E1,E1;Δ;Γ} fill K (rand #()) log t : τ.
spec_ctx ρ - ( b : bool, {E1;Δ;Γ} fill K #b log t : τ) -
{E1;Δ;Γ} fill K (rand #()) log t : τ.
Proof.
iIntros (?) "#Hs Hlog".
unfold rand. unlock. simpl.
......
......@@ -72,8 +72,8 @@ Section lockG_rules.
Lemma bin_log_related_newlock_l (R : iProp Σ) Δ Γ E K t τ :
R -
( (lk : loc) γ, is_lock γ #lk R
- ({E,E;Δ;Γ} fill K #lk log t: τ)) -
{E,E;Δ;Γ} fill K (newlock #()) log t: τ.
- ({E;Δ;Γ} fill K #lk log t: τ)) -
{E;Δ;Γ} fill K (newlock #()) log t: τ.
Proof.
iIntros "HR Hlog".
iApply bin_log_related_wp_l.
......@@ -90,8 +90,8 @@ Section lockG_rules.
is_lock γ #lk R -
locked γ -
R -
({E,E;Δ;Γ} fill K #() log t: τ) -
{E,E;Δ;Γ} fill K (release #lk) log t: τ.
({E;Δ;Γ} fill K #() log t: τ) -
{E;Δ;Γ} fill K (release #lk) log t: τ.
Proof.
iIntros (?) "Hlock Hlocked HR Hlog".
iDestruct "Hlock" as (l) "[% #?]"; simplify_eq.
......@@ -109,8 +109,8 @@ Section lockG_rules.
Lemma bin_log_related_acquire_l (R : iProp Σ) (lk : loc) γ Δ Γ E K t τ :
N E
is_lock γ #lk R -
(locked γ - R - {E,E;Δ;Γ} fill K #() log t: τ) -
{E,E;Δ;Γ} fill K (acquire #lk) log t: τ.
(locked γ - R - {E;Δ;Γ} fill K #() log t: τ) -
{E;Δ;Γ} fill K (acquire #lk) log t: τ.
Proof.
iIntros (?) "#Hlock Hlog".
iLöb as "IH".
......@@ -167,8 +167,8 @@ Section lock_rules_r.
Qed.
Lemma bin_log_related_newlock_l_simp Γ K t τ :
( l : loc, l ↦ᵢ #false - {E1,E1;Δ;Γ} fill K #l log t : τ) -
{E1,E1;Δ;Γ} fill K (newlock #()) log t : τ.
( l : loc, l ↦ᵢ #false - {E1;Δ;Γ} fill K #l log t : τ) -
{E1;Δ;Γ} fill K (newlock #()) log t : τ.
Proof.
iIntros "Hlog".
unfold newlock. unlock.
......@@ -209,8 +209,8 @@ Section lock_rules_r.
Lemma bin_log_related_acquire_suc_l Γ K l t τ :
l ↦ᵢ #false -
(l ↦ᵢ #true - {E1,E1;Δ;Γ} fill K (#()) log t : τ) -
{E1,E1;Δ;Γ} fill K (acquire #l) log t : τ.
(l ↦ᵢ #true - {E1;Δ;Γ} fill K (#()) log t : τ) -
{E1;Δ;Γ} fill K (acquire #l) log t : τ.
Proof.
iIntros "Hl Hlog".
unfold acquire. unlock.
......@@ -226,8 +226,8 @@ Section lock_rules_r.
Lemma bin_log_related_acquire_fail_l Γ K l t τ :
l ↦ᵢ #true -
(l ↦ᵢ #false - {E1,E1;Δ;Γ} fill K (acquire #l) log t : τ) -
{E1,E1;Δ;Γ} fill K (acquire #l) log t : τ.
(l ↦ᵢ #false - {E1;Δ;Γ} fill K (acquire #l) log t : τ) -
{E1;Δ;Γ} fill K (acquire #l) log t : τ.
Proof.
iIntros "Hl Hlog".
iLöb as "IH".
......
......@@ -36,9 +36,9 @@ Section contents.
Lemma bin_log_related_or Δ Γ E e1 e2 e1' e2' :
logrelN E
{E,E;Δ;Γ} e1 log e1' : TArrow TUnit TUnit -
{E,E;Δ;Γ} e2 log e2' : TArrow TUnit TUnit -
{E,E;Δ;Γ} or e1 e2 log or e1' e2' : TUnit.
{E;Δ;Γ} e1 log e1' : TArrow TUnit TUnit -
{E;Δ;Γ} e2 log e2' : TArrow TUnit TUnit -
{E;Δ;Γ} or e1 e2 log or e1' e2' : TUnit.
Proof.
iIntros (?) "He1 He2".
iApply (bin_log_related_app with "[He1] He2").
......@@ -48,8 +48,8 @@ Section contents.
Lemma bin_log_or_choice_1_r_val Δ Γ E (v1 v1' v2 : val) :
logrelN E
{E,E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v1 #() log or v1' v2 : TUnit.
{E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E;Δ;Γ} v1 #() log or v1' v2 : TUnit.
Proof.
iIntros (?) "Hlog".
unlock or. repeat rel_rec_r.
......@@ -64,7 +64,7 @@ Section contents.
Lemma bin_log_or_choice_1_r_val_typed Δ Γ E (v1 v2 : val) :
logrelN E
Γ ⊢ₜ v1 : TArrow TUnit TUnit
{E,E;Δ;Γ} v1 #() log or v1 v2 : TUnit.
{E;Δ;Γ} v1 #() log or v1 v2 : TUnit.
Proof.
iIntros (??).
iApply bin_log_or_choice_1_r_val; eauto.
......@@ -73,8 +73,8 @@ Section contents.
Lemma bin_log_or_choice_1_r Δ Γ E (e1 e1' : expr) (v2 : val) :
logrelN E
{E,E;Δ;Γ} e1 log e1' : TArrow TUnit TUnit -
{E,E;Δ;Γ} e1 #() log or e1' v2 : TUnit.
{E;Δ;Γ} e1 log e1' : TArrow TUnit TUnit -
{E;Δ;Γ} e1 #() log or e1' v2 : TUnit.
Proof.
iIntros (?) "Hlog".
rel_bind_l e1.
......@@ -90,7 +90,7 @@ Section contents.
logrelN E
Closed e1
Γ ⊢ₜ e1 : TUnit
{E,E;Δ;Γ} e1 log or (λ: <>, e1) v2 : TUnit.
{E;Δ;Γ} e1 log or (λ: <>, e1) v2 : TUnit.
Proof.
iIntros (???).
unlock or. repeat rel_rec_r.
......@@ -118,9 +118,9 @@ Section contents.
Lemma bin_log_or_commute Δ Γ E (v1 v1' v2 v2' : val) :
orN E
logrelN E
{E,E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v2 log v2' : TArrow TUnit TUnit -
{E,E;Δ;Γ} or v2 v1 log or v1' v2' : TUnit.
{E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E;Δ;Γ} v2 log v2' : TArrow TUnit TUnit -
{E;Δ;Γ} or v2 v1 log or v1' v2' : TUnit.
Proof.
iIntros (??) "Hv1 Hv2".
unlock or. repeat rel_rec_r. repeat rel_rec_l.
......@@ -155,8 +155,8 @@ Section contents.
Lemma bin_log_or_idem_r Δ Γ E (v v' : val) :
logrelN E
{E,E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v #() log or v' v' : TUnit.
{E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E;Δ;Γ} v #() log or v' v' : TUnit.
Proof.
iIntros (?) "Hlog".
by iApply bin_log_or_choice_1_r_val.
......@@ -166,7 +166,7 @@ Section contents.
Closed e
logrelN E
Γ ⊢ₜ e : TUnit
{E,E;Δ;Γ} e log or (λ: <>, e) (λ: <>, e) : TUnit.
{E;Δ;Γ} e log or (λ: <>, e) (λ: <>, e) : TUnit.
Proof.
iIntros (???).
iPoseProof (bin_log_or_choice_1_r_body Δ _ _ e (λ: <>, e)) as "HZ"; eauto.
......@@ -176,8 +176,8 @@ Section contents.
Lemma bin_log_or_idem_l Δ Γ E (v v' : val) :
orN E
logrelN E
{E,E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E,E;Δ;Γ} or v v log v' #() : TUnit.
{E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E;Δ;Γ} or v v log v' #() : TUnit.
Proof.
iIntros (??) "Hlog".
unlock or. repeat rel_rec_l.
......@@ -203,8 +203,8 @@ Section contents.
Lemma bin_log_or_bot_l Δ Γ E (v v' : val) :
orN E
logrelN E
{E,E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E,E;Δ;Γ} or v bot log v' #() : TUnit.
{E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E;Δ;Γ} or v bot log v' #() : TUnit.
Proof.
iIntros (??) "Hlog".
unlock or. repeat rel_rec_l.
......@@ -228,8 +228,8 @@ Section contents.
Lemma bin_log_or_bot_r Δ Γ E (v v' : val) :
logrelN E
{E,E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v #() log or v' bot : TUnit.
{E;Δ;Γ} v log v' : TArrow TUnit TUnit -
{E;Δ;Γ} v #() log or v' bot : TUnit.
Proof.
iIntros (?) "Hlog".
iApply bin_log_or_choice_1_r_val; eauto.
......@@ -238,10 +238,10 @@ Section contents.
Lemma bin_log_or_assoc1 Δ Γ E (v1 v1' v2 v2' v3 v3' : val) :
orN E
logrelN E
{E,E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v2 log v2' : TArrow TUnit TUnit -
{E,E;Δ;Γ} v3 log v3' : TArrow TUnit TUnit -
{E,E;Δ;Γ} or v1 (λ: <>, or v2 v3) log or (λ: <>, or v1' v2') v3' : TUnit.
{E;Δ;Γ} v1 log v1' : TArrow TUnit TUnit -
{E;Δ;Γ} v2 log v2' : TArrow TUnit TUnit -
{E;Δ;Γ} v3 log v3' : TArrow TUnit TUnit -
{E;Δ;Γ} or v1 (λ: <>, or v2 v3) log or (λ: <>, or v1' v2') v3' : TUnit.
Proof.
iIntros (??) "Hv1 Hv2 Hv3".
unlock or. simpl.
......@@ -304,7 +304,7 @@ Section contents.
Closed {["x"]} e
logrelN E
Γ ⊢ₜ subst "x" v e : τ
{E,E;Δ;Γ} let: "x" := v in e log subst "x" v e : τ.
{E;Δ;Γ} let: "x" := v in e log subst "x" v e : τ.
Proof.
iIntros (?? Hτ).
assert (Closed (Rec BAnon "x" e)).
......@@ -317,7 +317,7 @@ Section contents.
Closed {["x"]} e
logrelN E
Γ ⊢ₜ subst "x" v e : τ
{E,E;Δ;Γ} subst "x" v e log (let: "x" := v in e) : τ.
{E;Δ;Γ} subst "x" v e log (let: "x" := v in e) : τ.
Proof.
iIntros (?? Hτ).
assert (Closed (Rec BAnon "x" e)).
......
......@@ -26,9 +26,9 @@ Section compatibility.
Lemma bin_log_related_par Δ Γ E e1 e2 e1' e2' τ1 τ2 :
logrelN E
{E,E;Δ;Γ} e1 log e1' : TArrow TUnit τ1 -
{E,E;Δ;Γ} e2 log e2' : TArrow TUnit τ2 -
{E,E;Δ;Γ} par e1 e2 log par e1' e2' : TProd τ1 τ2.
{E;Δ;Γ} e1 log e1' : TArrow TUnit τ1 -
{E;Δ;Γ} e2 log e2' : TArrow TUnit τ2 -
{E;Δ;Γ} par e1 e2 log par e1' e2' : TProd τ1 τ2.
Proof.
iIntros (?) "He1 He2".
iApply (bin_log_related_app with "[He1] He2").
......
......@@ -199,8 +199,8 @@ Section refinement.
Definition bot : val := rec: "bot" <> := "bot" #().
Lemma bot_l ϕ Δ Γ E K t τ :
(ϕ - {E,E;Δ;Γ} fill K (bot #()) log t : τ) -
{E,E;Δ;Γ} fill K (bot #()) log t : τ.
(ϕ - {E;Δ;Γ} fill K (bot #()) log t : τ) -
{E;Δ;Γ} fill K (bot #()) log t : τ.
Proof.
iIntros "Hlog".
iLöb as "IH".
......@@ -320,7 +320,7 @@ Section refinement.
Lemma profiled_g `{oneshotG Σ} `{inG Σ (exclR unitR)} γ γ' c1 c2 g1 g2 Δ Γ :
inv shootN (i6 c1 c2 γ γ') -
τg Δ (g1, g2) -
{,;Δ;Γ}
{Δ;Γ}
(FG_increment #c1 #() ;; g1 #())
log
(FG_increment #c2 #() ;; g2 #()) : TUnit.
......@@ -405,7 +405,7 @@ Section refinement.
Lemma profiled_g' `{oneshotG Σ} `{inG Σ (exclR unitR)} γ γ' c1 c2 g1 g2 Δ Γ :
inv shootN (i6 c1 c2 γ γ') -
τg Δ (g1, g2) -
{,;Δ;Γ}
{Δ;Γ}
(λ: <>, FG_increment #c1 #() ;; g1 #())
log
(λ: <>, FG_increment #c2 #() ;; g2 #()) : τg.
......
......@@ -41,7 +41,7 @@ Section masked.
Lemma bin_log_related_var Δ Γ x τ :
Γ !! x = Some τ
{E,E;Δ;Γ} Var x log Var x : τ.
{E;Δ;Γ} Var x log Var x : τ.
Proof.
rewrite bin_log_related_eq.
iIntros (? vvs ρ) "#Hs #HΓ"; iIntros (j K) "Hj".
......@@ -56,25 +56,25 @@ Section masked.
iApply wp_value. eauto.
Qed.
Lemma bin_log_related_unit Δ Γ : {E,E;Δ;Γ} #() log #() : TUnit.
Lemma bin_log_related_unit Δ Γ : {E;Δ;Γ} #() log #() : TUnit.
Proof.
value_case.
Qed.
Lemma bin_log_related_nat Δ Γ (n : nat) : {E,E;Δ;Γ} # n log # n : TNat.
Lemma bin_log_related_nat Δ Γ (n : nat) : {E;Δ;Γ} # n log # n : TNat.
Proof.
value_case.
Qed.
Lemma bin_log_related_bool Δ Γ (b : bool) : {E,E;Δ;Γ} # b log # b : TBool.
Lemma bin_log_related_bool Δ Γ (b : bool) : {E;Δ;Γ} # b log # b : TBool.
Proof.
value_case.
Qed.
Lemma bin_log_related_pair Δ Γ e1 e2 e1' e2' τ1 τ2 :
{E,E;Δ;Γ} e1 log e1' : τ1 -
{E,E;Δ;Γ} e2 log e2' : τ2 -
{E,E;Δ;Γ} Pair e1 e2 log Pair e1' e2' : TProd τ1 τ2.
{E;Δ;Γ} e1 log e1' : τ1 -
{E;Δ;Γ} e2 log e2' : τ2 -
{E;Δ;Γ} Pair e1 e2 log Pair e1' e2' : TProd τ1 τ2.
Proof.
iIntros "IH1 IH2".
rel_bind_ap e1 e1' "IH1" v1 v1' "Hvv1".
......@@ -86,8 +86,8 @@ Section masked.
Lemma bin_log_related_fst Δ Γ e e' τ1 τ2 :
logrelN E
{E,E;Δ;Γ} e log e' : TProd τ1 τ2 -
{E,E;Δ;Γ} Fst e log Fst e' : τ1.
{E;Δ;Γ} e log e' : TProd τ1 τ2 -
{E;Δ;Γ} Fst e log Fst e' : τ1.
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v w "IH".
......@@ -99,8 +99,8 @@ Section masked.
Lemma bin_log_related_snd Δ Γ e e' τ1 τ2 :
logrelN E
{E,E;Δ;Γ} e log e' : TProd τ1 τ2 -
{E,E;Δ;Γ} Snd e log Snd e' : τ2.
{E;Δ;Γ} e log e' : TProd τ1 τ2 -
{E;Δ;Γ} Snd e log Snd e' : τ2.
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v w "IH".
......@@ -111,9 +111,9 @@ Section masked.
Qed.
Lemma bin_log_related_app Δ Γ e1 e2 e1' e2' τ1 τ2 :
{E,E;Δ;Γ} e1 log e1' : TArrow τ1 τ2 -
{E,E;Δ;Γ} e2 log e2' : τ1 -
{E,E;Δ;Γ} App e1 e2 log App e1' e2' : τ2.
{E;Δ;Γ} e1 log e1' : TArrow τ1 τ2 -
{E;Δ;Γ} e2 log e2' : τ1 -
{E;Δ;Γ} App e1 e2 log App e1' e2' : τ2.
Proof.
iIntros "IH1 IH2".
rel_bind_ap e1 e1' "IH1" f f' "Hff".
......@@ -125,8 +125,8 @@ Section masked.
Lemma bin_log_related_rec Δ (Γ : stringmap type) (f x : binder) (e e' : expr) τ1 τ2 :
Closed (x :b: f :b: dom _ Γ) e
Closed (x :b: f :b: dom _ Γ) e'
({E,E;Δ;<[x:=τ1]>(<[f:=TArrow τ1 τ2]>Γ)} e log e' : τ2) -
{E,E;Δ;Γ} Rec f x e log Rec f x e' : TArrow τ1 τ2.
({E;Δ;<[x:=τ1]>(<[f:=TArrow τ1 τ2]>Γ)} e log e' : τ2) -
{E;Δ;Γ} Rec f x e log Rec f x e' : TArrow τ1 τ2.
Proof.
rewrite bin_log_related_eq.
iIntros (??) "#Ht".
......@@ -199,9 +199,9 @@ Section masked.
Lemma bin_log_related_seq Δ Γ e1 e2 e1' e2' τ1 τ2 `{Closed e2} `{Closed e2'} :
logrelN E
{E,E;Δ;Γ} e1 log e1' : τ1 -
{E,E;Δ;Γ} e2 log e2' : τ2 -
{E,E;Δ;Γ} (e1;; e2) log (e1';; e2') : τ2.
{E;Δ;Γ} e1 log e1' : τ1 -
{E;Δ;Γ} e2 log e2' : τ2 -
{E;Δ;Γ} (e1;; e2) log (e1';; e2') : τ2.
Proof.
iIntros (?) "He1 He2".
rel_bind_l e1.
......@@ -215,8 +215,8 @@ Section masked.
Lemma bin_log_related_injl Δ Γ e e' τ1 τ2 :
logrelN E
{E,E;Δ;Γ} e log e' : τ1 -
{E,E;Δ;Γ} InjL e log InjL e' : (TSum τ1 τ2).
{E;Δ;Γ} e log e' : τ1 -
{E;Δ;Γ} InjL e log InjL e' : (TSum τ1 τ2).
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v v' "Hvv".
......@@ -226,8 +226,8 @@ Section masked.
Lemma bin_log_related_injr Δ Γ e e' τ1 τ2 :
logrelN E
{E,E;Δ;Γ} e log e' : τ2 -
{E,E;Δ;Γ} InjR e log InjR e' : TSum τ1 τ2.
{E;Δ;Γ} e log e' : τ2 -
{E;Δ;Γ} InjR e log InjR e' : TSum τ1 τ2.
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v v' "Hvv".
......@@ -237,10 +237,10 @@ Section masked.
Lemma bin_log_related_case Δ Γ e0 e1 e2 e0' e1' e2' τ1 τ2 τ3 :
logrelN E
{E,E;Δ;Γ} e0 log e0' : TSum τ1 τ2 -
{E,E;Δ;Γ} e1 log e1' : TArrow τ1 τ3 -
{E,E;Δ;Γ} e2 log e2' : TArrow τ2 τ3 -
{E,E;Δ;Γ} Case e0 e1 e2 log Case e0' e1' e2' : τ3.
{E;Δ;Γ} e0 log e0' : TSum τ1 τ2 -
{E;Δ;Γ} e1 log e1' : TArrow τ1 τ3 -
{E;Δ;Γ} e2 log e2' : TArrow τ2 τ3 -
{E;Δ;Γ} Case e0 e1 e2 log Case e0' e1' e2' : τ3.
Proof.
iIntros (?) "IH1 IH2 IH3".
rel_bind_ap e0 e0' "IH1" v0 v0' "IH1".
......@@ -255,10 +255,10 @@ Section masked.
Lemma bin_log_related_if Δ Γ e0 e1 e2 e0' e1' e2' τ :
logrelN E
{E,E;Δ;Γ} e0 log e0' : TBool -
{E,E;Δ;Γ} e1 log e1' : τ -
{E,E;Δ;Γ} e2 log e2' : τ -
{E,E;Δ;Γ} If e0 e1 e2 log If e0' e1' e2' : τ.
{E;Δ;Γ} e0 log e0' : TBool -
{E;Δ;Γ} e1 log e1' : τ -
{E;Δ;Γ} e2 log e2' : τ -
{E;Δ;Γ} If e0 e1 e2 log If e0' e1' e2' : τ.
Proof.
iIntros (?) "IH1 IH2 IH3".
rel_bind_ap e0 e0' "IH1" v0 v0' "IH1".
......@@ -269,9 +269,9 @@ Section masked.
Lemma bin_log_related_nat_binop Δ Γ op e1 e2 e1' e2' τ :
logrelN E
binop_nat_res_type op = Some τ
{E,E;Δ;Γ} e1 log e1' : TNat -
{E,E;Δ;Γ} e2 log e2' : TNat -
{E,E;Δ;Γ} BinOp op e1 e2 log BinOp op e1' e2' : τ.
{E;Δ;Γ} e1 log e1' : TNat -
{E;Δ;Γ} e2 log e2' : TNat -
{E;Δ;Γ} BinOp op e1 e2 log BinOp op e1' e2' : τ.
Proof.
iIntros (? Hopτ) "IH1 IH2".
rel_bind_ap e1 e1' "IH1" v1 v1' "IH1".
......@@ -288,9 +288,9 @@ Section masked.
Lemma bin_log_related_bool_binop Δ Γ op e1 e2 e1' e2' τ :
logrelN E
binop_bool_res_type op = Some τ
{E,E;Δ;Γ} e1 log e1' : TBool -
{E,E;Δ;Γ} e2 log e2' : TBool -
{E,E;Δ;Γ} BinOp op e1 e2 log BinOp op e1' e2' : τ.
{E;Δ;Γ} e1 log e1' : TBool -
{E;Δ;Γ} e2 log e2' : TBool -
{E;Δ;Γ} BinOp op e1 e2 log BinOp op e1' e2' : τ.
Proof.
iIntros (? Hopτ) "IH1 IH2".
rel_bind_ap e1 e1' "IH1" v1 v1' "IH1".
......@@ -306,9 +306,9 @@ Section masked.
Lemma bin_log_related_ref_binop Δ Γ e1 e2 e1' e2' τ :
logrelN E
{E,E;Δ;Γ} e1 log e1' : Tref τ -
{E,E;Δ;Γ} e2 log e2' : Tref τ -
{E,E;Δ;Γ} BinOp Eq e1 e2 log BinOp Eq e1' e2' : TBool.
{E;Δ;Γ} e1 log e1' : Tref τ -
{E;Δ;Γ} e2 log e2' : Tref τ -
{E;Δ;Γ} BinOp Eq e1 e2 log BinOp Eq e1' e2' : TBool.
Proof.
iIntros (?) "IH1 IH2".
rel_bind_ap e1 e1' "IH1" v1 v1' "#IH1".
......@@ -338,8 +338,8 @@ Section masked.
Closed (dom _ Γ) e
Closed (dom _ Γ) e'
logrelN E
( (τi : D), ⌜∀ ww, Persistent (τi ww) ({E,E;(τi::Δ);Autosubst_Classes.subst (ren (+1)) <$> Γ} e log e' : τ)) -
{E,E;Δ;Γ} TLam e log TLam e' : TForall τ.
( (τi : D), ⌜∀ ww, Persistent (τi ww) ({E;(τi::Δ);Autosubst_Classes.subst (ren (+1)) <$> Γ} e log e' : τ)) -
{E;Δ;Γ} TLam e log TLam e' : TForall τ.
Proof.
rewrite bin_log_related_eq.
iIntros (???) "#IH".
......@@ -363,8 +363,8 @@ Section masked.
Qed.
Lemma bin_log_related_tapp' Δ Γ e e' τ τ' :
{E,E;Δ;Γ} e log e' : TForall τ -
{E,E;Δ;Γ} TApp e log TApp e' : τ.[τ'/].
{E;Δ;Γ} e log e' : TForall τ -
{E;Δ;Γ} TApp e log TApp e' : τ.[τ'/].
Proof.
iIntros "IH".
rel_bind_ap e e' "IH" v v' "IH".
......@@ -375,8 +375,8 @@ Section masked.
Lemma bin_log_related_tapp (τi : D) Δ Γ e e' τ :
( ww, Persistent (τi ww))
{E,E;Δ;Γ} e log e' : TForall τ -
{E,E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ} TApp e log TApp e' : τ.
{E;Δ;Γ} e log e' : TForall τ -
{E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ} TApp e log TApp e' : τ.
Proof.
rewrite bin_log_related_eq.
iIntros (?) "IH".
......@@ -395,8 +395,8 @@ Section masked.
Qed.
Lemma bin_log_related_fold Δ Γ e e' τ :
{E,E;Δ;Γ} e log e' : τ.[(TRec τ)/] -
{E,E;Δ;Γ} Fold e log Fold e' : TRec τ.
{E;Δ;Γ} e log e' : τ.[(TRec τ)/] -
{E;Δ;Γ} Fold e log Fold e' : TRec τ.
Proof.
iIntros "IH".
rel_bind_ap e e' "IH" v v' "IH".
......@@ -407,8 +407,8 @@ Section masked.
Lemma bin_log_related_unfold Δ Γ e e' τ :
logrelN E
{E,E;Δ;Γ} e log e' : TRec τ -
{E,E;Δ;Γ} Unfold e log Unfold e' : τ.[(TRec τ)/].
{E;Δ;Γ} e log e' : TRec τ -
{E;Δ;Γ} Unfold e log Unfold e' : τ.[(TRec τ)/].
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v v' "IH".
......@@ -421,8 +421,8 @@ Section masked.
Qed.
Lemma bin_log_related_pack' Δ Γ e e' τ τ' :
{E,E;Δ;Γ} e log e' : τ.[τ'/] -
{E,E;Δ;Γ} Pack e log Pack e' : TExists τ.
{E;Δ;Γ} e log e' : τ.[τ'/] -
{E;Δ;Γ} Pack e log Pack e' : TExists τ.
Proof.
iIntros "IH".
rel_bind_ap e e' "IH" v v' "#IH".
......@@ -435,8 +435,8 @@ Section masked.
Lemma bin_log_related_pack (τi : D) Δ Γ e e' τ :
( ww, Persistent (τi ww))
{E,E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ} e log e' : τ -
{E,E;Δ;Γ} Pack e log Pack e' : TExists τ.
{E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ} e log e' : τ -
{E;Δ;Γ} Pack e log Pack e' : TExists τ.
Proof.
rewrite bin_log_related_eq.
iIntros (?) "IH".
......@@ -455,11 +455,11 @@ Section masked.
Lemma bin_log_related_unpack Δ Γ e1 e1' e2 e2' τ τ2
(Hmasked : logrelN E) :
{E,E;Δ;Γ} e1 log e1' : TExists τ -
{E;Δ;Γ} e1 log e1' : TExists τ -
( τi : D, ⌜∀ ww, Persistent (τi ww)
{E,E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ}
{E;τi::Δ;Autosubst_Classes.subst (ren (+1)) <$> Γ}
e2 log e2' : TArrow τ (Autosubst_Classes.subst (ren (+1)) τ2)) -
{E,E;Δ;Γ} Unpack e1 e2 log Unpack e1' e2' : τ2.
{E;Δ;Γ} Unpack e1 e2 log Unpack e1' e2' : τ2.
Proof.
rewrite bin_log_related_eq.
iIntros "IH1 IH2".
......@@ -488,8 +488,8 @@ Section masked.
Lemma bin_log_related_fork Δ Γ e e' :
logrelN E
{E,E;Δ;Γ} e log e' : TUnit -
{E,E;Δ;Γ} Fork e log Fork e' : TUnit.
{E;Δ;Γ} e log e' : TUnit -
{E;Δ;Γ} Fork e log Fork e' : TUnit.
Proof.
rewrite bin_log_related_eq.
iIntros (?) "IH".
......@@ -506,8 +506,8 @@ Section masked.
Lemma bin_log_related_alloc Δ Γ e e' τ :
logrelN E
{E,E;Δ;Γ} e log e' : τ -
{E,E;Δ;Γ} Alloc e log Alloc e' : Tref τ.
{E;Δ;Γ} e log e' : τ -
{E;Δ;Γ} Alloc e log Alloc e' : Tref τ.
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v v' "IH".
......@@ -522,8 +522,8 @@ Section masked.
Lemma bin_log_related_load Δ Γ e e' τ :
logrelN E
{E,E;Δ;Γ} e log e' : (Tref τ) -
{E,E;Δ;Γ} Load e log Load e' : τ.
{E;Δ;Γ} e log e' : (Tref τ) -
{E;Δ;Γ} Load e log Load e' : τ.
Proof.
iIntros (?) "IH".
rel_bind_ap e e' "IH" v v' "IH".
......@@ -540,9 +540,9 @@ Section masked.
Lemma bin_log_related_store Δ Γ e1 e2 e1' e2' τ :
logrelN E
{E,E;Δ;Γ} e1 log e1' : (Tref τ) -
{E,E;Δ;Γ} e2 log e2' : τ -
{E,E;Δ;Γ} Store e1 e2 log Store e1' e2' : TUnit.
{E;Δ;Γ} e1 log e1' : (Tref τ) -