Skip to content

Commit

Permalink
more renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhance committed Nov 25, 2024
1 parent 474e563 commit 75e7a23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/guarding/guard.v
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ Qed.

(** Guarding and disjunction **)

Lemma lguards_or_with_lhs (P R S : iProp Σ) F n
Lemma guards_cancel_or_with_lhs (P R S : iProp Σ) F n
(pr_impl_false: (P ∧ R ⊢ False))
: (
(P &&{F; n}&&> (R ∨ S))
Expand All @@ -1346,7 +1346,7 @@ Proof.
iApply lfguards_or_with_lhs; trivial. trivial.
Qed.

Lemma lguards_exists_with_lhs X (P : iProp Σ) (S R : X -> iProp Σ) F n
Lemma guards_strengthen_exists_with_lhs X (P : iProp Σ) (S R : X -> iProp Σ) F n
(pr_impl_s: (∀ x, P ∧ R x ⊢ S x))
(pers: ∀ x, Persistent (S x))
: (
Expand All @@ -1361,7 +1361,7 @@ Proof.
iApply lfguards_exists_with_lhs; trivial.
Qed.

Lemma guards_or (P Q R S : iProp Σ) F1 F2 n
Lemma guards_cancel_or (P Q R S : iProp Σ) F1 F2 n
(qrx: (Q ∧ R ⊢ False))
: (
(P &&{F1; n}&&> Q) ∗ (P &&{F2; n}&&> (R ∨ S))
Expand Down Expand Up @@ -1393,7 +1393,7 @@ Proof.



Lemma lguards_or_guards_false E P Q S n m :
Lemma guards_cancel_or_by_chaining_additive E P Q S n m :
(P &&{ E ; n }&&> Q ∨ S) ∗ (Q &&{ E ; m }&&> False) ⊢ (P &&{ E ; n + m }&&> S).
Proof.
rewrite guards_unseal. unfold guards_def.
Expand All @@ -1409,10 +1409,10 @@ Proof.
iPureIntro. set_solver.
Qed.

Lemma guards_or_guards_false E P Q S :
Lemma guards_cancel_or_by_chaining E P Q S :
(P &&{ E }&&> Q ∨ S) ∗ (Q &&{ E }&&> False) ⊢ (P &&{ E }&&> S).
Proof.
apply lguards_or_guards_false.
apply guards_cancel_or_by_chaining_additive.
Qed.

(** The relationship between guarding and invariants **)
Expand Down
4 changes: 2 additions & 2 deletions src/guarding/lib/lifetime.v
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ Section LlftLogic.
{
iAssert (llft_alive κ &&{ ↑NLLFT ∪ ↑NLLFT }&&> ▷ P) as "H".
{ iApply
(guards_or (llft_alive κ) (llft_alive κ) (llft_dead κ ∗ Cancel γc) (▷ P)).
(guards_cancel_or (llft_alive κ) (llft_alive κ) (llft_dead κ ∗ Cancel γc) (▷ P)).
{ iIntros "t". iApply (llftl_not_own_end_and κ). iSplit.
{ iDestruct "t" as "[t _]". iFrame "t". }
{ iDestruct "t" as "[_ [t _]]". iFrame "t". }
Expand Down Expand Up @@ -746,7 +746,7 @@ Section LlftLogic.
}

iAssert (True &&{ ↑NLLFT}&&> (∃ sa sd : gset nat, ⌜κ ⊈ sa⌝ ∗ LtState llft_name sa sd ∗ llft_alive sa)) as "G3".
{ iApply guards_or_guards_false. iFrame "ctx2".
{ iApply guards_cancel_or_by_chaining. iFrame "ctx2".
leaf_goal rhs to (llft_alive κ). { iFrame "G2". }
leaf_by_sep.
{ iIntros "T".
Expand Down
2 changes: 1 addition & 1 deletion src/guarding/storage_protocol/protocol.v
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ Section StorageLogic.
iDestruct (guards_true E (sp_own γ p)) as "gt".
iDestruct (guards_transitive _ (sp_own γ p) True%I with "[gt mg]") as "gg".
{ iFrame "gt". iFrame "mg". }
iDestruct (lguards_exists_with_lhs (P*B) (sp_own γ p)
iDestruct (guards_strengthen_exists_with_lhs (P*B) (sp_own γ p)
(λ (state_t: P*B), (▷ (⌜ p ≼ state_t.1 ⌝))%I)
(λ (state_t: P*B), (▷ (own γ (● Inved state_t.1) ∗ ⌜sp_rel state_t.1 state_t.2⌝ ∗ f state_t.2))%I)
E 0
Expand Down

0 comments on commit 75e7a23

Please sign in to comment.