Commit b4567fbd authored by Robbert Krebbers's avatar Robbert Krebbers

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

parent 0ad1d2bd
......@@ -11,7 +11,7 @@ End uPred.
Hint Resolve pure_intro.
Hint Resolve or_elim or_intro_l' or_intro_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 Immediate True_intro False_elim : I.
Hint Immediate iff_refl internal_eq_refl' : I.
......@@ -117,11 +117,11 @@ Section list.
^n ([ list] kx l, Φ k x) ([ list] kx l, ^n Φ k x).
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).
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).
Proof. apply (big_opL_commute _). Qed.
......@@ -134,7 +134,7 @@ Section list.
apply impl_intro_l, pure_elim_l=> ?; by apply big_sepL_lookup. }
revert Φ HΦ. induction l as [|x l IH]=> Φ HΦ.
{ 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.
- rewrite -IH. apply forall_intro=> k; by rewrite (forall_elim (S k)).
Qed.
......@@ -143,10 +143,10 @@ Section list.
( k x, l !! k = Some x Φ k x Ψ k x) ([ list] kx l, Φ k x)
[ list] kx l, Ψ k x.
Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure.
rewrite persistently_and_sep_l. do 2 setoid_rewrite persistently_forall.
setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
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.
Global Instance big_sepL_nil_persistent Φ :
......@@ -307,11 +307,11 @@ Section gmap.
^n ([ map] kx m, Φ k x) ([ map] kx m, ^n Φ k x).
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).
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).
Proof. apply (big_opM_commute _). Qed.
......@@ -323,7 +323,7 @@ Section gmap.
{ apply forall_intro=> k; apply forall_intro=> x.
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|].
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.
by rewrite pure_True // True_impl.
- rewrite -IH. apply forall_mono=> k; apply forall_mono=> y.
......@@ -336,10 +336,10 @@ Section gmap.
( k x, m !! k = Some x Φ k x Ψ k x) ([ map] kx m, Φ k x)
[ map] kx m, Ψ k x.
Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure.
rewrite persistently_and_sep_l. do 2 setoid_rewrite persistently_forall.
setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
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.
Global Instance big_sepM_empty_persistent Φ :
......@@ -460,10 +460,10 @@ Section gset.
^n ([ set] y X, Φ y) ([ set] y X, ^n Φ y).
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.
Lemma big_sepS_always_if q Φ X :
Lemma big_sepS_persistently_if q Φ X :
?q ([ set] y X, Φ y) ([ set] y X, ?q Φ y).
Proof. apply (big_opS_commute _). Qed.
......@@ -475,7 +475,7 @@ Section gset.
apply impl_intro_l, pure_elim_l=> ?; by apply big_sepS_elem_of. }
induction X as [|x X ? IH] using collection_ind_L.
{ 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.
- rewrite -IH. apply forall_mono=> y. apply impl_intro_l, pure_elim_l=> ?.
by rewrite pure_True ?True_impl; last set_solver.
......@@ -484,10 +484,10 @@ Section gset.
Lemma big_sepS_impl Φ Ψ X :
( x, x X Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x.
Proof.
rewrite always_and_sep_l always_forall.
setoid_rewrite always_impl; setoid_rewrite always_pure.
rewrite persistently_and_sep_l persistently_forall.
setoid_rewrite persistently_impl; setoid_rewrite persistently_pure.
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.
Global Instance big_sepS_empty_persistent Φ : Persistent ([ set] x , Φ x).
......@@ -571,10 +571,10 @@ Section gmultiset.
^n ([ mset] y X, Φ y) ([ mset] y X, ^n Φ y).
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.
Lemma big_sepMS_always_if q Φ X :
Lemma big_sepMS_persistently_if q Φ X :
?q ([ mset] y X, Φ y) ([ mset] y X, ?q Φ y).
Proof. apply (big_opMS_commute _). Qed.
......
This diff is collapsed.
......@@ -51,7 +51,7 @@ Section fractional.
(** Fractional and logical connectives *)
Global Instance persistent_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 Φ Ψ :
Fractional Φ Fractional Ψ Fractional (λ q, Φ q Ψ q)%I.
......@@ -134,7 +134,7 @@ Section fractional.
AsFractional P Φ (q1 + q2) AsFractional P1 Φ q1 AsFractional P2 Φ q2
IntoAnd p P P1 P2.
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
assumptions) is rather annoying.
Ideally, it'd not even be possible to make the mistake that
......@@ -148,7 +148,7 @@ Section fractional.
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 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
that reason, we factorize the three instances that could have been
defined for that purpose into one. *)
......@@ -179,6 +179,6 @@ Section fractional.
- rewrite fractional=><-<-. by rewrite assoc.
- rewrite fractional=><-<-=>_.
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.
End fractional.
......@@ -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
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Σ]
and [auth_discrete] otherwise create a cycle that pops up arbitrarily. *)
Hint Mode subG + + : typeclass_instances.
......
......@@ -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).
Proof. do 2 apply wand_intro_r. by rewrite -!own_op own_valid. Qed.
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.
Proof. by rewrite comm -own_valid_r. Qed.
......
......@@ -81,5 +81,5 @@ Lemma vs_alloc N P : ▷ P ={↑N}=> inv N P.
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).
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.
......@@ -97,16 +97,16 @@ Definition uPred_wand {M} := unseal uPred_wand_aux M.
Definition uPred_wand_eq :
@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) |}.
Next Obligation.
intros M; naive_solver eauto using uPred_mono, @cmra_core_monoN.
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_always {M} := unseal uPred_always_aux M.
Definition uPred_always_eq :
@uPred_always = @uPred_always_def := seal_eq uPred_always_aux.
Definition uPred_persistently_aux : seal (@uPred_persistently_def). by eexists. Qed.
Definition uPred_persistently {M} := unseal uPred_persistently_aux M.
Definition uPred_persistently_eq :
@uPred_persistently = @uPred_persistently_def := seal_eq uPred_persistently_aux.
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 |}.
......@@ -176,7 +176,7 @@ Notation "∀ x .. y , P" :=
Notation "∃ x .. y , P" :=
(uPred_exist (λ x, .. (uPred_exist (λ y, P)) ..)%I)
(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.
Notation "▷ P" := (uPred_later P)
(at level 20, right associativity) : uPred_scope.
......@@ -198,7 +198,7 @@ Notation "P -∗ Q" := (P ⊢ Q)
Module uPred.
Definition unseal_eqs :=
(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).
Ltac unseal := rewrite !unseal_eqs /=.
......@@ -295,13 +295,13 @@ Proof.
Qed.
Global Instance later_proper' :
Proper (() ==> ()) (@uPred_later M) := ne_proper _.
Global Instance always_ne : NonExpansive (@uPred_always M).
Global Instance persistently_ne : NonExpansive (@uPred_persistently M).
Proof.
intros n P1 P2 HP.
unseal; split=> n' x; split; apply HP; eauto using @cmra_core_validN.
Qed.
Global Instance always_proper :
Proper (() ==> ()) (@uPred_always M) := ne_proper _.
Global Instance persistently_proper :
Proper (() ==> ()) (@uPred_persistently M) := ne_proper _.
Global Instance ownM_ne : NonExpansive (@uPred_ownM M).
Proof.
intros n a b Ha.
......@@ -422,22 +422,22 @@ Proof.
Qed.
(* 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.
Lemma always_elim P : P P.
Lemma persistently_elim P : P P.
Proof.
unseal; split=> n x ? /=.
eauto using uPred_mono, @cmra_included_core, cmra_included_includedN.
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.
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.
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.
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.
unseal; split=> n x ? [??]; exists (core x), x; simpl in *.
by rewrite cmra_core_l cmra_core_idemp.
......@@ -475,7 +475,7 @@ Proof.
intros [|n'] x' ????; [|done].
eauto using uPred_closed, uPred_mono, cmra_included_includedN.
Qed.
Lemma always_later P : P P.
Lemma persistently_later P : P P.
Proof. by unseal. Qed.
(* Own *)
......@@ -489,7 +489,7 @@ Proof.
by rewrite (assoc op _ z1) -(comm op z1) (assoc op z1)
-(assoc op _ a2) (comm op z1) -Hy1 -Hy2.
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.
split=> n x /=; unseal; intros Hx. simpl. by apply cmra_core_monoN.
Qed.
......@@ -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.
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.
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.
Lemma cmra_valid_weaken {A : cmraT} (a b : A) : (a b) a.
Proof. unseal; split=> n x _; apply cmra_validN_op_l. Qed.
......
......@@ -37,7 +37,7 @@ Global Instance ht_proper E :
Proof. solve_proper. Qed.
Lemma ht_mono E P P' Φ Φ' 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 :
Proper (flip () ==> eq ==> pointwise_relation _ () ==> ()) (ht E).
Proof. solve_proper. Qed.
......
......@@ -283,7 +283,7 @@ Section proofmode_classes.
ElimModal (|={E}=> P) P (WP e @ E {{ Φ }}) (WP e @ E {{ Φ }}).
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 Φ :
atomic e
ElimModal (|={E1,E2}=> P) P
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ Existing Instance Or_r | 10.
Class FromAssumption {M} (p : bool) (P Q : uPred M) :=
from_assumption : ?p P Q.
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 *)
Hint Mode FromAssumption + + - - : typeclass_instances.
......@@ -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.
Proof.
intros [?|?] ?; rewrite /FromAnd.
- by rewrite always_and_sep_l.
- by rewrite always_and_sep_r.
- by rewrite persistently_and_sep_l.
- by rewrite persistently_and_sep_r.
Qed.
Class IntoAnd {M} (p : bool) (P Q1 Q2 : uPred M) :=
......
This diff is collapsed.
......@@ -802,8 +802,8 @@ Local Tactic Notation "iExistDestruct" constr(H)
(** * Always *)
Tactic Notation "iAlways":=
iStartProof;
apply tac_always_intro; env_cbv
|| fail "iAlways: the goal is not an always modality".
apply tac_persistently_intro; env_cbv
|| fail "iAlways: the goal is not an persistently modality".
(** * Later *)
Tactic Notation "iNext" open_constr(n) :=
......@@ -1217,7 +1217,7 @@ Instance copy_destruct_impl {M} (P Q : uPred M) :
CopyDestruct Q CopyDestruct (P Q).
Instance copy_destruct_wand {M} (P Q : uPred M) :
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).
Tactic Notation "iDestructCore" open_constr(lem) "as" constr(p) tactic(tac) :=
......
......@@ -177,7 +177,7 @@ Lemma test_iFrame_persistent (P Q : uPred M) :
P - Q - (P P) (P Q Q).
Proof. iIntros "#HP". iFrame "HP". iIntros "$". Qed.
Lemma test_iSplit_always P Q : P - (P P).
Lemma test_iSplit_persistently P Q : P - (P P).
Proof. iIntros "#?". by iSplit. Qed.
Lemma test_iSpecialize_persistent P Q :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment