From 61edcac5df99a8aafaff3d99431c516d7d36980e Mon Sep 17 00:00:00 2001 From: Ralf Jung <jung@mpi-sws.org> Date: Thu, 26 Oct 2017 11:23:17 +0200 Subject: [PATCH] fix for latest Iris --- theories/lang/heap.v | 10 +++++----- theories/lang/lib/arc.v | 6 +++--- theories/lang/proofmode.v | 2 +- theories/lifetime/at_borrow.v | 2 +- theories/lifetime/frac_borrow.v | 2 +- theories/lifetime/lifetime.v | 4 ++-- theories/lifetime/lifetime_sig.v | 16 ++++++++-------- theories/lifetime/model/borrow_sep.v | 6 +++--- theories/lifetime/model/definitions.v | 16 ++++++++-------- theories/lifetime/na_borrow.v | 2 +- theories/typing/fixpoint.v | 2 +- theories/typing/lft_contexts.v | 2 +- theories/typing/lib/rc/rc.v | 2 +- theories/typing/own.v | 2 +- theories/typing/sum.v | 2 +- theories/typing/type.v | 12 ++++++------ theories/typing/type_context.v | 2 +- theories/typing/util.v | 2 +- 18 files changed, 46 insertions(+), 46 deletions(-) diff --git a/theories/lang/heap.v b/theories/lang/heap.v index 6523f643..796a8557 100644 --- a/theories/lang/heap.v +++ b/theories/lang/heap.v @@ -112,7 +112,7 @@ Section heap. Implicit Types E : coPset. (** General properties of mapsto and freeable *) - Global Instance heap_mapsto_timeless l q v : TimelessP (l↦{q}v). + Global Instance heap_mapsto_timeless l q v : Timeless (l↦{q}v). Proof. rewrite heap_mapsto_eq /heap_mapsto_def. apply _. Qed. Global Instance heap_mapsto_fractional l v: Fractional (λ q, l ↦{q} v)%I. @@ -124,7 +124,7 @@ Section heap. AsFractional (l ↦{q} v) (λ q, l ↦{q} v)%I q. Proof. split. done. apply _. Qed. - Global Instance heap_mapsto_vec_timeless l q vl : TimelessP (l ↦∗{q} vl). + Global Instance heap_mapsto_vec_timeless l q vl : Timeless (l ↦∗{q} vl). Proof. rewrite /heap_mapsto_vec. apply _. Qed. Global Instance heap_mapsto_vec_fractional l vl: Fractional (λ q, l ↦∗{q} vl)%I. @@ -136,7 +136,7 @@ Section heap. AsFractional (l ↦∗{q} vl) (λ q, l ↦∗{q} vl)%I q. Proof. split. done. apply _. Qed. - Global Instance heap_freeable_timeless q l n : TimelessP (†{q}l…n). + Global Instance heap_freeable_timeless q l n : Timeless (†{q}l…n). Proof. rewrite heap_freeable_eq /heap_freeable_def. apply _. Qed. Lemma heap_mapsto_agree l q1 q2 v1 v2 : l ↦{q1} v1 ∗ l ↦{q2} v2 ⊢ ⌜v1 = v2âŒ. @@ -219,7 +219,7 @@ Section heap. Qed. Global Instance heap_mapsto_pred_fractional l (P : list val → iProp Σ): - (∀ vl, PersistentP (P vl)) → Fractional (λ q, l ↦∗{q}: P)%I. + (∀ vl, Persistent (P vl)) → Fractional (λ q, l ↦∗{q}: P)%I. Proof. intros p q q'. iSplit. - iIntros "H". iDestruct "H" as (vl) "[[Hown1 Hown2] #HP]". @@ -242,7 +242,7 @@ Section heap. rewrite drop_ge; first by rewrite app_nil_r. by rewrite -Heq. Qed. Global Instance heap_mapsto_pred_as_fractional l q (P : list val → iProp Σ): - (∀ vl, PersistentP (P vl)) → AsFractional (l ↦∗{q}: P) (λ q, l ↦∗{q}: P)%I q. + (∀ vl, Persistent (P vl)) → AsFractional (l ↦∗{q}: P) (λ q, l ↦∗{q}: P)%I q. Proof. split. done. apply _. Qed. Lemma inter_lookup_Some i j (n : nat): diff --git a/theories/lang/lib/arc.v b/theories/lang/lib/arc.v index 10ec7bbe..38db542c 100644 --- a/theories/lang/lib/arc.v +++ b/theories/lang/lib/arc.v @@ -122,8 +122,8 @@ Section def. Definition weak_tok γ : iProp Σ := own γ (â—¯ (None, 1%nat)). - Global Instance arc_tok_timeless γ q : TimelessP (arc_tok γ q) := _. - Global Instance weak_tok_timeless γ : TimelessP (weak_tok γ) := _. + Global Instance arc_tok_timeless γ q : Timeless (arc_tok γ q) := _. + Global Instance weak_tok_timeless γ : Timeless (weak_tok γ) := _. Definition arc_inv (γ : gname) (l : loc) : iProp Σ := (∃ st : arc_stR, own γ (â— st) ∗ @@ -142,7 +142,7 @@ Section def. Definition is_arc (γ : gname) (l : loc) : iProp Σ := inv N (arc_inv γ l). - Global Instance is_arc_persistent γ l : PersistentP (is_arc γ l) := _. + Global Instance is_arc_persistent γ l : Persistent (is_arc γ l) := _. Definition arc_tok_acc (γ : gname) P E : iProp Σ := (â–¡ (P ={E,∅}=∗ ∃ q, arc_tok γ q ∗ (arc_tok γ q ={∅,E}=∗ P)))%I. diff --git a/theories/lang/proofmode.v b/theories/lang/proofmode.v index d817658d..2a2afc16 100644 --- a/theories/lang/proofmode.v +++ b/theories/lang/proofmode.v @@ -161,7 +161,7 @@ Lemma tac_wp_alloc Δ Δ' E j1 j2 n Φ : Δ ⊢ WP Alloc (Lit $ LitInt n) @ E {{ Φ }}. Proof. intros ?? HΔ. rewrite -wp_fupd. eapply wand_apply; first exact:wp_alloc. - rewrite -always_and_sep_l. apply and_intro; first done. + rewrite -and_sep_l. apply and_intro; first done. rewrite into_laterN_env_sound; apply later_mono, forall_intro=> l. apply forall_intro=>sz. apply forall_intro=> vl. apply wand_intro_l. rewrite -assoc. apply pure_elim_sep_l=> Hn. apply wand_elim_r'. diff --git a/theories/lifetime/at_borrow.v b/theories/lifetime/at_borrow.v index 4148b93e..b9fef2cf 100644 --- a/theories/lifetime/at_borrow.v +++ b/theories/lifetime/at_borrow.v @@ -27,7 +27,7 @@ Section atomic_bors. iApply (idx_bor_iff with "HPP' HP"). Qed. - Global Instance at_bor_persistent : PersistentP (&at{κ, N} P) := _. + Global Instance at_bor_persistent : Persistent (&at{κ, N} P) := _. Lemma bor_share E κ : N ⊥ lftN → &{κ}P ={E}=∗ &at{κ, N}P. diff --git a/theories/lifetime/frac_borrow.v b/theories/lifetime/frac_borrow.v index d700003c..f7c31e84 100644 --- a/theories/lifetime/frac_borrow.v +++ b/theories/lifetime/frac_borrow.v @@ -34,7 +34,7 @@ Section frac_bor. iSplit; iIntros "H"; iDestruct "H" as (q) "[H ?]"; iExists q; iFrame; by iApply "Hφφ'". Qed. - Global Instance frac_bor_persistent κ : PersistentP (&frac{κ}φ) := _. + Global Instance frac_bor_persistent κ : Persistent (&frac{κ}φ) := _. Lemma bor_fracture E κ : ↑lftN ⊆ E → lft_ctx -∗ &{κ}(φ 1%Qp) ={E}=∗ &frac{κ}φ. diff --git a/theories/lifetime/lifetime.v b/theories/lifetime/lifetime.v index e5c15254..a05aa8af 100644 --- a/theories/lifetime/lifetime.v +++ b/theories/lifetime/lifetime.v @@ -119,7 +119,7 @@ Proof. iModIntro. iNext. iApply ("Hclose" with "[] HP"). by iIntros "!> $". Qed. -Lemma bor_persistent P `{!PersistentP P} E κ : +Lemma bor_persistent P `{!Persistent P} E κ : ↑lftN ⊆ E → lft_ctx -∗ &{κ}P ={E}=∗ â–· P ∨ [†κ]. Proof. @@ -129,7 +129,7 @@ Proof. - iMod "Hclose" as "_". auto. Qed. -Lemma bor_persistent_tok P `{!PersistentP P} E κ q : +Lemma bor_persistent_tok P `{!Persistent P} E κ q : ↑lftN ⊆ E → lft_ctx -∗ &{κ}P -∗ q.[κ] ={E}=∗ â–· P ∗ q.[κ]. Proof. diff --git a/theories/lifetime/lifetime_sig.v b/theories/lifetime/lifetime_sig.v index 4ac1bd85..78f08a31 100644 --- a/theories/lifetime/lifetime_sig.v +++ b/theories/lifetime/lifetime_sig.v @@ -59,14 +59,14 @@ Module Type lifetime_sig. Global Declare Instance lft_intersect_left_id : LeftId eq static lft_intersect. Global Declare Instance lft_intersect_right_id : RightId eq static lft_intersect. - Global Declare Instance lft_ctx_persistent : PersistentP lft_ctx. - Global Declare Instance lft_dead_persistent κ : PersistentP ([†κ]). - Global Declare Instance lft_incl_persistent κ κ' : PersistentP (κ ⊑ κ'). - Global Declare Instance idx_bor_persistent κ i P : PersistentP (&{κ,i} P). - - Global Declare Instance lft_tok_timeless q κ : TimelessP (q.[κ]). - Global Declare Instance lft_dead_timeless κ : TimelessP ([†κ]). - Global Declare Instance idx_bor_own_timeless q i : TimelessP (idx_bor_own q i). + Global Declare Instance lft_ctx_persistent : Persistent lft_ctx. + Global Declare Instance lft_dead_persistent κ : Persistent ([†κ]). + Global Declare Instance lft_incl_persistent κ κ' : Persistent (κ ⊑ κ'). + Global Declare Instance idx_bor_persistent κ i P : Persistent (&{κ,i} P). + + Global Declare Instance lft_tok_timeless q κ : Timeless (q.[κ]). + Global Declare Instance lft_dead_timeless κ : Timeless ([†κ]). + Global Declare Instance idx_bor_own_timeless q i : Timeless (idx_bor_own q i). Global Instance idx_bor_params : Params (@idx_bor) 5. Global Instance bor_params : Params (@bor) 4. diff --git a/theories/lifetime/model/borrow_sep.v b/theories/lifetime/model/borrow_sep.v index fd37a3f7..4c8c24fb 100644 --- a/theories/lifetime/model/borrow_sep.v +++ b/theories/lifetime/model/borrow_sep.v @@ -98,8 +98,8 @@ Proof. iDestruct (own_bor_valid_2 with "Hown Hbor2") as %[EQB2%to_borUR_included _]%auth_valid_discrete_2. iAssert ⌜j1 ≠j2âŒ%I with "[#]" as %Hj1j2. - { iIntros (->). - iDestruct (own_bor_valid_2 with "Hbor1 Hbor2") as %Hj1j2%auth_valid_discrete. + { iDestruct (own_bor_valid_2 with "Hbor1 Hbor2") as %Hj1j2%auth_valid_discrete. + iPureIntro. iIntros (->). (* FIXME this used to work without iPureIntro. *) exfalso. revert Hj1j2. rewrite /= op_singleton singleton_valid. by intros [[]]. } iMod (slice_combine _ _ true with "Hslice1 Hslice2 Hbox") @@ -138,4 +138,4 @@ Proof. iRight. iSplit; last by auto. iExists _. iFrame. } unfold bor. iExists _. iFrame. iApply (lft_incl_glb with "Hκ1 Hκ2"). Qed. -End borrow. \ No newline at end of file +End borrow. diff --git a/theories/lifetime/model/definitions.v b/theories/lifetime/model/definitions.v index 41545ef9..136adc2b 100644 --- a/theories/lifetime/model/definitions.v +++ b/theories/lifetime/model/definitions.v @@ -320,23 +320,23 @@ Proof. solve_contractive. Qed. Global Instance bor_proper κ : Proper ((≡) ==> (≡)) (bor κ). Proof. apply (ne_proper _). Qed. -(*** PersistentP and TimelessP and instances *) -Global Instance lft_tok_timeless q κ : TimelessP q.[κ]. +(*** Persistent and Timeless and instances *) +Global Instance lft_tok_timeless q κ : Timeless q.[κ]. Proof. rewrite /lft_tok. apply _. Qed. -Global Instance lft_dead_persistent κ : PersistentP [†κ]. +Global Instance lft_dead_persistent κ : Persistent [†κ]. Proof. rewrite /lft_dead. apply _. Qed. -Global Instance lft_dead_timeless κ : TimelessP [†κ]. +Global Instance lft_dead_timeless κ : Timeless [†κ]. Proof. rewrite /lft_dead. apply _. Qed. -Global Instance lft_incl_persistent κ κ' : PersistentP (κ ⊑ κ'). +Global Instance lft_incl_persistent κ κ' : Persistent (κ ⊑ κ'). Proof. rewrite /lft_incl. apply _. Qed. -Global Instance idx_bor_persistent κ i P : PersistentP (&{κ,i} P). +Global Instance idx_bor_persistent κ i P : Persistent (&{κ,i} P). Proof. rewrite /idx_bor. apply _. Qed. -Global Instance idx_bor_own_timeless q i : TimelessP (idx_bor_own q i). +Global Instance idx_bor_own_timeless q i : Timeless (idx_bor_own q i). Proof. rewrite /idx_bor_own. apply _. Qed. -Global Instance lft_ctx_persistent : PersistentP lft_ctx. +Global Instance lft_ctx_persistent : Persistent lft_ctx. Proof. rewrite /lft_ctx. apply _. Qed. End basic_properties. diff --git a/theories/lifetime/na_borrow.v b/theories/lifetime/na_borrow.v index 64adfc2c..e3864ebd 100644 --- a/theories/lifetime/na_borrow.v +++ b/theories/lifetime/na_borrow.v @@ -28,7 +28,7 @@ Section na_bor. iApply (idx_bor_iff with "HPP' HP"). Qed. - Global Instance na_bor_persistent κ : PersistentP (&na{κ,tid,N} P) := _. + Global Instance na_bor_persistent κ : Persistent (&na{κ,tid,N} P) := _. Lemma bor_na κ E : ↑lftN ⊆ E → &{κ}P ={E}=∗ &na{κ,tid,N}P. Proof. diff --git a/theories/typing/fixpoint.v b/theories/typing/fixpoint.v index 847cac84..fb89f3fa 100644 --- a/theories/typing/fixpoint.v +++ b/theories/typing/fixpoint.v @@ -60,7 +60,7 @@ Section fixpoint. eapply (limit_preserving_ext (λ _, _ ∧ _)). { split; (intros [H1 H2]; split; [apply H1|apply H2]). } apply limit_preserving_and; repeat (apply limit_preserving_forall=> ?). - + apply uPred.limit_preserving_PersistentP; solve_proper. + + apply uPred.limit_preserving_Persistent; solve_proper. + apply limit_preserving_impl, uPred.limit_preserving_entails; solve_proper_core ltac:(fun _ => eapply ty_size_ne || f_equiv). Qed. diff --git a/theories/typing/lft_contexts.v b/theories/typing/lft_contexts.v index 4c81124f..d1506438 100644 --- a/theories/typing/lft_contexts.v +++ b/theories/typing/lft_contexts.v @@ -36,7 +36,7 @@ Section lft_contexts. Proper ((≡ₚ) ==> (⊣⊢)) elctx_interp. Proof. intros ???. by apply big_opL_permutation. Qed. Global Instance elctx_interp_persistent E : - PersistentP (elctx_interp E). + Persistent (elctx_interp E). Proof. apply _. Qed. (* Local lifetime contexts. *) diff --git a/theories/typing/lib/rc/rc.v b/theories/typing/lib/rc/rc.v index dbc6ede2..be11f559 100644 --- a/theories/typing/lib/rc/rc.v +++ b/theories/typing/lib/rc/rc.v @@ -88,7 +88,7 @@ Section rc. (ty.(ty_shr) ν tid (l +â‚— 2) ∨ [†ν]) ∗ â–¡ (1.[ν] ={↑lftN,∅}â–·=∗ [†ν]))%I. - Global Instance rc_persist_persistent : PersistentP (rc_persist tid ν γ l ty). + Global Instance rc_persist_persistent : Persistent (rc_persist tid ν γ l ty). Proof. unfold rc_persist, tc_opaque. apply _. Qed. Global Instance rc_persist_ne ν γ l n : diff --git a/theories/typing/own.v b/theories/typing/own.v index 9d6b85b4..d8111cdc 100644 --- a/theories/typing/own.v +++ b/theories/typing/own.v @@ -17,7 +17,7 @@ Section own. end%I. Next Obligation. intros _ _ _ sz0 ? n ?. by apply Qcmult_pos_pos. Qed. Arguments freeable_sz : simpl never. - Global Instance freable_sz_timeless n sz l : TimelessP (freeable_sz n sz l). + Global Instance freable_sz_timeless n sz l : Timeless (freeable_sz n sz l). Proof. destruct sz, n; apply _. Qed. Lemma freeable_sz_full n l : freeable_sz n n l ⊣⊢ †{1}l…n ∨ ⌜Z.of_nat n = 0âŒ. diff --git a/theories/typing/sum.v b/theories/typing/sum.v index 6ad1ecb4..107c3b04 100644 --- a/theories/typing/sum.v +++ b/theories/typing/sum.v @@ -178,7 +178,7 @@ Section sum. Proof. intros HFA. split. - intros tid vl. - cut (∀ i vl', PersistentP (ty_own (nth i tyl emp0) tid vl')). by apply _. + cut (∀ i vl', Persistent (ty_own (nth i tyl emp0) tid vl')). by apply _. intros. apply @copy_persistent. edestruct nth_in_or_default as [| ->]; [by eapply List.Forall_forall| ]. split; first by apply _. iIntros (????????) "? []". diff --git a/theories/typing/type.v b/theories/typing/type.v index 73f80838..2545c45f 100644 --- a/theories/typing/type.v +++ b/theories/typing/type.v @@ -24,7 +24,7 @@ Record type `{typeG Σ} := ty_own : thread_id → list val → iProp Σ; ty_shr : lft → thread_id → loc → iProp Σ; - ty_shr_persistent κ tid l : PersistentP (ty_shr κ tid l); + ty_shr_persistent κ tid l : Persistent (ty_shr κ tid l); ty_size_eq tid vl : ty_own tid vl -∗ ⌜length vl = ty_sizeâŒ; (* The mask for starting the sharing does /not/ include the @@ -116,7 +116,7 @@ Qed. Record simple_type `{typeG Σ} := { st_own : thread_id → list val → iProp Σ; st_size_eq tid vl : st_own tid vl -∗ ⌜length vl = 1%natâŒ; - st_own_persistent tid vl : PersistentP (st_own tid vl) }. + st_own_persistent tid vl : Persistent (st_own tid vl) }. Existing Instance st_own_persistent. Instance: Params (@st_own) 2. @@ -170,7 +170,7 @@ Section ofe. (prodC natC (thread_id -c> list val -c> iProp Σ)) (lft -c> thread_id -c> loc -c> iProp Σ). Let P (x : T) : Prop := - (∀ κ tid l, PersistentP (x.2 κ tid l)) ∧ + (∀ κ tid l, Persistent (x.2 κ tid l)) ∧ (∀ tid vl, x.1.2 tid vl -∗ ⌜length vl = x.1.1âŒ) ∧ (∀ E κ l tid q, lftE ⊆ E → lft_ctx -∗ &{κ} (l ↦∗: λ vs, x.1.2 tid vs) -∗ @@ -215,7 +215,7 @@ Section ofe. - by intros []. - (* TODO: automate this *) repeat apply limit_preserving_and; repeat (apply limit_preserving_forall; intros ?). - + apply uPred.limit_preserving_PersistentP=> n ty1 ty2 Hty; apply Hty. + + apply uPred.limit_preserving_Persistent=> n ty1 ty2 Hty; apply Hty. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty. apply Hty. by rewrite Hty. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty; repeat f_equiv; apply Hty. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty; repeat f_equiv; apply Hty. @@ -390,7 +390,7 @@ Fixpoint shr_locsE (l : loc) (n : nat) : coPset := end. Class Copy `{typeG Σ} (t : type) := { - copy_persistent tid vl : PersistentP (t.(ty_own) tid vl); + copy_persistent tid vl : Persistent (t.(ty_own) tid vl); copy_shr_acc κ tid E F l q : lftE ∪ ↑shrN ⊆ E → shr_locsE l (t.(ty_size) + 1) ⊆ F → lft_ctx -∗ t.(ty_shr) κ tid l -∗ na_own tid F -∗ q.[κ] ={E}=∗ @@ -545,7 +545,7 @@ Section subtyping. rewrite /type_incl. repeat ((by auto) || f_equiv). Qed. - Global Instance type_incl_persistent ty1 ty2 : PersistentP (type_incl ty1 ty2) := _. + Global Instance type_incl_persistent ty1 ty2 : Persistent (type_incl ty1 ty2) := _. Lemma type_incl_refl ty : type_incl ty ty. Proof. iSplit; first done. iSplit; iAlways; iIntros; done. Qed. diff --git a/theories/typing/type_context.v b/theories/typing/type_context.v index 6e5ec879..aa879676 100644 --- a/theories/typing/type_context.v +++ b/theories/typing/type_context.v @@ -135,7 +135,7 @@ Section type_context. (** Copy typing contexts *) Class CopyC (T : tctx) := - copyc_persistent tid : PersistentP (tctx_interp tid T). + copyc_persistent tid : Persistent (tctx_interp tid T). Global Existing Instances copyc_persistent. Global Instance tctx_nil_copy : CopyC []. diff --git a/theories/typing/util.v b/theories/typing/util.v index 1b907a64..9dae5dac 100644 --- a/theories/typing/util.v +++ b/theories/typing/util.v @@ -19,7 +19,7 @@ Section util. part. Lemma delay_borrow_step : - lfeE ⊆ N → (∀ x, PersistentP (Post x)) → + lfeE ⊆ N → (∀ x, Persistent (Post x)) → lft_ctx -∗ &{κ} P -∗ â–¡ (∀ x, &{κ} P -∗ Pre x -∗ Frame x ={F1 x,F2 x}â–·=∗ Post x ∗ Frame x) ={N}=∗ â–¡ (∀ x, Pre x -∗ Frame x ={F1 x,F2 x}â–·=∗ Post x ∗ Frame x). -- GitLab