Skip to content
Snippets Groups Projects
Commit 5fcb7654 authored by Jonas Kastberg's avatar Jonas Kastberg
Browse files

Merge branch 'multiparty_synchronous_simple_inv' into 'multiparty_synchronous'

Simplified invariant

See merge request !36
parents 4ca1240f 3cfa1678
No related branches found
No related tags found
2 merge requests!39Multiparty synchronous,!36Simplified invariant
...@@ -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))).
...@@ -364,7 +363,7 @@ Section channel. ...@@ -364,7 +363,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)".
...@@ -375,8 +374,8 @@ Section channel. ...@@ -375,8 +374,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".
...@@ -387,10 +386,10 @@ Section channel. ...@@ -387,10 +386,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.
...@@ -461,12 +460,13 @@ Section channel. ...@@ -461,12 +460,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.
......
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