Skip to content

Commit e7b380b

Browse files
committed
More theory for auth_prop
1 parent 9b181e7 commit e7b380b

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

new/proof/github_com/goose_lang/goose/testdata/examples/channel_search_replace.v

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ Definition own_aprop_frag γ (P : iProp Σ) (n : nat) : iProp Σ :=
3434
#[global] Opaque own_aprop_frag.
3535
#[local] Transparent own_aprop_frag.
3636

37-
Definition own_aprop γ (P : iProp Σ) : iProp Σ := own_aprop_frag γ P 1.
38-
#[global] Opaque own_aprop.
39-
#[local] Transparent own_aprop.
37+
Notation own_aprop γ P := (own_aprop_frag γ P 1).
4038

4139
Lemma own_aprop_auth_alloc :
4240
⊢ |==> ∃ γ, own_aprop_auth γ True 0.
@@ -91,10 +89,26 @@ Proof.
9189
- iIntros "HP'". iApply "HimpliesP'" in "HP'". iApply "HimpliesP" in "HP'". iFrame.
9290
Qed.
9391

94-
Lemma own_aprop_frag_combine γ P P' n n' :
95-
⊢ own_aprop_frag γ P n -∗ own_aprop_frag γ P' n' -∗ own_aprop_frag γ (P ∗ P') (n + n').
92+
#[global] Instance own_aprop_auth_le γ P P' n n' :
93+
CombineSepGives (own_aprop_auth γ P n) (own_aprop_frag γ P' n') (⌜ n' ≤ n ⌝)%I.
9694
Proof.
97-
iNamed 1. iNamedSuffix 1 "'". rename gns0 into gns'.
95+
rewrite /CombineSepGives. iIntros "[@ H]". iNamedSuffix "H" "'".
96+
iDestruct (ghost_map_lookup_big with "Hgns [Hgns']") as "%Hsub".
97+
{ instantiate (1:=gset_to_gmap () gns0). rewrite big_sepM_gset_to_gmap. iFrame. }
98+
apply subseteq_dom in Hsub. rewrite !dom_gset_to_gmap in Hsub.
99+
iModIntro. iPureIntro. apply subseteq_size in Hsub. lia.
100+
Qed.
101+
102+
#[global] Instance own_aprop_auth_le' γ P P' n n' :
103+
CombineSepGives (own_aprop_frag γ P' n') (own_aprop_auth γ P n) (⌜ n' ≤ n ⌝)%I.
104+
Proof.
105+
rewrite /CombineSepGives. iIntros "[H H']". iCombine "H' H" gives %H. iModIntro. done.
106+
Qed.
107+
108+
#[global] Instance own_aprop_frag_combine γ P P' n n' :
109+
CombineSepAs (own_aprop_frag γ P n) (own_aprop_frag γ P' n') (own_aprop_frag γ (P ∗ P') (n + n')).
110+
Proof.
111+
rewrite /CombineSepAs. iIntros "[@ H]". iNamedSuffix "H" "'". rename gns0 into gns'.
98112
destruct (decide (gns ∩ gns' = ∅)) as [Hdisj|Hbad].
99113
2:{
100114
apply set_choose_L in Hbad. destruct Hbad as [γprop Hbad].
@@ -113,6 +127,7 @@ Proof.
113127
Qed.
114128

115129
End auth_prop.
130+
#[global] Notation own_aprop γ P := (own_aprop_frag γ P 1).
116131

117132
Section waitgroup_idiom.
118133
Context `{hG: heapGS Σ, !ffi_semantics _ _}.
@@ -220,7 +235,7 @@ Proof.
220235
iInv "Hinv" as "Hi" "Hclose".
221236
iApply fupd_mask_intro; [solve_ndisj|]. iIntros "Hmask". iNext.
222237
iNamedSuffix "Hi" "_inv". iExists _; iFrame.
223-
FIXME: lemma for this:
238+
Set Typeclasses Debug.
224239
iCombine "Hdone_prop_inv Haprop" gives %Hle.
225240
Qed.
226241

0 commit comments

Comments
 (0)