Skip to content
Snippets Groups Projects
Commit 49951a90 authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan
Browse files

WIP.

parent f851a9a0
No related branches found
No related tags found
No related merge requests found
...@@ -173,9 +173,11 @@ Section lft_contexts. ...@@ -173,9 +173,11 @@ Section lft_contexts.
F qL, lftN F elctx_interp E -∗ llctx_interp L qL ={F}=∗ F qL, lftN F elctx_interp E -∗ llctx_interp L qL ={F}=∗
q', q'.[κ] (q'.[κ] ={F}=∗ llctx_interp L qL). q', q'.[κ] (q'.[κ] ={F}=∗ llctx_interp L qL).
Lemma lctx_lft_alive_tok κ : Lemma lctx_lft_alive_tok κ F q :
lctx_lft_alive κ lctx_lft_alive κ. lftN F
Proof. done. Qed. lctx_lft_alive κ elctx_interp E -∗ llctx_interp L q ={F}=∗
q', q'.[κ] llctx_interp L (q / 2) (q'.[κ] ={F}=∗ llctx_interp L (q / 2)).
Proof. iIntros (? Hal) "#HE [$ HL]". by iApply Hal. Qed.
Lemma lctx_lft_alive_static : lctx_lft_alive static. Lemma lctx_lft_alive_static : lctx_lft_alive static.
Proof. Proof.
......
...@@ -76,19 +76,19 @@ Section ref. ...@@ -76,19 +76,19 @@ Section ref.
Global Instance ref_mono E L : Global Instance ref_mono E L :
Proper (flip (lctx_lft_incl E L) ==> subtype E L ==> subtype E L) ref. Proper (flip (lctx_lft_incl E L) ==> subtype E L ==> subtype E L) ref.
Proof. Proof.
iIntros (α1 α2 ty1 ty2 Hty) "#HE #HL". iIntros (α1 α2 ty1 ty2 Hty q) "HL".
iDestruct (Hty with "HE HL") as "(%&#Ho&#Hs)". iDestruct (Hty with "HL") as "#Hty". iDestruct ( with "HL") as "#Hα".
iDestruct ( with "HE HL") as "Hα1α2". iIntros "!# #HE". iDestruct ("" with "HE") as "Hα1α2".
iSplit; [|iSplit; iAlways]. iDestruct ("Hty" with "HE") as "(%&#Ho&#Hs)". iSplit; [|iSplit; iAlways].
- done. - done.
- iIntros (tid [|[[]|][|[[]|][]]]) "H"; try done. - iIntros (tid [|[[]|][|[[]|][]]]) "H"; try done.
iDestruct "H" as (ν q γ β ty') "(#Hshr & #H⊑ & #Hinv & Htok & Hown)". iDestruct "H" as (ν q' γ β ty') "(#Hshr & #H⊑ & #Hinv & Htok & Hown)".
iExists ν, q, γ, β, ty'. iFrame "∗#". iSplit. iExists ν, q', γ, β, ty'. iFrame "∗#". iSplit.
+ iApply ty_shr_mono; last by iApply "Hs". + iApply ty_shr_mono; last by iApply "Hs".
iApply lft_intersect_mono. done. iApply lft_incl_refl. iApply lft_intersect_mono. done. iApply lft_incl_refl.
+ by iApply lft_incl_trans. + by iApply lft_incl_trans.
- iIntros (κ tid l) "H". iDestruct "H" as (ν q γ β ty' lv lrc) "H". - iIntros (κ tid l) "H". iDestruct "H" as (ν q' γ β ty' lv lrc) "H".
iExists ν, q, γ, β, ty', lv, lrc. iDestruct "H" as "#($&$&?&?&$&$)". iSplit. iExists ν, q', γ, β, ty', lv, lrc. iDestruct "H" as "#($&$&?&?&$&$)". iSplit.
+ iApply ty_shr_mono; last by iApply "Hs". + iApply ty_shr_mono; last by iApply "Hs".
iApply lft_intersect_mono. done. iApply lft_incl_refl. iApply lft_intersect_mono. done. iApply lft_incl_refl.
+ by iApply lft_incl_trans. + by iApply lft_incl_trans.
......
...@@ -56,17 +56,23 @@ Section ref_functions. ...@@ -56,17 +56,23 @@ Section ref_functions.
See: https://coq.inria.fr/bugs/show_bug.cgi?id=5326 *) See: https://coq.inria.fr/bugs/show_bug.cgi?id=5326 *)
Lemma ref_clone_type ty : Lemma ref_clone_type ty :
typed_val ref_clone typed_val ref_clone
(fn (fun '(α, β) => FP [α; β]%EL [# &shr{α}(ref β ty)]%T (ref β ty)%T)). (fn (fun '(α, β) => FP (λ ϝ, [ϝ α; α β]%EL)
[# &shr{α}(ref β ty)]%T (ref β ty)%T)).
Proof. Proof.
intros. iApply type_fn; [solve_typing..|]. iIntros "/= !#". intros. iApply type_fn; [solve_typing..|]. iIntros "/= !#".
iIntros ([α β] ret arg). inv_vec arg=>x. simpl_subst. iIntros ([α β] ϝ ret arg). inv_vec arg=>x. simpl_subst.
iApply type_deref; [solve_typing..|]. iIntros (x'). iApply type_deref; [solve_typing..|]. iIntros (x').
iIntros (tid qE) "#LFT Hna HE HL Hk HT". simpl_subst.
Typeclasses Opaque llctx_interp.
iIntros (tid) "#LFT HE Hna [HL1 HL2] Hk HT".
simpl_subst.
rewrite tctx_interp_cons tctx_interp_singleton !tctx_hasty_val. rewrite tctx_interp_cons tctx_interp_singleton !tctx_hasty_val.
iDestruct "HT" as "[Hx Hx']". destruct x' as [[|lx'|]|]; try done. iDestruct "HT" as "[Hx Hx']". destruct x' as [[|lx'|]|]; try done.
iDestruct "Hx'" as (ν q γ δ ty' lv lrc) "#(Hαν & Hfrac & Hshr & Hβδ & Hinv & H◯inv)". iDestruct "Hx'" as (ν q γ δ ty' lv lrc) "#(Hαν & Hfrac & Hshr & Hβδ & Hinv & H◯inv)".
wp_op. rewrite {1}/elctx_interp big_sepL_cons big_sepL_singleton. wp_op.
iDestruct "HE" as "[[Hα1 Hα2] Hβ]". iMod (lctx_lft_alive_tok _ _ β with "HE HL") as (q') "[Hβ Hclose1]"; [solve_typing..|].
iMod (lft_incl_acc with "Hβδ Hβ") as () "[Hδ Hcloseβ]". done. iMod (lft_incl_acc with "Hβδ Hβ") as () "[Hδ Hcloseβ]". done.
iMod (frac_bor_acc with "LFT Hfrac Hα1") as (qlx') "[H↦ Hcloseα1]". done. iMod (frac_bor_acc with "LFT Hfrac Hα1") as (qlx') "[H↦ Hcloseα1]". done.
iMod (na_bor_acc with "LFT Hinv Hδ Hna") as "(INV & Hna & Hcloseδ)"; [done..|]. iMod (na_bor_acc with "LFT Hinv Hδ Hna") as "(INV & Hna & Hcloseδ)"; [done..|].
......
...@@ -80,11 +80,10 @@ Section refmut. ...@@ -80,11 +80,10 @@ Section refmut.
Global Instance refmut_mono E L : Global Instance refmut_mono E L :
Proper (flip (lctx_lft_incl E L) ==> eqtype E L ==> subtype E L) refmut. Proper (flip (lctx_lft_incl E L) ==> eqtype E L ==> subtype E L) refmut.
Proof. Proof.
iIntros (α1 α2 ty1 ty2 Hty) "#HE #HL". intros α1 α2 ty1 ty2. rewrite eqtype_unfold=>Hty. iIntros (q) "HL".
pose proof Hty as Hty'%eqtype_unfold. iDestruct (Hty with "HL") as "#Hty". iDestruct ( with "HL") as "#Hα".
iDestruct (Hty' with "HE HL") as "(%&#Ho&#Hs)". iIntros "!# #HE". iDestruct ("Hα" with "HE") as "Hα1α2".
iDestruct ( with "HE HL") as "Hα1α2". iDestruct ("Hty" with "HE") as "(%&#Ho&#Hs)". iSplit; [|iSplit; iAlways].
iSplit; [|iSplit; iAlways].
- done. - done.
- iIntros (tid [|[[]|][|[[]|][]]]) "H"; try done. - iIntros (tid [|[[]|][|[[]|][]]]) "H"; try done.
iDestruct "H" as (ν γ β ty') "(Hb & #H⊑ & #Hinv & Hν & Hown)". iDestruct "H" as (ν γ β ty') "(Hb & #H⊑ & #Hinv & Hν & Hown)".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment