Library zoo.iris.base_logic.lib.ghost_prop
Require Import zoo.prelude.
Require Export zoo.iris.base_logic.lib.base.
Require Import zoo.iris.base_logic.lib.ghost_var.
Require Import zoo.iris.diaframe.
Require Import zoo.options.
Class GhostPropG Σ :=
{ #[local] ghost_prop۰G۰ghost_var۰G :: GhostVarG Σ (▶ ∙)
}.
Definition ghost_prop۰Σ :=
#[ghost_var۰Σ (▶ ∙)
].
#[global] Instance subGーghost_prop۰Σ Σ :
subG ghost_prop۰Σ Σ →
GhostPropG Σ.
Section ghost_prop۰G.
Context `{ghost_prop۰G : !GhostPropG Σ}.
Implicit Type P : iProp Σ.
Definition ghost_prop γ dq P :=
ghost_var γ dq (Next P).
#[global] Instance ghost_propーcontractive γ dq :
Contractive (ghost_prop γ dq).
#[global] Instance ghost_propーproper γ dq :
Proper ((≡) ==> (≡)) (ghost_prop γ dq).
#[global] Instance ghost_propーpersistent γ P :
Persistent (ghost_prop γ DfracDiscarded P).
#[global] Instance ghost_propーfractional γ P :
Fractional (λ q, ghost_prop γ (DfracOwn q) P).
#[global] Instance ghost_propーas_fractional γ P q :
AsFractional (ghost_prop γ (DfracOwn q) P) (λ q, ghost_prop γ (DfracOwn q) P) q.
Lemma ghost_propーalloc P :
⊢ |==>
∃ γ,
ghost_prop γ (DfracOwn 1) P.
Lemma ghost_propーallocーcofinite (γs : gset gname) P :
⊢ |==>
∃ γ,
⌜γ ∉ γs⌝ ∗
ghost_prop γ (DfracOwn 1) P.
Lemma ghost_propーvalid γ dq P :
ghost_prop γ dq P ⊢
⌜✓ dq⌝.
Lemma ghost_propーcombine γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
▷ (P1 ≡ P2) ∗
ghost_prop γ (dq1 ⋅ dq2) P1.
Lemma ghost_propーvalidー2 γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
⌜✓ (dq1 ⋅ dq2)⌝ ∗
▷ (P1 ≡ P2).
Lemma ghost_propーagree γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
▷ (P1 ≡ P2).
Lemma ghost_propーdfracーne γ1 dq1 P1 γ2 dq2 P2 :
¬ ✓ (dq1 ⋅ dq2) →
ghost_prop γ1 dq1 P1 -∗
ghost_prop γ2 dq2 P2 -∗
⌜γ1 ≠ γ2⌝.
Lemma ghost_propーne γ1 P1 γ2 dq2 P2 :
ghost_prop γ1 (DfracOwn 1) P1 -∗
ghost_prop γ2 dq2 P2 -∗
⌜γ1 ≠ γ2⌝.
Lemma ghost_propーexclusive γ P1 dq2 P2 :
ghost_prop γ (DfracOwn 1) P1 -∗
ghost_prop γ dq2 P2 -∗
False.
Lemma ghost_propーpersist γ dq P :
ghost_prop γ dq P ⊢ |==>
ghost_prop γ DfracDiscarded P.
Lemma ghost_propーupdate {γ P} P' :
ghost_prop γ (DfracOwn 1) P ⊢ |==>
ghost_prop γ (DfracOwn 1) P'.
End ghost_prop۰G.
#[global] Opaque ghost_prop.
Require Export zoo.iris.base_logic.lib.base.
Require Import zoo.iris.base_logic.lib.ghost_var.
Require Import zoo.iris.diaframe.
Require Import zoo.options.
Class GhostPropG Σ :=
{ #[local] ghost_prop۰G۰ghost_var۰G :: GhostVarG Σ (▶ ∙)
}.
Definition ghost_prop۰Σ :=
#[ghost_var۰Σ (▶ ∙)
].
#[global] Instance subGーghost_prop۰Σ Σ :
subG ghost_prop۰Σ Σ →
GhostPropG Σ.
Section ghost_prop۰G.
Context `{ghost_prop۰G : !GhostPropG Σ}.
Implicit Type P : iProp Σ.
Definition ghost_prop γ dq P :=
ghost_var γ dq (Next P).
#[global] Instance ghost_propーcontractive γ dq :
Contractive (ghost_prop γ dq).
#[global] Instance ghost_propーproper γ dq :
Proper ((≡) ==> (≡)) (ghost_prop γ dq).
#[global] Instance ghost_propーpersistent γ P :
Persistent (ghost_prop γ DfracDiscarded P).
#[global] Instance ghost_propーfractional γ P :
Fractional (λ q, ghost_prop γ (DfracOwn q) P).
#[global] Instance ghost_propーas_fractional γ P q :
AsFractional (ghost_prop γ (DfracOwn q) P) (λ q, ghost_prop γ (DfracOwn q) P) q.
Lemma ghost_propーalloc P :
⊢ |==>
∃ γ,
ghost_prop γ (DfracOwn 1) P.
Lemma ghost_propーallocーcofinite (γs : gset gname) P :
⊢ |==>
∃ γ,
⌜γ ∉ γs⌝ ∗
ghost_prop γ (DfracOwn 1) P.
Lemma ghost_propーvalid γ dq P :
ghost_prop γ dq P ⊢
⌜✓ dq⌝.
Lemma ghost_propーcombine γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
▷ (P1 ≡ P2) ∗
ghost_prop γ (dq1 ⋅ dq2) P1.
Lemma ghost_propーvalidー2 γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
⌜✓ (dq1 ⋅ dq2)⌝ ∗
▷ (P1 ≡ P2).
Lemma ghost_propーagree γ dq1 P1 dq2 P2 :
ghost_prop γ dq1 P1 -∗
ghost_prop γ dq2 P2 -∗
▷ (P1 ≡ P2).
Lemma ghost_propーdfracーne γ1 dq1 P1 γ2 dq2 P2 :
¬ ✓ (dq1 ⋅ dq2) →
ghost_prop γ1 dq1 P1 -∗
ghost_prop γ2 dq2 P2 -∗
⌜γ1 ≠ γ2⌝.
Lemma ghost_propーne γ1 P1 γ2 dq2 P2 :
ghost_prop γ1 (DfracOwn 1) P1 -∗
ghost_prop γ2 dq2 P2 -∗
⌜γ1 ≠ γ2⌝.
Lemma ghost_propーexclusive γ P1 dq2 P2 :
ghost_prop γ (DfracOwn 1) P1 -∗
ghost_prop γ dq2 P2 -∗
False.
Lemma ghost_propーpersist γ dq P :
ghost_prop γ dq P ⊢ |==>
ghost_prop γ DfracDiscarded P.
Lemma ghost_propーupdate {γ P} P' :
ghost_prop γ (DfracOwn 1) P ⊢ |==>
ghost_prop γ (DfracOwn 1) P'.
End ghost_prop۰G.
#[global] Opaque ghost_prop.