Skip to content
Snippets Groups Projects

Simplified invariant

Merged Jonas Kastberg requested to merge multiparty_synchronous_simple_inv into multiparty_synchronous
1 file
+ 10
10
Compare changes
  • Side-by-side
  • Inline
@@ -93,9 +93,8 @@ Definition tok `{!chanG Σ} (γ : gname) : iProp Σ := own γ (Excl ()).
@@ -93,9 +93,8 @@ Definition tok `{!chanG Σ} (γ : gname) : iProp Σ := own γ (Excl ()).
Definition chan_inv `{!heapGS Σ, !chanG Σ} γ γE γt i j (l:loc) : iProp Σ :=
Definition chan_inv `{!heapGS Σ, !chanG Σ} γ γE γt i j (l:loc) : iProp Σ :=
(l NONEV tok γt)%I
(l NONEV tok γt)%I
( v m p, l SOMEV v
( v p, l SOMEV v
iProto_own γ i (<(Send, j)> m)%proto
iProto_own γ i (<(Send, j)> MSG v ; p)%proto own γE (E (Next p)))
iMsg_car m v (Next p) own γE (E (Next p)))
( p, l NONEV
( p, l NONEV
iProto_own γ i p own γE (E (Next p))).
iProto_own γ i p own γE (E (Next p))).
@@ -372,7 +371,7 @@ Section channel.
@@ -372,7 +371,7 @@ Section channel.
iInv "IHl1" as "HIp".
iInv "IHl1" as "HIp".
iDestruct "HIp" as "[HIp|HIp]"; last first.
iDestruct "HIp" as "[HIp|HIp]"; last first.
{ iDestruct "HIp" as "[HIp|HIp]".
{ iDestruct "HIp" as "[HIp|HIp]".
- iDestruct "HIp" as (? m p'') "(>Hl & Hown' & HIp)".
- iDestruct "HIp" as (? p'') "(>Hl & Hown' & HIp)".
wp_store.
wp_store.
iDestruct (iProto_own_excl with "Hown Hown'") as %[].
iDestruct (iProto_own_excl with "Hown Hown'") as %[].
- iDestruct "HIp" as (p'') "(>Hl' & Hown' & HIp)".
- iDestruct "HIp" as (p'') "(>Hl' & Hown' & HIp)".
@@ -383,8 +382,8 @@ Section channel.
@@ -383,8 +382,8 @@ Section channel.
iMod (own_update_2 with "H● H◯") as "[H● H◯]"; [by apply excl_auth_update|].
iMod (own_update_2 with "H● H◯") as "[H● H◯]"; [by apply excl_auth_update|].
iModIntro.
iModIntro.
iSplitL "Hl' H● Hown Hle".
iSplitL "Hl' H● Hown Hle".
{ iRight. iLeft. iIntros "!>". iExists _, _, _. iFrame.
{ iRight. iLeft. iIntros "!>". iExists _, _. iFrame.
iSplitL "Hown Hle"; [by iApply (iProto_own_le with "Hown Hle")|].
iDestruct (iProto_own_le with "Hown Hle") as "Hown".
by rewrite iMsg_base_eq. }
by rewrite iMsg_base_eq. }
wp_pures.
wp_pures.
iLöb as "HL".
iLöb as "HL".
@@ -395,10 +394,10 @@ Section channel.
@@ -395,10 +394,10 @@ Section channel.
{ iDestruct "HIp" as ">[Hl' Htok']".
{ iDestruct "HIp" as ">[Hl' Htok']".
iDestruct (own_valid_2 with "Htok Htok'") as %[]. }
iDestruct (own_valid_2 with "Htok Htok'") as %[]. }
iDestruct "HIp" as "[HIp|HIp]".
iDestruct "HIp" as "[HIp|HIp]".
- iDestruct "HIp" as (? m p'') "(>Hl' & Hown & HIp)".
- iDestruct "HIp" as (? p'') "(>Hl' & Hown & HIp)".
wp_load. iModIntro.
wp_load. iModIntro.
iSplitL "Hl' Hown HIp".
iSplitL "Hl' Hown HIp".
{ iRight. iLeft. iExists _, _,_. iFrame. }
{ iRight. iLeft. iExists _,_. iFrame. }
wp_pures. iApply ("HL" with "HΦ Htok H◯").
wp_pures. iApply ("HL" with "HΦ Htok H◯").
- iDestruct "HIp" as (p'') "(>Hl' & Hown & H●)".
- iDestruct "HIp" as (p'') "(>Hl' & Hown & H●)".
wp_load.
wp_load.
@@ -476,12 +475,13 @@ Section channel.
@@ -476,12 +475,13 @@ Section channel.
{ iRight. iRight. iExists _. iFrame. }
{ iRight. iRight. iExists _. iFrame. }
wp_pures. iApply ("HL" with "[H● H◯ Hown Hle] HΦ").
wp_pures. iApply ("HL" with "[H● H◯ Hown Hle] HΦ").
iExists _, _, _, _, _, _. iSplit; [done|]. iFrame "#∗". }
iExists _, _, _, _, _, _. iSplit; [done|]. iFrame "#∗". }
iDestruct "HIp" as (w m p'') "(>Hl' & Hown' & Hm & Hp')".
iDestruct "HIp" as (w p'') "(>Hl' & Hown' & Hp')".
iInv "IH" as "Hctx".
iInv "IH" as "Hctx".
wp_xchg.
wp_xchg.
iDestruct (iProto_own_le with "Hown Hle") as "Hown".
iDestruct (iProto_own_le with "Hown Hle") as "Hown".
iMod (iProto_step with "Hctx Hown' Hown Hm") as
iMod (iProto_step with "Hctx Hown' Hown []") as
(p''') "(Hm & Hctx & Hown & Hown')".
(p''') "(Hm & Hctx & Hown & Hown')".
 
{ by rewrite iMsg_base_eq. }
iModIntro.
iModIntro.
iSplitL "Hctx"; [done|].
iSplitL "Hctx"; [done|].
iModIntro.
iModIntro.
Loading