Skip to content
Snippets Groups Projects
Commit 97f90263 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Make use of better `iMod` for updates.

parent f086d04b
No related branches found
No related tags found
No related merge requests found
...@@ -114,14 +114,11 @@ Section proofs. ...@@ -114,14 +114,11 @@ Section proofs.
P cinv_own γ p ( E' : coPset, P cinv_own γ 1 ={E',N E'}=∗ True)). P cinv_own γ p ( E' : coPset, P cinv_own γ 1 ={E',N E'}=∗ True)).
Proof. Proof.
iIntros (?) "Hinv Hown". iIntros (?) "Hinv Hown".
iPoseProof (inv_acc ( N) N with "Hinv") as "H"; first done. iMod (inv_acc ( N) N with "Hinv") as "[[$ | >Hown'] H]"; first done.
rewrite difference_diag_L. - iApply fupd_intro_mask_eq; [set_solver|].
iPoseProof (fupd_mask_frame_r _ _ (E N) with "H") as "H"; first set_solver. iIntros "{$Hown}" (E') "HP".
rewrite left_id_L -union_difference_L //. iMod "H" as "[[$ | >Hown'] H]". iMod ("H" with "[HP]") as "_"; [by iModIntro|set_solver|..].
- iIntros "{$Hown} !>" (E') "HP". by iApply fupd_intro_mask_eq; [set_solver|].
iPoseProof (fupd_mask_frame_r _ _ E' with "(H [HP])") as "H"; first set_solver.
{ iDestruct "HP" as "[?|?]"; eauto. }
by rewrite left_id_L.
- iDestruct (cinv_own_1_l with "Hown' Hown") as %[]. - iDestruct (cinv_own_1_l with "Hown' Hown") as %[].
Qed. Qed.
...@@ -131,9 +128,8 @@ Section proofs. ...@@ -131,9 +128,8 @@ Section proofs.
Proof. Proof.
iIntros (?) "#Hinv Hγ". iIntros (?) "#Hinv Hγ".
iMod (cinv_acc_strong with "Hinv Hγ") as "($ & $ & H)"; first done. iMod (cinv_acc_strong with "Hinv Hγ") as "($ & $ & H)"; first done.
iIntros "!> HP". iIntros "!> HP". iMod ("H" with "[$HP]") as "_".
rewrite {2}(union_difference_L (N) E)=> //. by rewrite -union_difference_L.
iApply "H". by iLeft.
Qed. Qed.
(*** Other *) (*** Other *)
...@@ -141,8 +137,8 @@ Section proofs. ...@@ -141,8 +137,8 @@ Section proofs.
Proof. Proof.
iIntros (?) "#Hinv Hγ". iIntros (?) "#Hinv Hγ".
iMod (cinv_acc_strong with "Hinv Hγ") as "($ & Hγ & H)"; first done. iMod (cinv_acc_strong with "Hinv Hγ") as "($ & Hγ & H)"; first done.
rewrite {2}(union_difference_L (N) E)=> //. iMod ("H" with "[$Hγ]") as "_".
iApply "H". by iRight. by rewrite -union_difference_L.
Qed. Qed.
Global Instance into_inv_cinv N γ P : IntoInv (cinv N γ P) N := {}. Global Instance into_inv_cinv N γ P : IntoInv (cinv N γ P) N := {}.
......
...@@ -65,7 +65,7 @@ Lemma fupd_plain_soundness `{!invPreG Σ} E1 E2 (P: iProp Σ) `{!Plain P} : ...@@ -65,7 +65,7 @@ Lemma fupd_plain_soundness `{!invPreG Σ} E1 E2 (P: iProp Σ) `{!Plain P} :
Proof. Proof.
iIntros (Hfupd). apply later_soundness. iMod wsat_alloc as (Hinv) "[Hw HE]". iIntros (Hfupd). apply later_soundness. iMod wsat_alloc as (Hinv) "[Hw HE]".
iAssert (|={,E2}=> P)%I as "H". iAssert (|={,E2}=> P)%I as "H".
{ iMod fupd_intro_mask'; last iApply Hfupd. done. } { iMod Hfupd as "$". iApply fupd_intro_mask_subseteq; [set_solver|]; auto. }
rewrite uPred_fupd_eq /uPred_fupd_def. rewrite uPred_fupd_eq /uPred_fupd_def.
iMod ("H" with "[$]") as "[Hw [HE >H']]"; iFrame. iMod ("H" with "[$]") as "[Hw [HE >H']]"; iFrame.
Qed. Qed.
......
...@@ -140,8 +140,8 @@ Section inv. ...@@ -140,8 +140,8 @@ Section inv.
rewrite inv_eq. iIntros (??) "#HinvP #HinvQ !>"; iIntros (E ?). rewrite inv_eq. iIntros (??) "#HinvP #HinvQ !>"; iIntros (E ?).
iMod ("HinvP" with "[%]") as "[$ HcloseP]"; first set_solver. iMod ("HinvP" with "[%]") as "[$ HcloseP]"; first set_solver.
iMod ("HinvQ" with "[%]") as "[$ HcloseQ]"; first set_solver. iMod ("HinvQ" with "[%]") as "[$ HcloseQ]"; first set_solver.
iMod (fupd_intro_mask' _ (E N)) as "Hclose"; first set_solver. iApply fupd_mask_subseteq; first set_solver.
iIntros "!> [HP HQ]". iIntros "Hclose !> [HP HQ]".
iMod "Hclose" as %_. iMod ("HcloseQ" with "HQ") as %_. by iApply "HcloseP". iMod "Hclose" as %_. iMod ("HcloseQ" with "HQ") as %_. by iApply "HcloseP".
Qed. Qed.
...@@ -174,13 +174,10 @@ Section inv. ...@@ -174,13 +174,10 @@ Section inv.
N E inv N P ={E,E∖↑N}=∗ P E', P ={E',N E'}=∗ True. N E inv N P ={E,E∖↑N}=∗ P E', P ={E',N E'}=∗ True.
Proof. Proof.
iIntros (?) "Hinv". iIntros (?) "Hinv".
iPoseProof (inv_acc ( N) N with "Hinv") as "H"; first done. iMod (inv_acc ( N) N with "Hinv") as "[$ H]"; first done.
rewrite difference_diag_L. iApply fupd_intro_mask_eq; [set_solver|].
iPoseProof (fupd_mask_frame_r _ _ (E N) with "H") as "H"; first set_solver. iIntros (E') "HP". iMod ("H" with "HP") as "_"; [set_solver|].
rewrite left_id_L -union_difference_L //. iMod "H" as "[$ H]"; iModIntro. by iApply fupd_intro_mask_eq; first set_solver.
iIntros (E') "HP".
iPoseProof (fupd_mask_frame_r _ _ E' with "(H HP)") as "H"; first set_solver.
by rewrite left_id_L.
Qed. Qed.
Lemma inv_acc_timeless E N P `{!Timeless P} : Lemma inv_acc_timeless E N P `{!Timeless P} :
......
...@@ -311,7 +311,7 @@ Section lemmas. ...@@ -311,7 +311,7 @@ Section lemmas.
atomic_acc Eo Ei α P β Φ). atomic_acc Eo Ei α P β Φ).
Proof. Proof.
iIntros (? x) "Hα Hclose". iIntros (? x) "Hα Hclose".
iMod fupd_intro_mask' as "Hclose'"; last iModIntro; first set_solver. iApply fupd_intro_mask_subseteq; [done|]; iIntros "Hclose'".
iExists x. iFrame. iSplitWith "Hclose". iExists x. iFrame. iSplitWith "Hclose".
- iIntros "Hα". iMod "Hclose'" as "_". iApply "Hclose". done. - iIntros "Hα". iMod "Hclose'" as "_". iApply "Hclose". done.
- iIntros (y) "Hβ". iMod "Hclose'" as "_". iApply "Hclose". done. - iIntros (y) "Hβ". iMod "Hclose'" as "_". iApply "Hclose". done.
...@@ -331,7 +331,7 @@ Section lemmas. ...@@ -331,7 +331,7 @@ Section lemmas.
to happen only if one argument is a constructor. *) to happen only if one argument is a constructor. *)
iIntros "Hinner >Hacc". iDestruct "Hacc" as (x') "[Hα' Hclose]". iIntros "Hinner >Hacc". iDestruct "Hacc" as (x') "[Hα' Hclose]".
iMod ("Hinner" with "Hα'") as (x) "[Hα Hclose']". iMod ("Hinner" with "Hα'") as (x) "[Hα Hclose']".
iMod (fupd_intro_mask') as "Hclose''"; last iModIntro; first done. iApply fupd_intro_mask_subseteq; [done|]; iIntros "Hclose''".
iExists x. iFrame. iSplitWith "Hclose'". iExists x. iFrame. iSplitWith "Hclose'".
- iIntros "Hα". iMod "Hclose''" as "_". - iIntros "Hα". iMod "Hclose''" as "_".
iMod ("Hclose'" with "Hα") as "[Hβ' HPas]". iMod ("Hclose'" with "Hα") as "[Hβ' HPas]".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment