Library zoo.iris.base_logic.lib.auth_gmultiset
Require Import iris.algebra.gmultiset.
Require Import zoo.prelude.
Require Import zoo.iris.algebra.auth.
Require Export zoo.iris.base_logic.lib.base.
Require Import zoo.iris.diaframe.
Require Import zoo.options.
Class AuthGmultisetG Σ A `{Countable A} :=
{ #[local] auth_gmultiset۰G۰inG :: inG Σ (authR (gmultisetUR A))
}.
Definition auth_gmultiset۰Σ A `{Countable A} :=
#[GFunctor (authR (gmultisetUR A))
].
#[global] Instance subGーauth_gmultiset۰Σ Σ A `{Countable A} :
subG (auth_gmultiset۰Σ A) Σ →
AuthGmultisetG Σ A.
Section auth_gmultiset۰G.
Context `{auth_gmultiset۰G : AuthGmultisetG Σ A}.
Implicit Type x y : gmultiset A.
Definition auth_gmultiset۰auth γ dq x :=
own γ (●{dq} x).
Definition auth_gmultiset۰frag γ y :=
own γ (◯ y).
#[global] Instance auth_gmultiset۰authーproper γ dq :
Proper ((≡) ==> (≡)) (auth_gmultiset۰auth γ dq).
#[global] Instance auth_gmultiset۰fragーproper γ :
Proper ((≡) ==> (≡)) (auth_gmultiset۰frag γ).
#[global] Instance auth_gmultiset۰authーtimeless γ dq x :
Timeless (auth_gmultiset۰auth γ dq x).
#[global] Instance auth_gmultiset۰fragーtimeless γ y :
Timeless (auth_gmultiset۰frag γ y).
#[global] Instance auth_gmultiset۰authーpersistent γ x :
Persistent (auth_gmultiset۰auth γ DfracDiscarded x).
#[global] Instance auth_gmultiset۰authーfractional γ x :
Fractional (λ q, auth_gmultiset۰auth γ (DfracOwn q) x).
#[global] Instance auth_gmultiset۰authーas_fractional γ q x :
AsFractional (auth_gmultiset۰auth γ (DfracOwn q) x) (λ q, auth_gmultiset۰auth γ (DfracOwn q) x) q.
Lemma auth_gmultisetーalloc :
⊢ |==>
∃ γ,
auth_gmultiset۰auth γ (DfracOwn 1) ∅.
Lemma auth_gmultiset۰authーvalid γ dq x :
auth_gmultiset۰auth γ dq x ⊢
⌜✓ dq⌝.
Lemma auth_gmultiset۰authーcombine γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜x1 = x2⌝ ∗
auth_gmultiset۰auth γ (dq1 ⋅ dq2) x1.
Lemma auth_gmultiset۰authーvalidー2 γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜✓ (dq1 ⋅ dq2)⌝ ∗
⌜x1 = x2⌝.
Lemma auth_gmultiset۰authーagree γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜x1 = x2⌝.
Lemma auth_gmultiset۰authーdfracーne γ1 dq1 x1 γ2 dq2 x2 :
¬ ✓ (dq1 ⋅ dq2) →
auth_gmultiset۰auth γ1 dq1 x1 -∗
auth_gmultiset۰auth γ2 dq2 x2 -∗
⌜γ1 ≠ γ2⌝.
Lemma auth_gmultiset۰authーne γ1 x1 γ2 dq2 x2 :
auth_gmultiset۰auth γ1 (DfracOwn 1) x1 -∗
auth_gmultiset۰auth γ2 dq2 x2 -∗
⌜γ1 ≠ γ2⌝.
Lemma auth_gmultiset۰authーexclusive γ x1 dq2 x2 :
auth_gmultiset۰auth γ (DfracOwn 1) x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
False.
Lemma auth_gmultiset۰authーpersist γ dq x :
auth_gmultiset۰auth γ dq x ⊢ |==>
auth_gmultiset۰auth γ DfracDiscarded x.
Lemma auth_gmultiset۰fragーcombine γ y1 y2 :
auth_gmultiset۰frag γ y1 -∗
auth_gmultiset۰frag γ y2 -∗
auth_gmultiset۰frag γ (y1 ⊎ y2).
Lemma auth_gmultisetーsubseteq γ dq x y :
auth_gmultiset۰auth γ dq x -∗
auth_gmultiset۰frag γ y -∗
⌜y ⊆ x⌝.
Lemma auth_gmultisetーelem_of γ dq x b :
auth_gmultiset۰auth γ dq x -∗
auth_gmultiset۰frag γ {[+b+]} -∗
⌜b ∈ x⌝.
Lemma auth_gmultisetーupdateーalloc {γ x} y :
auth_gmultiset۰auth γ (DfracOwn 1) x ⊢ |==>
auth_gmultiset۰auth γ (DfracOwn 1) (y ⊎ x) ∗
auth_gmultiset۰frag γ y.
Lemma auth_gmultisetーupdateーallocーsingleton {γ x} a :
auth_gmultiset۰auth γ (DfracOwn 1) x ⊢ |==>
auth_gmultiset۰auth γ (DfracOwn 1) ({[+a+]} ⊎ x) ∗
auth_gmultiset۰frag γ {[+a+]}.
Lemma auth_gmultisetーupdateーdealloc {γ x} y :
auth_gmultiset۰auth γ (DfracOwn 1) x -∗
auth_gmultiset۰frag γ y ==∗
auth_gmultiset۰auth γ (DfracOwn 1) (x ∖ y).
End auth_gmultiset۰G.
#[global] Opaque auth_gmultiset۰auth.
#[global] Opaque auth_gmultiset۰frag.
Require Import zoo.prelude.
Require Import zoo.iris.algebra.auth.
Require Export zoo.iris.base_logic.lib.base.
Require Import zoo.iris.diaframe.
Require Import zoo.options.
Class AuthGmultisetG Σ A `{Countable A} :=
{ #[local] auth_gmultiset۰G۰inG :: inG Σ (authR (gmultisetUR A))
}.
Definition auth_gmultiset۰Σ A `{Countable A} :=
#[GFunctor (authR (gmultisetUR A))
].
#[global] Instance subGーauth_gmultiset۰Σ Σ A `{Countable A} :
subG (auth_gmultiset۰Σ A) Σ →
AuthGmultisetG Σ A.
Section auth_gmultiset۰G.
Context `{auth_gmultiset۰G : AuthGmultisetG Σ A}.
Implicit Type x y : gmultiset A.
Definition auth_gmultiset۰auth γ dq x :=
own γ (●{dq} x).
Definition auth_gmultiset۰frag γ y :=
own γ (◯ y).
#[global] Instance auth_gmultiset۰authーproper γ dq :
Proper ((≡) ==> (≡)) (auth_gmultiset۰auth γ dq).
#[global] Instance auth_gmultiset۰fragーproper γ :
Proper ((≡) ==> (≡)) (auth_gmultiset۰frag γ).
#[global] Instance auth_gmultiset۰authーtimeless γ dq x :
Timeless (auth_gmultiset۰auth γ dq x).
#[global] Instance auth_gmultiset۰fragーtimeless γ y :
Timeless (auth_gmultiset۰frag γ y).
#[global] Instance auth_gmultiset۰authーpersistent γ x :
Persistent (auth_gmultiset۰auth γ DfracDiscarded x).
#[global] Instance auth_gmultiset۰authーfractional γ x :
Fractional (λ q, auth_gmultiset۰auth γ (DfracOwn q) x).
#[global] Instance auth_gmultiset۰authーas_fractional γ q x :
AsFractional (auth_gmultiset۰auth γ (DfracOwn q) x) (λ q, auth_gmultiset۰auth γ (DfracOwn q) x) q.
Lemma auth_gmultisetーalloc :
⊢ |==>
∃ γ,
auth_gmultiset۰auth γ (DfracOwn 1) ∅.
Lemma auth_gmultiset۰authーvalid γ dq x :
auth_gmultiset۰auth γ dq x ⊢
⌜✓ dq⌝.
Lemma auth_gmultiset۰authーcombine γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜x1 = x2⌝ ∗
auth_gmultiset۰auth γ (dq1 ⋅ dq2) x1.
Lemma auth_gmultiset۰authーvalidー2 γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜✓ (dq1 ⋅ dq2)⌝ ∗
⌜x1 = x2⌝.
Lemma auth_gmultiset۰authーagree γ dq1 x1 dq2 x2 :
auth_gmultiset۰auth γ dq1 x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
⌜x1 = x2⌝.
Lemma auth_gmultiset۰authーdfracーne γ1 dq1 x1 γ2 dq2 x2 :
¬ ✓ (dq1 ⋅ dq2) →
auth_gmultiset۰auth γ1 dq1 x1 -∗
auth_gmultiset۰auth γ2 dq2 x2 -∗
⌜γ1 ≠ γ2⌝.
Lemma auth_gmultiset۰authーne γ1 x1 γ2 dq2 x2 :
auth_gmultiset۰auth γ1 (DfracOwn 1) x1 -∗
auth_gmultiset۰auth γ2 dq2 x2 -∗
⌜γ1 ≠ γ2⌝.
Lemma auth_gmultiset۰authーexclusive γ x1 dq2 x2 :
auth_gmultiset۰auth γ (DfracOwn 1) x1 -∗
auth_gmultiset۰auth γ dq2 x2 -∗
False.
Lemma auth_gmultiset۰authーpersist γ dq x :
auth_gmultiset۰auth γ dq x ⊢ |==>
auth_gmultiset۰auth γ DfracDiscarded x.
Lemma auth_gmultiset۰fragーcombine γ y1 y2 :
auth_gmultiset۰frag γ y1 -∗
auth_gmultiset۰frag γ y2 -∗
auth_gmultiset۰frag γ (y1 ⊎ y2).
Lemma auth_gmultisetーsubseteq γ dq x y :
auth_gmultiset۰auth γ dq x -∗
auth_gmultiset۰frag γ y -∗
⌜y ⊆ x⌝.
Lemma auth_gmultisetーelem_of γ dq x b :
auth_gmultiset۰auth γ dq x -∗
auth_gmultiset۰frag γ {[+b+]} -∗
⌜b ∈ x⌝.
Lemma auth_gmultisetーupdateーalloc {γ x} y :
auth_gmultiset۰auth γ (DfracOwn 1) x ⊢ |==>
auth_gmultiset۰auth γ (DfracOwn 1) (y ⊎ x) ∗
auth_gmultiset۰frag γ y.
Lemma auth_gmultisetーupdateーallocーsingleton {γ x} a :
auth_gmultiset۰auth γ (DfracOwn 1) x ⊢ |==>
auth_gmultiset۰auth γ (DfracOwn 1) ({[+a+]} ⊎ x) ∗
auth_gmultiset۰frag γ {[+a+]}.
Lemma auth_gmultisetーupdateーdealloc {γ x} y :
auth_gmultiset۰auth γ (DfracOwn 1) x -∗
auth_gmultiset۰frag γ y ==∗
auth_gmultiset۰auth γ (DfracOwn 1) (x ∖ y).
End auth_gmultiset۰G.
#[global] Opaque auth_gmultiset۰auth.
#[global] Opaque auth_gmultiset۰frag.