Commit b4567fbd authored by Robbert Krebbers's avatar Robbert Krebbers

Rename `always` → `persistently` (the persistent modality).

parent 0ad1d2bd
...@@ -11,7 +11,7 @@ End uPred. ...@@ -11,7 +11,7 @@ End uPred.
Hint Resolve pure_intro. Hint Resolve pure_intro.
Hint Resolve or_elim or_intro_l' or_intro_r' : I. Hint Resolve or_elim or_intro_l' or_intro_r' : I.
Hint Resolve and_intro and_elim_l' and_elim_r' : I. Hint Resolve and_intro and_elim_l' and_elim_r' : I.
Hint Resolve always_mono : I. Hint Resolve persistently_mono : I.
Hint Resolve sep_elim_l' sep_elim_r' sep_mono : I. Hint Resolve sep_elim_l' sep_elim_r' sep_mono : I.
Hint Immediate True_intro False_elim : I. Hint Immediate True_intro False_elim : I.
Hint Immediate iff_refl internal_eq_refl' : I. Hint Immediate iff_refl internal_eq_refl' : I.
...@@ -117,11 +117,11 @@ Section list. ...@@ -117,11 +117,11 @@ Section list.
^n ([ list] kx l, Φ k x) ([ list] kx l, ^n Φ k x). ^n ([ list] kx l, Φ k x) ([ list] kx l, ^n Φ k x).
Proof. apply (big_opL_commute _). Qed. Proof. apply (big_opL_commute _). Qed.
Lemma big_sepL_always Φ l : Lemma big_sepL_persistently Φ l :
( [ list] kx l, Φ k x) ([ list] kx l, Φ k x). ( [ list] kx l, Φ k x) ([ list] kx l, Φ k x).
Proof. apply (big_opL_commute _). Qed. Proof. apply (big_opL_commute _). Qed.
Lemma big_sepL_always_if p Φ l : Lemma big_sepL_persistently_if p Φ l :
?p ([ list] kx l, Φ k x) ([ list] kx l, ?p Φ k x). ?p ([ list] kx l, Φ k x) ([ list] kx l, ?p Φ k x).
Proof. apply (big_opL_commute _). Qed. Proof. apply (big_opL_commute _). Qed.
...@@ -134,7 +134,7 @@ Section list. ...@@ -134,7 +134,7 @@ Section list.
apply impl_intro_l, pure_elim_l=> ?; by apply big_sepL_lookup. } apply impl_intro_l, pure_elim_l=> ?; by apply big_sepL_lookup. }
revert Φ HΦ. induction l as [|x l IH]=> Φ HΦ. revert Φ HΦ. induction l as [|x l IH]=> Φ HΦ.
{ rewrite big_sepL_nil; auto with I. } { rewrite big_sepL_nil; auto with I. }
rewrite big_sepL_cons. rewrite -always_and_sep_l; apply and_intro. rewrite big_sepL_cons. rewrite -persistently_and_sep_l; apply and_intro.
- by rewrite (forall_elim 0) (forall_elim x) pure_True // True_impl. - by rewrite (forall_elim 0) (forall_elim x) pure_True // True_impl.
- rewrite -IH. apply forall_intro=> k; by rewrite (forall_elim (S k)). - rewrite -IH. apply forall_intro=> k; by rewrite (forall_elim (S k)).
Qed. Qed.
...@@ -143,10 +143,10 @@ Section list. ...@@ -143,10 +143,10 @@ Section list.
( k x, l !! k = Some x Φ k x Ψ k x) ([ list] kx l, Φ k x) ( k x, l !! k = Some x Φ k x Ψ k x) ([ list] kx l, Φ k x)
[ list] kx l, Ψ k x. [ list] kx l, Ψ k x.
Proof. Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall. rewrite persistently_and_sep_l. do 2 setoid_rewrite persistently_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure. setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
rewrite -big_sepL_forall -big_sepL_sepL. apply big_sepL_mono; auto=> k x ?. rewrite -big_sepL_forall -big_sepL_sepL. apply big_sepL_mono; auto=> k x ?.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -persistently_wand_impl persistently_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepL_nil_persistent Φ : Global Instance big_sepL_nil_persistent Φ :
...@@ -307,11 +307,11 @@ Section gmap. ...@@ -307,11 +307,11 @@ Section gmap.
^n ([ map] kx m, Φ k x) ([ map] kx m, ^n Φ k x). ^n ([ map] kx m, Φ k x) ([ map] kx m, ^n Φ k x).
Proof. apply (big_opM_commute _). Qed. Proof. apply (big_opM_commute _). Qed.
Lemma big_sepM_always Φ m : Lemma big_sepM_persistently Φ m :
( [ map] kx m, Φ k x) ([ map] kx m, Φ k x). ( [ map] kx m, Φ k x) ([ map] kx m, Φ k x).
Proof. apply (big_opM_commute _). Qed. Proof. apply (big_opM_commute _). Qed.
Lemma big_sepM_always_if p Φ m : Lemma big_sepM_persistently_if p Φ m :
?p ([ map] kx m, Φ k x) ([ map] kx m, ?p Φ k x). ?p ([ map] kx m, Φ k x) ([ map] kx m, ?p Φ k x).
Proof. apply (big_opM_commute _). Qed. Proof. apply (big_opM_commute _). Qed.
...@@ -323,7 +323,7 @@ Section gmap. ...@@ -323,7 +323,7 @@ Section gmap.
{ apply forall_intro=> k; apply forall_intro=> x. { apply forall_intro=> k; apply forall_intro=> x.
apply impl_intro_l, pure_elim_l=> ?; by apply big_sepM_lookup. } apply impl_intro_l, pure_elim_l=> ?; by apply big_sepM_lookup. }
induction m as [|i x m ? IH] using map_ind; [rewrite ?big_sepM_empty; auto|]. induction m as [|i x m ? IH] using map_ind; [rewrite ?big_sepM_empty; auto|].
rewrite big_sepM_insert // -always_and_sep_l. apply and_intro. rewrite big_sepM_insert // -persistently_and_sep_l. apply and_intro.
- rewrite (forall_elim i) (forall_elim x) lookup_insert. - rewrite (forall_elim i) (forall_elim x) lookup_insert.
by rewrite pure_True // True_impl. by rewrite pure_True // True_impl.
- rewrite -IH. apply forall_mono=> k; apply forall_mono=> y. - rewrite -IH. apply forall_mono=> k; apply forall_mono=> y.
...@@ -336,10 +336,10 @@ Section gmap. ...@@ -336,10 +336,10 @@ Section gmap.
( k x, m !! k = Some x Φ k x Ψ k x) ([ map] kx m, Φ k x) ( k x, m !! k = Some x Φ k x Ψ k x) ([ map] kx m, Φ k x)
[ map] kx m, Ψ k x. [ map] kx m, Ψ k x.
Proof. Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall. rewrite persistently_and_sep_l. do 2 setoid_rewrite persistently_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure. setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
rewrite -big_sepM_forall -big_sepM_sepM. apply big_sepM_mono; auto=> k x ?. rewrite -big_sepM_forall -big_sepM_sepM. apply big_sepM_mono; auto=> k x ?.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -persistently_wand_impl persistently_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepM_empty_persistent Φ : Global Instance big_sepM_empty_persistent Φ :
...@@ -460,10 +460,10 @@ Section gset. ...@@ -460,10 +460,10 @@ Section gset.
^n ([ set] y X, Φ y) ([ set] y X, ^n Φ y). ^n ([ set] y X, Φ y) ([ set] y X, ^n Φ y).
Proof. apply (big_opS_commute _). Qed. Proof. apply (big_opS_commute _). Qed.
Lemma big_sepS_always Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y). Lemma big_sepS_persistently Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y).
Proof. apply (big_opS_commute _). Qed. Proof. apply (big_opS_commute _). Qed.
Lemma big_sepS_always_if q Φ X : Lemma big_sepS_persistently_if q Φ X :
?q ([ set] y X, Φ y) ([ set] y X, ?q Φ y). ?q ([ set] y X, Φ y) ([ set] y X, ?q Φ y).
Proof. apply (big_opS_commute _). Qed. Proof. apply (big_opS_commute _). Qed.
...@@ -475,7 +475,7 @@ Section gset. ...@@ -475,7 +475,7 @@ Section gset.
apply impl_intro_l, pure_elim_l=> ?; by apply big_sepS_elem_of. } apply impl_intro_l, pure_elim_l=> ?; by apply big_sepS_elem_of. }
induction X as [|x X ? IH] using collection_ind_L. induction X as [|x X ? IH] using collection_ind_L.
{ rewrite big_sepS_empty; auto. } { rewrite big_sepS_empty; auto. }
rewrite big_sepS_insert // -always_and_sep_l. apply and_intro. rewrite big_sepS_insert // -persistently_and_sep_l. apply and_intro.
- by rewrite (forall_elim x) pure_True ?True_impl; last set_solver. - by rewrite (forall_elim x) pure_True ?True_impl; last set_solver.
- rewrite -IH. apply forall_mono=> y. apply impl_intro_l, pure_elim_l=> ?. - rewrite -IH. apply forall_mono=> y. apply impl_intro_l, pure_elim_l=> ?.
by rewrite pure_True ?True_impl; last set_solver. by rewrite pure_True ?True_impl; last set_solver.
...@@ -484,10 +484,10 @@ Section gset. ...@@ -484,10 +484,10 @@ Section gset.
Lemma big_sepS_impl Φ Ψ X : Lemma big_sepS_impl Φ Ψ X :
( x, x X Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x. ( x, x X Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x.
Proof. Proof.
rewrite always_and_sep_l always_forall. rewrite persistently_and_sep_l persistently_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure. setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
rewrite -big_sepS_forall -big_sepS_sepS. apply big_sepS_mono; auto=> x ?. rewrite -big_sepS_forall -big_sepS_sepS. apply big_sepS_mono; auto=> x ?.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -persistently_wand_impl persistently_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepS_empty_persistent Φ : Persistent ([ set] x , Φ x). Global Instance big_sepS_empty_persistent Φ : Persistent ([ set] x , Φ x).
...@@ -571,10 +571,10 @@ Section gmultiset. ...@@ -571,10 +571,10 @@ Section gmultiset.
^n ([ mset] y X, Φ y) ([ mset] y X, ^n Φ y). ^n ([ mset] y X, Φ y) ([ mset] y X, ^n Φ y).
Proof. apply (big_opMS_commute _). Qed. Proof. apply (big_opMS_commute _). Qed.
Lemma big_sepMS_always Φ X : ([ mset] y X, Φ y) ([ mset] y X, Φ y). Lemma big_sepMS_persistently Φ X : ([ mset] y X, Φ y) ([ mset] y X, Φ y).
Proof. apply (big_opMS_commute _). Qed. Proof. apply (big_opMS_commute _). Qed.
Lemma big_sepMS_always_if q Φ X : Lemma big_sepMS_persistently_if q Φ X :
?q ([ mset] y X, Φ y) ([ mset] y X, ?q Φ y). ?q ([ mset] y X, Φ y) ([ mset] y X, ?q Φ y).
Proof. apply (big_opMS_commute _). Qed. Proof. apply (big_opMS_commute _). Qed.
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ Section fractional. ...@@ -51,7 +51,7 @@ Section fractional.
(** Fractional and logical connectives *) (** Fractional and logical connectives *)
Global Instance persistent_fractional P : Global Instance persistent_fractional P :
Persistent P Fractional (λ _, P). Persistent P Fractional (λ _, P).
Proof. intros HP q q'. by apply uPred.always_sep_dup. Qed. Proof. intros HP q q'. by apply uPred.persistently_sep_dup. Qed.
Global Instance fractional_sep Φ Ψ : Global Instance fractional_sep Φ Ψ :
Fractional Φ Fractional Ψ Fractional (λ q, Φ q Ψ q)%I. Fractional Φ Fractional Ψ Fractional (λ q, Φ q Ψ q)%I.
...@@ -134,7 +134,7 @@ Section fractional. ...@@ -134,7 +134,7 @@ Section fractional.
AsFractional P Φ (q1 + q2) AsFractional P1 Φ q1 AsFractional P2 Φ q2 AsFractional P Φ (q1 + q2) AsFractional P1 Φ q1 AsFractional P2 Φ q2
IntoAnd p P P1 P2. IntoAnd p P P1 P2.
Proof. Proof.
(* TODO: We need a better way to handle this boolean here; always (* TODO: We need a better way to handle this boolean here; persistently
applying mk_into_and_sep (which only works after introducing all applying mk_into_and_sep (which only works after introducing all
assumptions) is rather annoying. assumptions) is rather annoying.
Ideally, it'd not even be possible to make the mistake that Ideally, it'd not even be possible to make the mistake that
...@@ -148,7 +148,7 @@ Section fractional. ...@@ -148,7 +148,7 @@ Section fractional.
Proof. intros. apply mk_into_and_sep. rewrite [P]fractional_half //. Qed. Proof. intros. apply mk_into_and_sep. rewrite [P]fractional_half //. Qed.
(* The instance [frame_fractional] can be tried at all the nodes of (* The instance [frame_fractional] can be tried at all the nodes of
the proof search. The proof search then fails almost always on the proof search. The proof search then fails almost persistently on
[AsFractional R Φ r], but the slowdown is still noticeable. For [AsFractional R Φ r], but the slowdown is still noticeable. For
that reason, we factorize the three instances that could have been that reason, we factorize the three instances that could have been
defined for that purpose into one. *) defined for that purpose into one. *)
...@@ -179,6 +179,6 @@ Section fractional. ...@@ -179,6 +179,6 @@ Section fractional.
- rewrite fractional=><-<-. by rewrite assoc. - rewrite fractional=><-<-. by rewrite assoc.
- rewrite fractional=><-<-=>_. - rewrite fractional=><-<-=>_.
by rewrite (comm _ Q (Φ q0)) !assoc (comm _ (Φ _)). by rewrite (comm _ Q (Φ q0)) !assoc (comm _ (Φ _)).
- move=>-[-> _]->. by rewrite uPred.always_if_elim -fractional Qp_div_2. - move=>-[-> _]->. by rewrite uPred.persistently_if_elim -fractional Qp_div_2.
Qed. Qed.
End fractional. End fractional.
...@@ -83,7 +83,7 @@ Class subG (Σ1 Σ2 : gFunctors) := in_subG i : { j | Σ1 i = Σ2 j }. ...@@ -83,7 +83,7 @@ Class subG (Σ1 Σ2 : gFunctors) := in_subG i : { j | Σ1 i = Σ2 j }.
(** Avoid trigger happy type class search: this line ensures that type class (** Avoid trigger happy type class search: this line ensures that type class
search is only triggered if the arguments of [subG] do not contain evars. Since search is only triggered if the arguments of [subG] do not contain evars. Since
instance search for [subG] is restrained, instances should always have [subG] as instance search for [subG] is restrained, instances should persistently have [subG] as
their first parameter to avoid loops. For example, the instances [subG_authΣ] their first parameter to avoid loops. For example, the instances [subG_authΣ]
and [auth_discrete] otherwise create a cycle that pops up arbitrarily. *) and [auth_discrete] otherwise create a cycle that pops up arbitrarily. *)
Hint Mode subG + + : typeclass_instances. Hint Mode subG + + : typeclass_instances.
......
...@@ -102,7 +102,7 @@ Proof. apply wand_intro_r. by rewrite -own_op own_valid. Qed. ...@@ -102,7 +102,7 @@ Proof. apply wand_intro_r. by rewrite -own_op own_valid. Qed.
Lemma own_valid_3 γ a1 a2 a3 : own γ a1 - own γ a2 - own γ a3 - (a1 a2 a3). Lemma own_valid_3 γ a1 a2 a3 : own γ a1 - own γ a2 - own γ a3 - (a1 a2 a3).
Proof. do 2 apply wand_intro_r. by rewrite -!own_op own_valid. Qed. Proof. do 2 apply wand_intro_r. by rewrite -!own_op own_valid. Qed.
Lemma own_valid_r γ a : own γ a own γ a a. Lemma own_valid_r γ a : own γ a own γ a a.
Proof. apply: uPred.always_entails_r. apply own_valid. Qed. Proof. apply: uPred.persistently_entails_r. apply own_valid. Qed.
Lemma own_valid_l γ a : own γ a a own γ a. Lemma own_valid_l γ a : own γ a a own γ a.
Proof. by rewrite comm -own_valid_r. Qed. Proof. by rewrite comm -own_valid_r. Qed.
......
...@@ -81,5 +81,5 @@ Lemma vs_alloc N P : ▷ P ={↑N}=> inv N P. ...@@ -81,5 +81,5 @@ Lemma vs_alloc N P : ▷ P ={↑N}=> inv N P.
Proof. iIntros "!# HP". by iApply inv_alloc. Qed. Proof. iIntros "!# HP". by iApply inv_alloc. Qed.
Lemma wand_fupd_alt E1 E2 P Q : (P ={E1,E2}= Q) R, R (P R ={E1,E2}=> Q). Lemma wand_fupd_alt E1 E2 P Q : (P ={E1,E2}= Q) R, R (P R ={E1,E2}=> Q).
Proof. rewrite uPred.wand_alt. by setoid_rewrite <-uPred.always_wand_impl. Qed. Proof. rewrite uPred.wand_alt. by setoid_rewrite <-uPred.persistently_wand_impl. Qed.
End vs. End vs.
...@@ -97,16 +97,16 @@ Definition uPred_wand {M} := unseal uPred_wand_aux M. ...@@ -97,16 +97,16 @@ Definition uPred_wand {M} := unseal uPred_wand_aux M.
Definition uPred_wand_eq : Definition uPred_wand_eq :
@uPred_wand = @uPred_wand_def := seal_eq uPred_wand_aux. @uPred_wand = @uPred_wand_def := seal_eq uPred_wand_aux.
Program Definition uPred_always_def {M} (P : uPred M) : uPred M := Program Definition uPred_persistently_def {M} (P : uPred M) : uPred M :=
{| uPred_holds n x := P n (core x) |}. {| uPred_holds n x := P n (core x) |}.
Next Obligation. Next Obligation.
intros M; naive_solver eauto using uPred_mono, @cmra_core_monoN. intros M; naive_solver eauto using uPred_mono, @cmra_core_monoN.
Qed. Qed.
Next Obligation. naive_solver eauto using uPred_closed, @cmra_core_validN. Qed. Next Obligation. naive_solver eauto using uPred_closed, @cmra_core_validN. Qed.
Definition uPred_always_aux : seal (@uPred_always_def). by eexists. Qed. Definition uPred_persistently_aux : seal (@uPred_persistently_def). by eexists. Qed.
Definition uPred_always {M} := unseal uPred_always_aux M. Definition uPred_persistently {M} := unseal uPred_persistently_aux M.
Definition uPred_always_eq : Definition uPred_persistently_eq :
@uPred_always = @uPred_always_def := seal_eq uPred_always_aux. @uPred_persistently = @uPred_persistently_def := seal_eq uPred_persistently_aux.
Program Definition uPred_later_def {M} (P : uPred M) : uPred M := Program Definition uPred_later_def {M} (P : uPred M) : uPred M :=
{| uPred_holds n x := match n return _ with 0 => True | S n' => P n' x end |}. {| uPred_holds n x := match n return _ with 0 => True | S n' => P n' x end |}.
...@@ -176,7 +176,7 @@ Notation "∀ x .. y , P" := ...@@ -176,7 +176,7 @@ Notation "∀ x .. y , P" :=
Notation "∃ x .. y , P" := Notation "∃ x .. y , P" :=
(uPred_exist (λ x, .. (uPred_exist (λ y, P)) ..)%I) (uPred_exist (λ x, .. (uPred_exist (λ y, P)) ..)%I)
(at level 200, x binder, y binder, right associativity) : uPred_scope. (at level 200, x binder, y binder, right associativity) : uPred_scope.
Notation "□ P" := (uPred_always P) Notation "□ P" := (uPred_persistently P)
(at level 20, right associativity) : uPred_scope. (at level 20, right associativity) : uPred_scope.
Notation "▷ P" := (uPred_later P) Notation "▷ P" := (uPred_later P)
(at level 20, right associativity) : uPred_scope. (at level 20, right associativity) : uPred_scope.
...@@ -198,7 +198,7 @@ Notation "P -∗ Q" := (P ⊢ Q) ...@@ -198,7 +198,7 @@ Notation "P -∗ Q" := (P ⊢ Q)
Module uPred. Module uPred.
Definition unseal_eqs := Definition unseal_eqs :=
(uPred_pure_eq, uPred_and_eq, uPred_or_eq, uPred_impl_eq, uPred_forall_eq, (uPred_pure_eq, uPred_and_eq, uPred_or_eq, uPred_impl_eq, uPred_forall_eq,
uPred_exist_eq, uPred_internal_eq_eq, uPred_sep_eq, uPred_wand_eq, uPred_always_eq, uPred_exist_eq, uPred_internal_eq_eq, uPred_sep_eq, uPred_wand_eq, uPred_persistently_eq,
uPred_later_eq, uPred_ownM_eq, uPred_cmra_valid_eq, uPred_bupd_eq). uPred_later_eq, uPred_ownM_eq, uPred_cmra_valid_eq, uPred_bupd_eq).
Ltac unseal := rewrite !unseal_eqs /=. Ltac unseal := rewrite !unseal_eqs /=.
...@@ -295,13 +295,13 @@ Proof. ...@@ -295,13 +295,13 @@ Proof.
Qed. Qed.
Global Instance later_proper' : Global Instance later_proper' :
Proper (() ==> ()) (@uPred_later M) := ne_proper _. Proper (() ==> ()) (@uPred_later M) := ne_proper _.
Global Instance always_ne : NonExpansive (@uPred_always M). Global Instance persistently_ne : NonExpansive (@uPred_persistently M).
Proof. Proof.
intros n P1 P2 HP. intros n P1 P2 HP.
unseal; split=> n' x; split; apply HP; eauto using @cmra_core_validN. unseal; split=> n' x; split; apply HP; eauto using @cmra_core_validN.
Qed. Qed.
Global Instance always_proper : Global Instance persistently_proper :
Proper (() ==> ()) (@uPred_always M) := ne_proper _. Proper (() ==> ()) (@uPred_persistently M) := ne_proper _.
Global Instance ownM_ne : NonExpansive (@uPred_ownM M). Global Instance ownM_ne : NonExpansive (@uPred_ownM M).
Proof. Proof.
intros n a b Ha. intros n a b Ha.
...@@ -422,22 +422,22 @@ Proof. ...@@ -422,22 +422,22 @@ Proof.
Qed. Qed.
(* Always *) (* Always *)
Lemma always_mono P Q : (P Q) P Q. Lemma persistently_mono P Q : (P Q) P Q.
Proof. intros HP; unseal; split=> n x ? /=. by apply HP, cmra_core_validN. Qed. Proof. intros HP; unseal; split=> n x ? /=. by apply HP, cmra_core_validN. Qed.
Lemma always_elim P : P P. Lemma persistently_elim P : P P.
Proof. Proof.
unseal; split=> n x ? /=. unseal; split=> n x ? /=.
eauto using uPred_mono, @cmra_included_core, cmra_included_includedN. eauto using uPred_mono, @cmra_included_core, cmra_included_includedN.
Qed. Qed.
Lemma always_idemp_2 P : P P. Lemma persistently_idemp_2 P : P P.
Proof. unseal; split=> n x ?? /=. by rewrite cmra_core_idemp. Qed. Proof. unseal; split=> n x ?? /=. by rewrite cmra_core_idemp. Qed.
Lemma always_forall_2 {A} (Ψ : A uPred M) : ( a, Ψ a) ( a, Ψ a). Lemma persistently_forall_2 {A} (Ψ : A uPred M) : ( a, Ψ a) ( a, Ψ a).
Proof. by unseal. Qed. Proof. by unseal. Qed.
Lemma always_exist_1 {A} (Ψ : A uPred M) : ( a, Ψ a) ( a, Ψ a). Lemma persistently_exist_1 {A} (Ψ : A uPred M) : ( a, Ψ a) ( a, Ψ a).
Proof. by unseal. Qed. Proof. by unseal. Qed.
Lemma always_and_sep_l_1 P Q : P Q P Q. Lemma persistently_and_sep_l_1 P Q : P Q P Q.
Proof. Proof.
unseal; split=> n x ? [??]; exists (core x), x; simpl in *. unseal; split=> n x ? [??]; exists (core x), x; simpl in *.
by rewrite cmra_core_l cmra_core_idemp. by rewrite cmra_core_l cmra_core_idemp.
...@@ -475,7 +475,7 @@ Proof. ...@@ -475,7 +475,7 @@ Proof.
intros [|n'] x' ????; [|done]. intros [|n'] x' ????; [|done].
eauto using uPred_closed, uPred_mono, cmra_included_includedN. eauto using uPred_closed, uPred_mono, cmra_included_includedN.
Qed. Qed.
Lemma always_later P : P P. Lemma persistently_later P : P P.
Proof. by unseal. Qed. Proof. by unseal. Qed.
(* Own *) (* Own *)
...@@ -489,7 +489,7 @@ Proof. ...@@ -489,7 +489,7 @@ Proof.
by rewrite (assoc op _ z1) -(comm op z1) (assoc op z1) by rewrite (assoc op _ z1) -(comm op z1) (assoc op z1)
-(assoc op _ a2) (comm op z1) -Hy1 -Hy2. -(assoc op _ a2) (comm op z1) -Hy1 -Hy2.
Qed. Qed.
Lemma always_ownM_core (a : M) : uPred_ownM a uPred_ownM (core a). Lemma persistently_ownM_core (a : M) : uPred_ownM a uPred_ownM (core a).
Proof. Proof.
split=> n x /=; unseal; intros Hx. simpl. by apply cmra_core_monoN. split=> n x /=; unseal; intros Hx. simpl. by apply cmra_core_monoN.
Qed. Qed.
...@@ -512,7 +512,7 @@ Lemma cmra_valid_intro {A : cmraT} (a : A) : ✓ a → uPred_valid (M:=M) (✓ a ...@@ -512,7 +512,7 @@ Lemma cmra_valid_intro {A : cmraT} (a : A) : ✓ a → uPred_valid (M:=M) (✓ a
Proof. unseal=> ?; split=> n x ? _ /=; by apply cmra_valid_validN. Qed. Proof. unseal=> ?; split=> n x ? _ /=; by apply cmra_valid_validN. Qed.
Lemma cmra_valid_elim {A : cmraT} (a : A) : ¬ {0} a a False. Lemma cmra_valid_elim {A : cmraT} (a : A) : ¬ {0} a a False.
Proof. unseal=> Ha; split=> n x ??; apply Ha, cmra_validN_le with n; auto. Qed. Proof. unseal=> Ha; split=> n x ??; apply Ha, cmra_validN_le with n; auto. Qed.
Lemma always_cmra_valid_1 {A : cmraT} (a : A) : a a. Lemma persistently_cmra_valid_1 {A : cmraT} (a : A) : a a.
Proof. by unseal. Qed. Proof. by unseal. Qed.
Lemma cmra_valid_weaken {A : cmraT} (a b : A) : (a b) a. Lemma cmra_valid_weaken {A : cmraT} (a b : A) : (a b) a.
Proof. unseal; split=> n x _; apply cmra_validN_op_l. Qed. Proof. unseal; split=> n x _; apply cmra_validN_op_l. Qed.
......
...@@ -37,7 +37,7 @@ Global Instance ht_proper E : ...@@ -37,7 +37,7 @@ Global Instance ht_proper E :
Proof. solve_proper. Qed. Proof. solve_proper. Qed.
Lemma ht_mono E P P' Φ Φ' e : Lemma ht_mono E P P' Φ Φ' e :
(P P') ( v, Φ' v Φ v) {{ P' }} e @ E {{ Φ' }} {{ P }} e @ E {{ Φ }}. (P P') ( v, Φ' v Φ v) {{ P' }} e @ E {{ Φ' }} {{ P }} e @ E {{ Φ }}.
Proof. by intros; apply always_mono, wand_mono, wp_mono. Qed. Proof. by intros; apply persistently_mono, wand_mono, wp_mono. Qed.
Global Instance ht_mono' E : Global Instance ht_mono' E :
Proper (flip () ==> eq ==> pointwise_relation _ () ==> ()) (ht E). Proper (flip () ==> eq ==> pointwise_relation _ () ==> ()) (ht E).
Proof. solve_proper. Qed. Proof. solve_proper. Qed.
......
...@@ -283,7 +283,7 @@ Section proofmode_classes. ...@@ -283,7 +283,7 @@ Section proofmode_classes.
ElimModal (|={E}=> P) P (WP e @ E {{ Φ }}) (WP e @ E {{ Φ }}). ElimModal (|={E}=> P) P (WP e @ E {{ Φ }}) (WP e @ E {{ Φ }}).
Proof. by rewrite /ElimModal fupd_frame_r wand_elim_r fupd_wp. Qed. Proof. by rewrite /ElimModal fupd_frame_r wand_elim_r fupd_wp. Qed.
(* lower precedence, if possible, it should always pick elim_upd_fupd_wp *) (* lower precedence, if possible, it should persistently pick elim_upd_fupd_wp *)
Global Instance elim_modal_fupd_wp_atomic E1 E2 e P Φ : Global Instance elim_modal_fupd_wp_atomic E1 E2 e P Φ :
atomic e atomic e
ElimModal (|={E1,E2}=> P) P ElimModal (|={E1,E2}=> P) P
......
This diff is collapsed.
...@@ -15,7 +15,7 @@ Existing Instance Or_r | 10. ...@@ -15,7 +15,7 @@ Existing Instance Or_r | 10.
Class FromAssumption {M} (p : bool) (P Q : uPred M) := Class FromAssumption {M} (p : bool) (P Q : uPred M) :=
from_assumption : ?p P Q. from_assumption : ?p P Q.
Arguments from_assumption {_} _ _ _ {_}. Arguments from_assumption {_} _ _ _ {_}.
(* No need to restrict Hint Mode, we have a default instance that will always (* No need to restrict Hint Mode, we have a default instance that will persistently
be used in case of evars *) be used in case of evars *)
Hint Mode FromAssumption + + - - : typeclass_instances. Hint Mode FromAssumption + + - - : typeclass_instances.
...@@ -125,8 +125,8 @@ Lemma mk_from_and_persistent {M} (P Q1 Q2 : uPred M) : ...@@ -125,8 +125,8 @@ Lemma mk_from_and_persistent {M} (P Q1 Q2 : uPred M) :
Or (Persistent Q1) (Persistent Q2) (Q1 Q2 P) FromAnd true P Q1 Q2. Or (Persistent Q1) (Persistent Q2) (Q1 Q2 P) FromAnd true P Q1 Q2.
Proof. Proof.
intros [?|?] ?; rewrite /FromAnd. intros [?|?] ?; rewrite /FromAnd.
- by rewrite always_and_sep_l. - by rewrite persistently_and_sep_l.
- by rewrite always_and_sep_r. - by rewrite persistently_and_sep_r.
Qed. Qed.
Class IntoAnd {M} (p : bool) (P Q1 Q2 : uPred M) := Class IntoAnd {M} (p : bool) (P Q1 Q2 : uPred M) :=
......
This diff is collapsed.
...@@ -802,8 +802,8 @@ Local Tactic Notation "iExistDestruct" constr(H) ...@@ -802,8 +802,8 @@ Local Tactic Notation "iExistDestruct" constr(H)
(** * Always *) (** * Always *)
Tactic Notation "iAlways":= Tactic Notation "iAlways":=
iStartProof; iStartProof;
apply tac_always_intro; env_cbv apply tac_persistently_intro; env_cbv
|| fail "iAlways: the goal is not an always modality". || fail "iAlways: the goal is not an persistently modality".
(** * Later *) (** * Later *)
Tactic Notation "iNext" open_constr(n) := Tactic Notation "iNext" open_constr(n) :=
...@@ -1217,7 +1217,7 @@ Instance copy_destruct_impl {M} (P Q : uPred M) : ...@@ -1217,7 +1217,7 @@ Instance copy_destruct_impl {M} (P Q : uPred M) :
CopyDestruct Q CopyDestruct (P Q). CopyDestruct Q CopyDestruct (P Q).
Instance copy_destruct_wand {M} (P Q : uPred M) : Instance copy_destruct_wand {M} (P Q : uPred M) :
CopyDestruct Q CopyDestruct (P - Q). CopyDestruct Q CopyDestruct (P - Q).
Instance copy_destruct_always {M} (P : uPred M) : Instance copy_destruct_persistently {M} (P : uPred M) :
CopyDestruct P CopyDestruct ( P). CopyDestruct P CopyDestruct ( P).
Tactic Notation "iDestructCore" open_constr(lem) "as" constr(p) tactic(tac) :=