From ee12aa643d208db5cce8e600e9a7a1eee9fa1023 Mon Sep 17 00:00:00 2001 From: Ralf Jung <jung@mpi-sws.org> Date: Mon, 19 Mar 2018 16:22:38 +0100 Subject: [PATCH] rename affinely_persistently -> intuitionistically; and make it a TC-opaque definition --- theories/base_logic/base_logic.v | 2 +- theories/base_logic/derived.v | 6 +- .../base_logic/lib/fancy_updates_from_vs.v | 2 +- theories/bi/big_op.v | 12 +- theories/bi/derived_connectives.v | 20 +- theories/bi/derived_laws.v | 226 +++++++++++------- theories/bi/embedding.v | 4 + theories/bi/fixpoint.v | 3 +- theories/bi/lib/fractional.v | 2 +- theories/bi/monpred.v | 4 + theories/bi/plainly.v | 14 +- theories/heap_lang/lib/increment.v | 2 +- theories/proofmode/class_instances.v | 161 +++++++------ theories/proofmode/coq_tactics.v | 137 ++++++----- theories/proofmode/modalities.v | 40 ++-- theories/proofmode/modality_instances.v | 14 +- theories/proofmode/monpred.v | 8 +- theories/proofmode/tactics.v | 1 + theories/tests/proofmode_monpred.v | 1 - 19 files changed, 377 insertions(+), 282 deletions(-) diff --git a/theories/base_logic/base_logic.v b/theories/base_logic/base_logic.v index 4aecb160d..edcc029b4 100644 --- a/theories/base_logic/base_logic.v +++ b/theories/base_logic/base_logic.v @@ -73,7 +73,7 @@ Qed. Global Instance into_and_ownM p (a b1 b2 : M) : IsOp a b1 b2 → IntoAnd p (uPred_ownM a) (uPred_ownM b1) (uPred_ownM b2). Proof. - intros. apply affinely_persistently_if_mono. by rewrite (is_op a) ownM_op sep_and. + intros. apply intuitionistically_if_mono. by rewrite (is_op a) ownM_op sep_and. Qed. Global Instance into_sep_ownM (a b1 b2 : M) : diff --git a/theories/base_logic/derived.v b/theories/base_logic/derived.v index 2bbd331ba..2f4352e1d 100644 --- a/theories/base_logic/derived.v +++ b/theories/base_logic/derived.v @@ -20,7 +20,8 @@ Lemma persistently_cmra_valid_1 {A : cmraT} (a : A) : ✓ a ⊢ <pers> (✓ a : Proof. by rewrite {1}plainly_cmra_valid_1 plainly_elim_persistently. Qed. Lemma affinely_persistently_ownM (a : M) : CoreId a → â–¡ uPred_ownM a ⊣⊢ uPred_ownM a. Proof. - rewrite affine_affinely=>?; apply (anti_symm _); [by rewrite persistently_elim|]. + rewrite /bi_intuitionistically affine_affinely=>?; apply (anti_symm _); + [by rewrite persistently_elim|]. by rewrite {1}persistently_ownM_core core_id_core. Qed. Lemma ownM_invalid (a : M) : ¬ ✓{0} a → uPred_ownM a ⊢ False. @@ -33,7 +34,8 @@ Lemma plainly_cmra_valid {A : cmraT} (a : A) : ■✓ a ⊣⊢ ✓ a. Proof. apply (anti_symm _), plainly_cmra_valid_1. apply plainly_elim, _. Qed. Lemma affinely_persistently_cmra_valid {A : cmraT} (a : A) : â–¡ ✓ a ⊣⊢ ✓ a. Proof. - rewrite affine_affinely. intros; apply (anti_symm _); first by rewrite persistently_elim. + rewrite /bi_intuitionistically affine_affinely. intros; apply (anti_symm _); + first by rewrite persistently_elim. apply:persistently_cmra_valid_1. Qed. Lemma bupd_ownM_update x y : x ~~> y → uPred_ownM x ⊢ |==> uPred_ownM y. diff --git a/theories/base_logic/lib/fancy_updates_from_vs.v b/theories/base_logic/lib/fancy_updates_from_vs.v index f8e87f2f8..b47fa0df6 100644 --- a/theories/base_logic/lib/fancy_updates_from_vs.v +++ b/theories/base_logic/lib/fancy_updates_from_vs.v @@ -68,4 +68,4 @@ Proof. iIntros "[Hvs HQ]". iDestruct "Hvs" as (R) "[HR Hvs]". iExists (R ∗ Q)%I. iFrame "HR HQ". by iApply vs_frame_r. Qed. -End fupd. \ No newline at end of file +End fupd. diff --git a/theories/bi/big_op.v b/theories/bi/big_op.v index a51063fdc..dc04b291a 100644 --- a/theories/bi/big_op.v +++ b/theories/bi/big_op.v @@ -150,10 +150,10 @@ Section sep_list. Proof. apply wand_intro_l. revert Φ Ψ. induction l as [|x l IH]=> Φ Ψ /=. { by rewrite sep_elim_r. } - rewrite affinely_persistently_sep_dup -assoc [(â–¡ _ ∗ _)%I]comm -!assoc assoc. + rewrite intuitionistically_sep_dup -assoc [(â–¡ _ ∗ _)%I]comm -!assoc assoc. apply sep_mono. - rewrite (forall_elim 0) (forall_elim x) pure_True // True_impl. - by rewrite affinely_persistently_elim wand_elim_l. + by rewrite intuitionistically_elim wand_elim_l. - rewrite comm -(IH (Φ ∘ S) (Ψ ∘ S)) /=. apply sep_mono_l, affinely_mono, persistently_mono. apply forall_intro=> k. by rewrite (forall_elim (S k)). @@ -423,10 +423,10 @@ Section gmap. Proof. apply wand_intro_l. induction m as [|i x m ? IH] using map_ind. { by rewrite sep_elim_r. } - rewrite !big_sepM_insert // affinely_persistently_sep_dup. + rewrite !big_sepM_insert // intuitionistically_sep_dup. rewrite -assoc [(â–¡ _ ∗ _)%I]comm -!assoc assoc. apply sep_mono. - rewrite (forall_elim i) (forall_elim x) pure_True ?lookup_insert //. - by rewrite True_impl affinely_persistently_elim wand_elim_l. + by rewrite True_impl intuitionistically_elim wand_elim_l. - rewrite comm -IH /=. apply sep_mono_l, affinely_mono, persistently_mono, forall_mono=> k. apply forall_mono=> y. apply impl_intro_l, pure_elim_l=> ?. @@ -584,10 +584,10 @@ Section gset. Proof. apply wand_intro_l. induction X as [|x X ? IH] using collection_ind_L. { by rewrite sep_elim_r. } - rewrite !big_sepS_insert // affinely_persistently_sep_dup. + rewrite !big_sepS_insert // intuitionistically_sep_dup. rewrite -assoc [(â–¡ _ ∗ _)%I]comm -!assoc assoc. apply sep_mono. - rewrite (forall_elim x) pure_True; last set_solver. - by rewrite True_impl affinely_persistently_elim wand_elim_l. + by rewrite True_impl intuitionistically_elim wand_elim_l. - rewrite comm -IH /=. apply sep_mono_l, affinely_mono, persistently_mono. apply forall_mono=> y. apply impl_intro_l, pure_elim_l=> ?. by rewrite pure_True ?True_impl; last set_solver. diff --git a/theories/bi/derived_connectives.v b/theories/bi/derived_connectives.v index a381402bf..5857b235e 100644 --- a/theories/bi/derived_connectives.v +++ b/theories/bi/derived_connectives.v @@ -26,9 +26,6 @@ Typeclasses Opaque bi_affinely. Notation "'<affine>' P" := (bi_affinely P) (at level 20, right associativity) : bi_scope. -Notation "â–¡ P" := (<affine> <pers> P)%I - (at level 20, right associativity) : bi_scope. - Class Affine {PROP : bi} (Q : PROP) := affine : Q ⊢ emp. Arguments Affine {_} _%I : simpl never. Arguments affine {_} _%I {_}. @@ -72,9 +69,22 @@ Notation "'<affine>?' p P" := (bi_affinely_if p P) (at level 20, p at level 9, P at level 20, right associativity, format "'<affine>?' p P") : bi_scope. -Notation "â–¡? p P" := (<affine>?p <pers>?p P)%I +Definition bi_intuitionistically {PROP : bi} (P : PROP) : PROP := + (<affine> <pers> P)%I. +Arguments bi_intuitionistically {_} _%I : simpl never. +Instance: Params (@bi_intuitionistically) 1. +Typeclasses Opaque bi_intuitionistically. +Notation "â–¡ P" := (bi_intuitionistically P)%I + (at level 20, right associativity) : bi_scope. + +Definition bi_intuitionistically_if {PROP : bi} (p : bool) (P : PROP) : PROP := + (if p then â–¡ P else P)%I. +Arguments bi_intuitionistically_if {_} !_ _%I /. +Instance: Params (@bi_intuitionistically_if) 2. +Typeclasses Opaque bi_intuitionistically_if. +Notation "'â–¡?' p P" := (bi_intuitionistically_if p P) (at level 20, p at level 9, P at level 20, - right associativity, format "â–¡? p P") : bi_scope. + right associativity, format "'â–¡?' p P") : bi_scope. Fixpoint bi_hexist {PROP : bi} {As} : himpl As PROP → PROP := match As return himpl As PROP → PROP with diff --git a/theories/bi/derived_laws.v b/theories/bi/derived_laws.v index a00d21347..f4802b066 100644 --- a/theories/bi/derived_laws.v +++ b/theories/bi/derived_laws.v @@ -879,7 +879,7 @@ Qed. Lemma impl_wand_persistently_2 P Q : (<pers> P -∗ Q) ⊢ (<pers> P → Q). Proof. apply impl_intro_l. by rewrite persistently_and_sep_l_1 wand_elim_r. Qed. -Section persistently_affinely_bi. +Section persistently_affine_bi. Context `{BiAffine PROP}. Lemma persistently_emp : <pers> emp ⊣⊢ emp. @@ -926,72 +926,114 @@ Section persistently_affinely_bi. - apply exist_elim=> R. apply impl_intro_l. by rewrite assoc persistently_and_sep_r persistently_elim wand_elim_r. Qed. -End persistently_affinely_bi. +End persistently_affine_bi. -(* The combined affinely persistently modality *) -Lemma affinely_persistently_elim P : â–¡ P ⊢ P. +(* The intuitionistic modality *) +Global Instance intuitionistically_ne : NonExpansive (@bi_intuitionistically PROP). +Proof. solve_proper. Qed. +Global Instance intuitionistically_proper : Proper ((⊣⊢) ==> (⊣⊢)) (@bi_intuitionistically PROP). +Proof. solve_proper. Qed. +Global Instance intuitionistically_mono' : Proper ((⊢) ==> (⊢)) (@bi_intuitionistically PROP). +Proof. solve_proper. Qed. +Global Instance intuitionistically_flip_mono' : + Proper (flip (⊢) ==> flip (⊢)) (@bi_intuitionistically PROP). +Proof. solve_proper. Qed. + +Lemma intuitionistically_elim P : â–¡ P ⊢ P. Proof. apply persistently_and_emp_elim. Qed. -Lemma affinely_persistently_intro' P Q : (â–¡ P ⊢ Q) → â–¡ P ⊢ â–¡ Q. -Proof. intros <-. by rewrite persistently_affinely persistently_idemp. Qed. +Lemma intuitionistically_elim_emp P : â–¡ P ⊢ emp. +Proof. rewrite /bi_intuitionistically affinely_elim_emp //. Qed. +Lemma intuitionistically_intro' P Q : (â–¡ P ⊢ Q) → â–¡ P ⊢ â–¡ Q. +Proof. + intros <-. + by rewrite /bi_intuitionistically persistently_affinely persistently_idemp. +Qed. -Lemma affinely_persistently_emp : â–¡ emp ⊣⊢ emp. +Lemma intuitionistically_emp : â–¡ emp ⊣⊢ emp. +Proof. + by rewrite /bi_intuitionistically -persistently_True_emp persistently_pure + affinely_True_emp affinely_emp. +Qed. +Lemma intuitionistically_True_emp : â–¡ True ⊣⊢ emp. Proof. - by rewrite -persistently_True_emp persistently_pure affinely_True_emp - affinely_emp. + rewrite -intuitionistically_emp /bi_intuitionistically + persistently_True_emp //. Qed. -Lemma affinely_persistently_and P Q : â–¡ (P ∧ Q) ⊣⊢ â–¡ P ∧ â–¡ Q. -Proof. by rewrite persistently_and affinely_and. Qed. -Lemma affinely_persistently_or P Q : â–¡ (P ∨ Q) ⊣⊢ â–¡ P ∨ â–¡ Q. -Proof. by rewrite persistently_or affinely_or. Qed. -Lemma affinely_persistently_exist {A} (Φ : A → PROP) : â–¡ (∃ x, Φ x) ⊣⊢ ∃ x, â–¡ Φ x. -Proof. by rewrite persistently_exist affinely_exist. Qed. -Lemma affinely_persistently_sep_2 P Q : â–¡ P ∗ â–¡ Q ⊢ â–¡ (P ∗ Q). -Proof. by rewrite affinely_sep_2 persistently_sep_2. Qed. -Lemma affinely_persistently_sep `{BiPositive PROP} P Q : â–¡ (P ∗ Q) ⊣⊢ â–¡ P ∗ â–¡ Q. -Proof. by rewrite -affinely_sep -persistently_sep. Qed. +Lemma intuitionistically_and P Q : â–¡ (P ∧ Q) ⊣⊢ â–¡ P ∧ â–¡ Q. +Proof. by rewrite /bi_intuitionistically persistently_and affinely_and. Qed. +Lemma intuitionistically_or P Q : â–¡ (P ∨ Q) ⊣⊢ â–¡ P ∨ â–¡ Q. +Proof. by rewrite /bi_intuitionistically persistently_or affinely_or. Qed. +Lemma intuitionistically_exist {A} (Φ : A → PROP) : â–¡ (∃ x, Φ x) ⊣⊢ ∃ x, â–¡ Φ x. +Proof. by rewrite /bi_intuitionistically persistently_exist affinely_exist. Qed. +Lemma intuitionistically_sep_2 P Q : â–¡ P ∗ â–¡ Q ⊢ â–¡ (P ∗ Q). +Proof. by rewrite /bi_intuitionistically affinely_sep_2 persistently_sep_2. Qed. +Lemma intuitionistically_sep `{BiPositive PROP} P Q : â–¡ (P ∗ Q) ⊣⊢ â–¡ P ∗ â–¡ Q. +Proof. by rewrite /bi_intuitionistically -affinely_sep -persistently_sep. Qed. -Lemma affinely_persistently_idemp P : â–¡ â–¡ P ⊣⊢ â–¡ P. -Proof. by rewrite persistently_affinely persistently_idemp. Qed. +Lemma intuitionistically_idemp P : â–¡ â–¡ P ⊣⊢ â–¡ P. +Proof. by rewrite /bi_intuitionistically persistently_affinely persistently_idemp. Qed. -Lemma persistently_and_affinely_sep_l P Q : <pers> P ∧ Q ⊣⊢ â–¡ P ∗ Q. +Lemma intuitionistically_persistently_1 P : â–¡ P ⊢ <pers> P. +Proof. rewrite /bi_intuitionistically affinely_elim //. Qed. +Lemma intuitionistically_persistently_persistently P : â–¡ <pers> P ⊣⊢ â–¡ P. +Proof. rewrite /bi_intuitionistically persistently_idemp //. Qed. + +Lemma intuitionistically_affinely P : â–¡ P ⊢ <affine> P. Proof. - apply (anti_symm _). + rewrite /bi_intuitionistically /bi_affinely. apply and_intro. + - rewrite and_elim_l //. + - apply persistently_and_emp_elim. +Qed. +Lemma intuitionistically_affinely_affinely P : â–¡ <affine> P ⊣⊢ â–¡ P. +Proof. rewrite /bi_intuitionistically persistently_affinely //. Qed. + +Lemma persistently_and_intuitionistically_sep_l P Q : <pers> P ∧ Q ⊣⊢ â–¡ P ∗ Q. +Proof. + rewrite /bi_intuitionistically. apply (anti_symm _). - by rewrite /bi_affinely -(comm bi_and (<pers> P)%I) -persistently_and_sep_assoc left_id. - apply and_intro. + by rewrite affinely_elim persistently_absorbing. + by rewrite affinely_elim_emp left_id. Qed. -Lemma persistently_and_affinely_sep_r P Q : P ∧ <pers> Q ⊣⊢ P ∗ â–¡ Q. -Proof. by rewrite !(comm _ P) persistently_and_affinely_sep_l. Qed. -Lemma and_sep_affinely_persistently P Q : â–¡ P ∧ â–¡ Q ⊣⊢ â–¡ P ∗ â–¡ Q. +Lemma persistently_and_intuitionistically_sep_r P Q : P ∧ <pers> Q ⊣⊢ P ∗ â–¡ Q. +Proof. by rewrite !(comm _ P) persistently_and_intuitionistically_sep_l. Qed. +Lemma and_sep_intuitionistically P Q : â–¡ P ∧ â–¡ Q ⊣⊢ â–¡ P ∗ â–¡ Q. Proof. - by rewrite -persistently_and_affinely_sep_l -affinely_and affinely_and_r. + by rewrite -persistently_and_intuitionistically_sep_l -affinely_and affinely_and_r. Qed. -Lemma affinely_persistently_sep_dup P : â–¡ P ⊣⊢ â–¡ P ∗ â–¡ P. +Lemma intuitionistically_sep_dup P : â–¡ P ⊣⊢ â–¡ P ∗ â–¡ P. Proof. - by rewrite -persistently_and_affinely_sep_l affinely_and_r idemp. + by rewrite -persistently_and_intuitionistically_sep_l affinely_and_r idemp. Qed. -Lemma impl_wand_affinely_persistently P Q : (<pers> P → Q) ⊣⊢ (â–¡ P -∗ Q). +Lemma impl_wand_intuitionistically P Q : (<pers> P → Q) ⊣⊢ (â–¡ P -∗ Q). Proof. apply (anti_symm (⊢)). - - apply wand_intro_l. by rewrite -persistently_and_affinely_sep_l impl_elim_r. - - apply impl_intro_l. by rewrite persistently_and_affinely_sep_l wand_elim_r. + - apply wand_intro_l. by rewrite -persistently_and_intuitionistically_sep_l impl_elim_r. + - apply impl_intro_l. by rewrite persistently_and_intuitionistically_sep_l wand_elim_r. Qed. -Lemma affinely_persistently_alt_fixpoint P : +Lemma intuitionistically_alt_fixpoint P : â–¡ P ⊣⊢ emp ∧ (P ∗ â–¡ P). Proof. apply (anti_symm (⊢)). - apply and_intro; first exact: affinely_elim_emp. - rewrite {1}affinely_persistently_sep_dup. apply sep_mono; last done. - apply affinely_persistently_elim. - - apply and_mono; first done. rewrite {2}persistently_alt_fixpoint. + rewrite {1}intuitionistically_sep_dup. apply sep_mono; last done. + apply intuitionistically_elim. + - apply and_mono; first done. rewrite /bi_intuitionistically {2}persistently_alt_fixpoint. apply sep_mono; first done. apply and_elim_r. Qed. + +Section bi_affine_intuitionistically. + Context `{BiAffine PROP}. + + Lemma intuitionistically_persistently P : â–¡ P ⊣⊢ <pers> P. + Proof. rewrite /bi_intuitionistically affine_affinely //. Qed. +End bi_affine_intuitionistically. + (* Conditional affinely modality *) Global Instance affinely_if_ne p : NonExpansive (@bi_affinely_if PROP p). Proof. solve_proper. Qed. @@ -1067,37 +1109,49 @@ Proof. destruct p; simpl; auto using persistently_sep. Qed. Lemma persistently_if_idemp p P : <pers>?p <pers>?p P ⊣⊢ <pers>?p P. Proof. destruct p; simpl; auto using persistently_idemp. Qed. -(* Conditional affinely persistently *) -Lemma affinely_persistently_if_mono p P Q : (P ⊢ Q) → â–¡?p P ⊢ â–¡?p Q. +(* Conditional intuitionistically *) +Global Instance intuitionistically_if_ne p : NonExpansive (@bi_intuitionistically_if PROP p). +Proof. solve_proper. Qed. +Global Instance intuitionistically_if_proper p : + Proper ((⊣⊢) ==> (⊣⊢)) (@bi_intuitionistically_if PROP p). +Proof. solve_proper. Qed. +Global Instance intuitionistically_if_mono' p : + Proper ((⊢) ==> (⊢)) (@bi_intuitionistically_if PROP p). +Proof. solve_proper. Qed. +Global Instance intuitionistically_if_flip_mono' p : + Proper (flip (⊢) ==> flip (⊢)) (@bi_intuitionistically_if PROP p). +Proof. solve_proper. Qed. + +Lemma intuitionistically_if_mono p P Q : (P ⊢ Q) → â–¡?p P ⊢ â–¡?p Q. Proof. by intros ->. Qed. -Lemma affinely_persistently_if_flag_mono (p q : bool) P : +Lemma intuitionistically_if_flag_mono (p q : bool) P : (q → p) → â–¡?p P ⊢ â–¡?q P. -Proof. destruct p, q; naive_solver auto using affinely_persistently_elim. Qed. - -Lemma affinely_persistently_if_elim p P : â–¡?p P ⊢ P. -Proof. destruct p; simpl; auto using affinely_persistently_elim. Qed. -Lemma affinely_persistently_affinely_persistently_if p P : â–¡ P ⊢ â–¡?p P. -Proof. destruct p; simpl; auto using affinely_persistently_elim. Qed. -Lemma affinely_persistently_if_intro' p P Q : (â–¡?p P ⊢ Q) → â–¡?p P ⊢ â–¡?p Q. -Proof. destruct p; simpl; auto using affinely_persistently_intro'. Qed. - -Lemma affinely_persistently_if_emp p : â–¡?p emp ⊣⊢ emp. -Proof. destruct p; simpl; auto using affinely_persistently_emp. Qed. -Lemma affinely_persistently_if_and p P Q : â–¡?p (P ∧ Q) ⊣⊢ â–¡?p P ∧ â–¡?p Q. -Proof. destruct p; simpl; auto using affinely_persistently_and. Qed. -Lemma affinely_persistently_if_or p P Q : â–¡?p (P ∨ Q) ⊣⊢ â–¡?p P ∨ â–¡?p Q. -Proof. destruct p; simpl; auto using affinely_persistently_or. Qed. -Lemma affinely_persistently_if_exist {A} p (Ψ : A → PROP) : +Proof. destruct p, q; naive_solver auto using intuitionistically_elim. Qed. + +Lemma intuitionistically_if_elim p P : â–¡?p P ⊢ P. +Proof. destruct p; simpl; auto using intuitionistically_elim. Qed. +Lemma intuitionistically_intuitionistically_if p P : â–¡ P ⊢ â–¡?p P. +Proof. destruct p; simpl; auto using intuitionistically_elim. Qed. +Lemma intuitionistically_if_intro' p P Q : (â–¡?p P ⊢ Q) → â–¡?p P ⊢ â–¡?p Q. +Proof. destruct p; simpl; auto using intuitionistically_intro'. Qed. + +Lemma intuitionistically_if_emp p : â–¡?p emp ⊣⊢ emp. +Proof. destruct p; simpl; auto using intuitionistically_emp. Qed. +Lemma intuitionistically_if_and p P Q : â–¡?p (P ∧ Q) ⊣⊢ â–¡?p P ∧ â–¡?p Q. +Proof. destruct p; simpl; auto using intuitionistically_and. Qed. +Lemma intuitionistically_if_or p P Q : â–¡?p (P ∨ Q) ⊣⊢ â–¡?p P ∨ â–¡?p Q. +Proof. destruct p; simpl; auto using intuitionistically_or. Qed. +Lemma intuitionistically_if_exist {A} p (Ψ : A → PROP) : (â–¡?p ∃ a, Ψ a) ⊣⊢ ∃ a, â–¡?p Ψ a. -Proof. destruct p; simpl; auto using affinely_persistently_exist. Qed. -Lemma affinely_persistently_if_sep_2 p P Q : â–¡?p P ∗ â–¡?p Q ⊢ â–¡?p (P ∗ Q). -Proof. destruct p; simpl; auto using affinely_persistently_sep_2. Qed. -Lemma affinely_persistently_if_sep `{BiPositive PROP} p P Q : +Proof. destruct p; simpl; auto using intuitionistically_exist. Qed. +Lemma intuitionistically_if_sep_2 p P Q : â–¡?p P ∗ â–¡?p Q ⊢ â–¡?p (P ∗ Q). +Proof. destruct p; simpl; auto using intuitionistically_sep_2. Qed. +Lemma intuitionistically_if_sep `{BiPositive PROP} p P Q : â–¡?p (P ∗ Q) ⊣⊢ â–¡?p P ∗ â–¡?p Q. -Proof. destruct p; simpl; auto using affinely_persistently_sep. Qed. +Proof. destruct p; simpl; auto using intuitionistically_sep. Qed. -Lemma affinely_persistently_if_idemp p P : â–¡?p â–¡?p P ⊣⊢ â–¡?p P. -Proof. destruct p; simpl; auto using affinely_persistently_idemp. Qed. +Lemma intuitionistically_if_idemp p P : â–¡?p â–¡?p P ⊣⊢ â–¡?p P. +Proof. destruct p; simpl; auto using intuitionistically_idemp. Qed. (* Properties of persistent propositions *) Global Instance Persistent_proper : Proper ((≡) ==> iff) (@Persistent PROP). @@ -1114,18 +1168,18 @@ Lemma persistently_intro P Q `{!Persistent P} : (P ⊢ Q) → P ⊢ <pers> Q. Proof. intros HP. by rewrite (persistent P) HP. Qed. Lemma persistent_and_affinely_sep_l_1 P Q `{!Persistent P} : P ∧ Q ⊢ <affine> P ∗ Q. Proof. - rewrite {1}(persistent_persistently_2 P) persistently_and_affinely_sep_l. - by rewrite -affinely_idemp affinely_persistently_elim. + rewrite {1}(persistent_persistently_2 P) persistently_and_intuitionistically_sep_l. + rewrite intuitionistically_affinely //. Qed. Lemma persistent_and_affinely_sep_r_1 P Q `{!Persistent Q} : P ∧ Q ⊢ P ∗ <affine> Q. Proof. by rewrite !(comm _ P) persistent_and_affinely_sep_l_1. Qed. Lemma persistent_and_affinely_sep_l P Q `{!Persistent P, !Absorbing P} : P ∧ Q ⊣⊢ <affine> P ∗ Q. -Proof. by rewrite -(persistent_persistently P) persistently_and_affinely_sep_l. Qed. +Proof. by rewrite -(persistent_persistently P) persistently_and_intuitionistically_sep_l. Qed. Lemma persistent_and_affinely_sep_r P Q `{!Persistent Q, !Absorbing Q} : P ∧ Q ⊣⊢ P ∗ <affine> Q. -Proof. by rewrite -(persistent_persistently Q) persistently_and_affinely_sep_r. Qed. +Proof. by rewrite -(persistent_persistently Q) persistently_and_intuitionistically_sep_r. Qed. Lemma persistent_and_sep_1 P Q `{HPQ : !TCOr (Persistent P) (Persistent Q)} : P ∧ Q ⊢ P ∗ Q. @@ -1143,24 +1197,24 @@ Proof. intros. rewrite -persistent_and_sep_1; auto. Qed. Lemma persistent_entails_r P Q `{!Persistent Q} : (P ⊢ Q) → P ⊢ P ∗ Q. Proof. intros. rewrite -persistent_and_sep_1; auto. Qed. -Lemma absorbingly_affinely_persistently P : <absorb> â–¡ P ⊣⊢ <pers> P. +Lemma absorbingly_intuitionistically P : <absorb> â–¡ P ⊣⊢ <pers> P. Proof. apply (anti_symm _). - - by rewrite affinely_elim absorbingly_persistently. - - rewrite -{1}(idemp bi_and (<pers> _)%I) persistently_and_affinely_sep_r. + - by rewrite intuitionistically_persistently_1 absorbingly_persistently. + - rewrite -{1}(idemp bi_and (<pers> _)%I) persistently_and_intuitionistically_sep_r. by rewrite {1} (True_intro (<pers> _)%I). Qed. Lemma persistent_absorbingly_affinely_2 P `{!Persistent P} : P ⊢ <absorb> <affine> P. Proof. - rewrite {1}(persistent P) -absorbingly_affinely_persistently. - by rewrite -{1}affinely_idemp affinely_persistently_elim. + rewrite {1}(persistent P) -absorbingly_intuitionistically. + by rewrite intuitionistically_affinely. Qed. Lemma persistent_absorbingly_affinely P `{!Persistent P, !Absorbing P} : <absorb> <affine> P ⊣⊢ P. Proof. - by rewrite -(persistent_persistently P) absorbingly_affinely_persistently. + by rewrite -(persistent_persistently P) absorbingly_intuitionistically. Qed. Lemma persistent_and_sep_assoc P `{!Persistent P, !Absorbing P} Q R : @@ -1205,6 +1259,8 @@ Global Instance sep_affine P Q : Affine P → Affine Q → Affine (P ∗ Q). Proof. rewrite /Affine=>-> ->. by rewrite left_id. Qed. Global Instance affinely_affine P : Affine (<affine> P). Proof. rewrite /bi_affinely. apply _. Qed. +Global Instance intuitionistically_affine P : Affine (â–¡ P). +Proof. rewrite /bi_intuitionistically. apply _. Qed. (* Absorbing instances *) Global Instance pure_absorbing φ : Absorbing (⌜φâŒ%I : PROP). @@ -1282,6 +1338,8 @@ Global Instance persistently_persistent P : Persistent (<pers> P). Proof. by rewrite /Persistent persistently_idemp. Qed. Global Instance affinely_persistent P : Persistent P → Persistent (<affine> P). Proof. rewrite /bi_affinely. apply _. Qed. +Global Instance intuitionistically_persistent P : Persistent (â–¡ P). +Proof. rewrite /bi_intuitionistically. apply _. Qed. Global Instance absorbingly_persistent P : Persistent P → Persistent (<absorb> P). Proof. rewrite /bi_absorbingly. apply _. Qed. Global Instance from_option_persistent {A} P (Ψ : A → PROP) (mx : option A) : @@ -1565,10 +1623,10 @@ Lemma later_persistently P : â–· <pers> P ⊣⊢ <pers> â–· P. Proof. apply (anti_symm _); auto using later_persistently_1, later_persistently_2. Qed. Lemma later_affinely_2 P : <affine> â–· P ⊢ â–· <affine> P. Proof. rewrite /bi_affinely later_and. auto using later_intro. Qed. -Lemma later_affinely_persistently_2 P : â–¡ â–· P ⊢ â–· â–¡ P. -Proof. by rewrite -later_persistently later_affinely_2. Qed. -Lemma later_affinely_persistently_if_2 p P : â–¡?p â–· P ⊢ â–· â–¡?p P. -Proof. destruct p; simpl; auto using later_affinely_persistently_2. Qed. +Lemma later_intuitionistically_2 P : â–¡ â–· P ⊢ â–· â–¡ P. +Proof. by rewrite /bi_intuitionistically -later_persistently later_affinely_2. Qed. +Lemma later_intuitionistically_if_2 p P : â–¡?p â–· P ⊢ â–· â–¡?p P. +Proof. destruct p; simpl; auto using later_intuitionistically_2. Qed. Lemma later_absorbingly P : â–· <absorb> P ⊣⊢ <absorb> â–· P. Proof. by rewrite /bi_absorbingly later_sep later_True. Qed. @@ -1632,10 +1690,10 @@ Lemma laterN_persistently n P : â–·^n <pers> P ⊣⊢ <pers> â–·^n P. Proof. induction n as [|n IH]; simpl; auto. by rewrite IH later_persistently. Qed. Lemma laterN_affinely_2 n P : <affine> â–·^n P ⊢ â–·^n <affine> P. Proof. rewrite /bi_affinely laterN_and. auto using laterN_intro. Qed. -Lemma laterN_affinely_persistently_2 n P : â–¡ â–·^n P ⊢ â–·^n â–¡ P. -Proof. by rewrite -laterN_persistently laterN_affinely_2. Qed. -Lemma laterN_affinely_persistently_if_2 n p P : â–¡?p â–·^n P ⊢ â–·^n â–¡?p P. -Proof. destruct p; simpl; auto using laterN_affinely_persistently_2. Qed. +Lemma laterN_intuitionistically_2 n P : â–¡ â–·^n P ⊢ â–·^n â–¡ P. +Proof. by rewrite /bi_intuitionistically -laterN_persistently laterN_affinely_2. Qed. +Lemma laterN_intuitionistically_if_2 n p P : â–¡?p â–·^n P ⊢ â–·^n â–¡?p P. +Proof. destruct p; simpl; auto using laterN_intuitionistically_2. Qed. Lemma laterN_absorbingly n P : â–·^n <absorb> P ⊣⊢ <absorb> â–·^n P. Proof. by rewrite /bi_absorbingly laterN_sep laterN_True. Qed. @@ -1707,10 +1765,10 @@ Proof. Qed. Lemma except_0_affinely_2 P : <affine> â—‡ P ⊢ â—‡ <affine> P. Proof. rewrite /bi_affinely except_0_and. auto using except_0_intro. Qed. -Lemma except_0_affinely_persistently_2 P : â–¡ â—‡ P ⊢ â—‡ â–¡ P. -Proof. by rewrite -except_0_persistently except_0_affinely_2. Qed. -Lemma except_0_affinely_persistently_if_2 p P : â–¡?p â—‡ P ⊢ â—‡ â–¡?p P. -Proof. destruct p; simpl; auto using except_0_affinely_persistently_2. Qed. +Lemma except_0_intuitionistically_2 P : â–¡ â—‡ P ⊢ â—‡ â–¡ P. +Proof. by rewrite /bi_intuitionistically -except_0_persistently except_0_affinely_2. Qed. +Lemma except_0_intuitionistically_if_2 p P : â–¡?p â—‡ P ⊢ â—‡ â–¡?p P. +Proof. destruct p; simpl; auto using except_0_intuitionistically_2. Qed. Lemma except_0_absorbingly P : â—‡ <absorb> P ⊣⊢ <absorb> â—‡ P. Proof. by rewrite /bi_absorbingly except_0_sep except_0_True. Qed. diff --git a/theories/bi/embedding.v b/theories/bi/embedding.v index 247c09ff7..d7ea67739 100644 --- a/theories/bi/embedding.v +++ b/theories/bi/embedding.v @@ -145,10 +145,14 @@ Section embed. Proof. by rewrite embed_and embed_emp. Qed. Lemma embed_absorbingly P : ⎡<absorb> P⎤ ⊣⊢ <absorb> ⎡P⎤. Proof. by rewrite embed_sep embed_pure. Qed. + Lemma embed_intuitionistically P : ⎡□ P⎤ ⊣⊢ â–¡ ⎡P⎤. + Proof. rewrite embed_and embed_emp embed_persistently //. Qed. Lemma embed_persistently_if P b : ⎡<pers>?b P⎤ ⊣⊢ <pers>?b ⎡P⎤. Proof. destruct b; simpl; auto using embed_persistently. Qed. Lemma embed_affinely_if P b : ⎡<affine>?b P⎤ ⊣⊢ <affine>?b ⎡P⎤. Proof. destruct b; simpl; auto using embed_affinely. Qed. + Lemma embed_intuitionistically_if P b : ⎡□?b P⎤ ⊣⊢ â–¡?b ⎡P⎤. + Proof. destruct b; simpl; auto using embed_intuitionistically. Qed. Lemma embed_hforall {As} (Φ : himpl As PROP1): ⎡bi_hforall Φ⎤ ⊣⊢ bi_hforall (hcompose embed Φ). Proof. induction As=>//. rewrite /= embed_forall. by do 2 f_equiv. Qed. diff --git a/theories/bi/fixpoint.v b/theories/bi/fixpoint.v index 43f506b7b..fff0a31fc 100644 --- a/theories/bi/fixpoint.v +++ b/theories/bi/fixpoint.v @@ -85,7 +85,8 @@ Section greatest. F (bi_greatest_fixpoint F) x ⊢ bi_greatest_fixpoint F x. Proof. iIntros "HF". iExists (CofeMor (F (bi_greatest_fixpoint F))). - iIntros "{$HF} !#" (y) "Hy". iApply (bi_mono_pred with "[#] Hy"). + (* FIXME: The framing here adds an <affine> modality that we have to introduce. *) + iIntros "{$HF} !# !#" (y) "Hy". iApply (bi_mono_pred with "[#] Hy"). iIntros "!#" (z) "?". by iApply greatest_fixpoint_unfold_1. Qed. diff --git a/theories/bi/lib/fractional.v b/theories/bi/lib/fractional.v index 7d1074804..192db2027 100644 --- a/theories/bi/lib/fractional.v +++ b/theories/bi/lib/fractional.v @@ -173,6 +173,6 @@ Section fractional. - rewrite fractional /Frame /MakeSep=><-<-. by rewrite assoc. - rewrite fractional /Frame /MakeSep=><-<-=>_. by rewrite (comm _ Q (Φ q0)) !assoc (comm _ (Φ _)). - - move=>-[-> _]->. by rewrite bi.affinely_persistently_if_elim -fractional Qp_div_2. + - move=>-[-> _]->. by rewrite bi.intuitionistically_if_elim -fractional Qp_div_2. Qed. End fractional. diff --git a/theories/bi/monpred.v b/theories/bi/monpred.v index d6ea57fc1..194cfe311 100644 --- a/theories/bi/monpred.v +++ b/theories/bi/monpred.v @@ -637,12 +637,16 @@ Proof. intros i j. unseal. by rewrite objective_at. Qed. Global Instance affinely_objective P `{!Objective P} : Objective (<affine> P). Proof. rewrite /bi_affinely. apply _. Qed. +Global Instance intuitionistically_objective P `{!Objective P} : Objective (â–¡ P). +Proof. rewrite /bi_intuitionistically. apply _. Qed. Global Instance absorbingly_objective P `{!Objective P} : Objective (<absorb> P). Proof. rewrite /bi_absorbingly. apply _. Qed. Global Instance persistently_if_objective P p `{!Objective P} : Objective (<pers>?p P). Proof. rewrite /bi_persistently_if. destruct p; apply _. Qed. Global Instance affinely_if_objective P p `{!Objective P} : Objective (<affine>?p P). Proof. rewrite /bi_affinely_if. destruct p; apply _. Qed. +Global Instance intuitionistically_if_objective P p `{!Objective P} : Objective (<affine>?p P). +Proof. rewrite /bi_intuitionistically_if. destruct p; apply _. Qed. (** monPred_in *) Lemma monPred_in_intro P : P ⊢ ∃ i, monPred_in i ∧ ⎡P i⎤. diff --git a/theories/bi/plainly.v b/theories/bi/plainly.v index 0011b8270..13198641e 100644 --- a/theories/bi/plainly.v +++ b/theories/bi/plainly.v @@ -119,7 +119,7 @@ Global Instance plainly_flip_mono' : Proof. intros P Q; apply plainly_mono. Qed. Lemma affinely_plainly_elim P : <affine> â– P ⊢ P. -Proof. by rewrite plainly_elim_persistently affinely_persistently_elim. Qed. +Proof. by rewrite plainly_elim_persistently /bi_affinely persistently_and_emp_elim. Qed. Lemma persistently_plainly P : <pers> â– P ⊣⊢ â– P. Proof. @@ -216,6 +216,14 @@ Qed. Lemma plainly_affinely P : â– <affine> P ⊣⊢ â– P. Proof. by rewrite /bi_affinely plainly_and -plainly_True_emp plainly_pure left_id. Qed. +Lemma intuitionistically_plainly_elim P : â–¡ â– P -∗ â–¡ P. +Proof. rewrite intuitionistically_affinely plainly_elim_persistently //. Qed. +Lemma intuitionistically_plainly P : â–¡ â– P -∗ â– â–¡ P. +Proof. + rewrite /bi_intuitionistically plainly_affinely affinely_elim. + rewrite persistently_plainly plainly_persistently. done. +Qed. + Lemma and_sep_plainly P Q : â– P ∧ â– Q ⊣⊢ â– P ∗ â– Q. Proof. apply (anti_symm _); auto using plainly_and_sep_l_1. @@ -252,7 +260,7 @@ Lemma impl_wand_plainly_2 P Q : (â– P -∗ Q) ⊢ (â– P → Q). Proof. apply impl_intro_l. by rewrite plainly_and_sep_l_1 wand_elim_r. Qed. Lemma impl_wand_affinely_plainly P Q : (â– P → Q) ⊣⊢ (<affine> â– P -∗ Q). -Proof. by rewrite -(persistently_plainly P) impl_wand_affinely_persistently. Qed. +Proof. by rewrite -(persistently_plainly P) impl_wand_intuitionistically. Qed. Lemma persistently_wand_affinely_plainly P Q : (<affine> â– P -∗ <pers> Q) ⊢ <pers> (<affine> â– P -∗ Q). @@ -441,6 +449,8 @@ Proof. Qed. Global Instance affinely_plain P : Plain P → Plain (<affine> P). Proof. rewrite /bi_affinely. apply _. Qed. +Global Instance intuitionistically_plain P : Plain P → Plain (â–¡ P). +Proof. rewrite /bi_intuitionistically. apply _. Qed. Global Instance absorbingly_plain P : Plain P → Plain (<absorb> P). Proof. rewrite /bi_absorbingly. apply _. Qed. Global Instance from_option_plain {A} P (Ψ : A → PROP) (mx : option A) : diff --git a/theories/heap_lang/lib/increment.v b/theories/heap_lang/lib/increment.v index 7471c3794..331ba1db0 100644 --- a/theories/heap_lang/lib/increment.v +++ b/theories/heap_lang/lib/increment.v @@ -76,7 +76,7 @@ Section increment_client. ⊤ ⊤ (λ _ _, True))%I as "#Aupd". { iAlways. iExists True%I, True%I. repeat (iSplit; first done). clear x. - iIntros (E) "!# % _". + iIntros "!#" (E) "% _". assert (E = ⊤) as -> by set_solver. iInv nroot as (x) ">H↦" "Hclose". iMod fupd_intro_mask' as "Hclose2"; last iModIntro; first set_solver. diff --git a/theories/proofmode/class_instances.v b/theories/proofmode/class_instances.v index f24e279eb..a271c1fcf 100644 --- a/theories/proofmode/class_instances.v +++ b/theories/proofmode/class_instances.v @@ -24,13 +24,13 @@ Proof. by rewrite /IntoAbsorbingly. Qed. (* FromAssumption *) Global Instance from_assumption_exact p P : FromAssumption p P P | 0. -Proof. by rewrite /FromAssumption /= affinely_persistently_if_elim. Qed. +Proof. by rewrite /FromAssumption /= intuitionistically_if_elim. Qed. Global Instance from_assumption_persistently_r P Q : FromAssumption true P Q → KnownRFromAssumption true P (<pers> Q). Proof. rewrite /KnownRFromAssumption /FromAssumption /= =><-. - by rewrite -{1}affinely_persistently_idemp affinely_elim. + apply intuitionistically_persistent. Qed. Global Instance from_assumption_affinely_r P Q : FromAssumption true P Q → KnownRFromAssumption true P (<affine> Q). @@ -38,6 +38,12 @@ Proof. rewrite /KnownRFromAssumption /FromAssumption /= =><-. by rewrite affinely_idemp. Qed. +Global Instance from_assumption_intuitionistically_r P Q : + FromAssumption true P Q → KnownRFromAssumption true P (â–¡ Q). +Proof. + rewrite /KnownRFromAssumption /FromAssumption /= =><-. + by rewrite intuitionistically_idemp. +Qed. Global Instance from_assumption_absorbingly_r p P Q : FromAssumption p P Q → KnownRFromAssumption p P (<absorb> Q). Proof. @@ -45,23 +51,23 @@ Proof. apply absorbingly_intro. Qed. -Global Instance from_assumption_affinely_persistently_l p P Q : +Global Instance from_assumption_intuitionistically_l p P Q : FromAssumption true P Q → KnownLFromAssumption p (â–¡ P) Q. Proof. rewrite /KnownLFromAssumption /FromAssumption /= =><-. - by rewrite affinely_persistently_if_elim. + by rewrite intuitionistically_if_elim. Qed. Global Instance from_assumption_persistently_l_true P Q : FromAssumption true P Q → KnownLFromAssumption true (<pers> P) Q. Proof. rewrite /KnownLFromAssumption /FromAssumption /= =><-. - by rewrite persistently_idemp. + rewrite intuitionistically_persistently_persistently //. Qed. Global Instance from_assumption_persistently_l_false `{BiAffine PROP} P Q : FromAssumption true P Q → KnownLFromAssumption false (<pers> P) Q. Proof. rewrite /KnownLFromAssumption /FromAssumption /= =><-. - by rewrite affine_affinely. + by rewrite intuitionistically_persistently. Qed. Global Instance from_assumption_affinely_l_true p P Q : FromAssumption p P Q → KnownLFromAssumption p (<affine> P) Q. @@ -203,6 +209,12 @@ Qed. Global Instance into_persistent_affinely p P Q : IntoPersistent p P Q → IntoPersistent p (<affine> P) Q | 0. Proof. rewrite /IntoPersistent /= => <-. by rewrite affinely_elim. Qed. +Global Instance into_persistent_intuitionistically p P Q : + IntoPersistent p P Q → IntoPersistent p (â–¡ P) Q | 0. +Proof. rewrite /IntoPersistent /= =><-. by rewrite intuitionistically_elim. Qed. +Global Instance into_persistent_intuitionistically2 P Q : + IntoPersistent true P Q → IntoPersistent false (â–¡ P) Q | 0. +Proof. rewrite /IntoPersistent /= =><-. by rewrite intuitionistically_persistently_1. Qed. Global Instance into_persistent_embed `{BiEmbed PROP PROP'} p P Q : IntoPersistent p P Q → IntoPersistent p ⎡P⎤ ⎡Q⎤ | 0. Proof. @@ -222,12 +234,12 @@ Proof. by rewrite /FromModal. Qed. Global Instance from_modal_persistently P : FromModal modality_persistently (<pers> P) (<pers> P) P | 2. Proof. by rewrite /FromModal. Qed. -Global Instance from_modal_affinely_persistently P : - FromModal modality_affinely_persistently (â–¡ P) (â–¡ P) P | 1. +Global Instance from_modal_intuitionistically P : + FromModal modality_intuitionistically (â–¡ P) (â–¡ P) P | 1. Proof. by rewrite /FromModal. Qed. -Global Instance from_modal_affinely_persistently_affine_bi P : +Global Instance from_modal_intuitionistically_affine_bi P : BiAffine PROP → FromModal modality_persistently (â–¡ P) (â–¡ P) P | 0. -Proof. intros. by rewrite /FromModal /= affine_affinely. Qed. +Proof. intros. by rewrite /FromModal /= intuitionistically_persistently. Qed. Global Instance from_modal_absorbingly P : FromModal modality_id (<absorb> P) (<absorb> P) P. @@ -252,9 +264,9 @@ Global Instance from_modal_persistently_embed `{BiEmbed PROP PROP'} `(sel : A) P FromModal modality_persistently sel P Q → FromModal modality_persistently sel ⎡P⎤ ⎡Q⎤ | 100. Proof. rewrite /FromModal /= =><-. by rewrite embed_persistently. Qed. -Global Instance from_modal_affinely_persistently_embed `{BiEmbed PROP PROP'} `(sel : A) P Q : - FromModal modality_affinely_persistently sel P Q → - FromModal modality_affinely_persistently sel ⎡P⎤ ⎡Q⎤ | 100. +Global Instance from_modal_intuitionistically_embed `{BiEmbed PROP PROP'} `(sel : A) P Q : + FromModal modality_intuitionistically sel P Q → + FromModal modality_intuitionistically sel ⎡P⎤ ⎡Q⎤ | 100. Proof. rewrite /FromModal /= =><-. by rewrite embed_affinely embed_persistently. Qed. @@ -263,7 +275,7 @@ Qed. Global Instance into_wand_wand p q P Q P' : FromAssumption q P P' → IntoWand p q (P' -∗ Q) P Q. Proof. - rewrite /FromAssumption /IntoWand=> HP. by rewrite HP affinely_persistently_if_elim. + rewrite /FromAssumption /IntoWand=> HP. by rewrite HP intuitionistically_if_elim. Qed. Global Instance into_wand_impl_false_false P Q P' : Absorbing P' → Absorbing (P' → Q) → @@ -277,23 +289,21 @@ Global Instance into_wand_impl_false_true P Q P' : IntoWand false true (P' → Q) P Q. Proof. rewrite /IntoWand /FromAssumption /= => ? HP. apply wand_intro_l. - rewrite -(affinely_persistently_idemp P) HP. - by rewrite -persistently_and_affinely_sep_l persistently_elim impl_elim_r. + rewrite -(intuitionistically_idemp P) HP. + by rewrite -persistently_and_intuitionistically_sep_l persistently_elim impl_elim_r. Qed. Global Instance into_wand_impl_true_false P Q P' : Affine P' → FromAssumption false P P' → IntoWand true false (P' → Q) P Q. Proof. rewrite /FromAssumption /IntoWand /= => ? HP. apply wand_intro_r. - rewrite -persistently_and_affinely_sep_l HP -{2}(affine_affinely P') -affinely_and_lr. - by rewrite affinely_persistently_elim impl_elim_l. + rewrite HP sep_and intuitionistically_elim impl_elim_l //. Qed. Global Instance into_wand_impl_true_true P Q P' : FromAssumption true P P' → IntoWand true true (P' → Q) P Q. Proof. rewrite /FromAssumption /IntoWand /= => <-. apply wand_intro_l. - rewrite -{1}(affinely_persistently_idemp P) -and_sep_affinely_persistently. - by rewrite -affinely_persistently_and impl_elim_r affinely_persistently_elim. + rewrite sep_and [(â–¡ (_ → _))%I]intuitionistically_elim impl_elim_r //. Qed. Global Instance into_wand_and_l p q R1 R2 P' Q' : @@ -306,35 +316,34 @@ Proof. rewrite /IntoWand=> ?. by rewrite /bi_wand_iff and_elim_r. Qed. Global Instance into_wand_forall_prop_true p (φ : Prop) P : IntoWand p true (∀ _ : φ, P) ⌜ φ ⌠P. Proof. - rewrite /IntoWand (affinely_persistently_if_elim p) /= - -impl_wand_affinely_persistently -pure_impl_forall + rewrite /IntoWand (intuitionistically_if_elim p) /= + -impl_wand_intuitionistically -pure_impl_forall bi.persistently_elim //. Qed. Global Instance into_wand_forall_prop_false p (φ : Prop) P : Absorbing P → IntoWand p false (∀ _ : φ, P) ⌜ φ ⌠P. Proof. intros ?. - rewrite /IntoWand (affinely_persistently_if_elim p) /= pure_wand_forall //. + rewrite /IntoWand (intuitionistically_if_elim p) /= pure_wand_forall //. Qed. Global Instance into_wand_forall {A} p q (Φ : A → PROP) P Q x : IntoWand p q (Φ x) P Q → IntoWand p q (∀ x, Φ x) P Q. Proof. rewrite /IntoWand=> <-. by rewrite (forall_elim x). Qed. -Global Instance into_wand_affinely_persistently p q R P Q : +Global Instance into_wand_intuitionistically p q R P Q : IntoWand p q R P Q → IntoWand p q (â–¡ R) P Q. -Proof. by rewrite /IntoWand affinely_persistently_elim. Qed. +Proof. by rewrite /IntoWand intuitionistically_elim. Qed. Global Instance into_wand_persistently_true q R P Q : IntoWand true q R P Q → IntoWand true q (<pers> R) P Q. -Proof. by rewrite /IntoWand /= persistently_idemp. Qed. +Proof. by rewrite /IntoWand /= intuitionistically_persistently_persistently. Qed. Global Instance into_wand_persistently_false q R P Q : Absorbing R → IntoWand false q R P Q → IntoWand false q (<pers> R) P Q. Proof. intros ?. by rewrite /IntoWand persistently_elim. Qed. Global Instance into_wand_embed `{BiEmbed PROP PROP'} p q R P Q : IntoWand p q R P Q → IntoWand p q ⎡R⎤ ⎡P⎤ ⎡Q⎤. Proof. - rewrite /IntoWand -!embed_persistently_if -!embed_affinely_if - -embed_wand => -> //. + rewrite /IntoWand -!embed_intuitionistically_if -embed_wand => -> //. Qed. (* FromWand *) @@ -432,7 +441,7 @@ Proof. by rewrite /FromSep big_opL_app. Qed. (* IntoAnd *) Global Instance into_and_and p P Q : IntoAnd p (P ∧ Q) P Q | 10. -Proof. by rewrite /IntoAnd affinely_persistently_if_and. Qed. +Proof. by rewrite /IntoAnd intuitionistically_if_and. Qed. Global Instance into_and_and_affine_l P Q Q' : Affine P → FromAffinely Q' Q → IntoAnd false (P ∧ Q) P Q'. Proof. @@ -448,7 +457,7 @@ Qed. Global Instance into_and_sep `{BiPositive PROP} P Q : IntoAnd true (P ∗ Q) P Q. Proof. - by rewrite /IntoAnd /= persistently_sep -and_sep_persistently persistently_and. + rewrite /IntoAnd /= intuitionistically_sep -and_sep_intuitionistically intuitionistically_and //. Qed. Global Instance into_and_sep_affine P Q : TCOr (Affine P) (Absorbing Q) → TCOr (Absorbing P) (Affine Q) → @@ -456,13 +465,13 @@ Global Instance into_and_sep_affine P Q : Proof. intros. by rewrite /IntoAnd /= sep_and. Qed. Global Instance into_and_pure p φ ψ : @IntoAnd PROP p ⌜φ ∧ ψ⌠⌜φ⌠⌜ψâŒ. -Proof. by rewrite /IntoAnd pure_and affinely_persistently_if_and. Qed. +Proof. by rewrite /IntoAnd pure_and intuitionistically_if_and. Qed. Global Instance into_and_affinely p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p (<affine> P) (<affine> Q1) (<affine> Q2). Proof. rewrite /IntoAnd. destruct p; simpl. - - by rewrite -affinely_and !persistently_affinely. + - rewrite -affinely_and !intuitionistically_affinely_affinely //. - intros ->. by rewrite affinely_and. Qed. Global Instance into_and_persistently p P Q1 Q2 : @@ -470,14 +479,13 @@ Global Instance into_and_persistently p P Q1 Q2 : IntoAnd p (<pers> P) (<pers> Q1) (<pers> Q2). Proof. rewrite /IntoAnd /=. destruct p; simpl. - - by rewrite -persistently_and !persistently_idemp. + - rewrite -persistently_and !intuitionistically_persistently_persistently //. - intros ->. by rewrite persistently_and. Qed. Global Instance into_and_embed `{BiEmbed PROP PROP'} p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p ⎡P⎤ ⎡Q1⎤ ⎡Q2⎤. Proof. - rewrite /IntoAnd -embed_and -!embed_persistently_if - -!embed_affinely_if=> -> //. + rewrite /IntoAnd -embed_and -!embed_intuitionistically_if=> -> //. Qed. (* IntoSep *) @@ -537,13 +545,13 @@ Proof. rewrite /IntoSep /= => -> ??. by rewrite sep_and persistently_and persistently_and_sep_l_1. Qed. -Global Instance into_sep_affinely_persistently_affine P Q1 Q2 : +Global Instance into_sep_intuitionistically_affine P Q1 Q2 : IntoSep P Q1 Q2 → TCOr (Affine Q1) (Absorbing Q2) → TCOr (Absorbing Q1) (Affine Q2) → IntoSep (â–¡ P) (â–¡ Q1) (â–¡ Q2). Proof. rewrite /IntoSep /= => -> ??. - by rewrite sep_and affinely_persistently_and and_sep_affinely_persistently. + by rewrite sep_and intuitionistically_and and_sep_intuitionistically. Qed. (* We use [IsCons] and [IsApp] to make sure that [frame_big_sepL_cons] and @@ -756,25 +764,25 @@ Proof. by rewrite /AddModal !embed_bupd. Qed. (* Frame *) Global Instance frame_here_absorbing p R : Absorbing R → Frame p R R True | 0. -Proof. intros. by rewrite /Frame affinely_persistently_if_elim sep_elim_l. Qed. +Proof. intros. by rewrite /Frame intuitionistically_if_elim sep_elim_l. Qed. Global Instance frame_here p R : Frame p R R emp | 1. -Proof. intros. by rewrite /Frame affinely_persistently_if_elim sep_elim_l. Qed. +Proof. intros. by rewrite /Frame intuitionistically_if_elim sep_elim_l. Qed. Global Instance frame_affinely_here_absorbing p R : Absorbing R → Frame p (<affine> R) R True | 0. Proof. - intros. rewrite /Frame affinely_persistently_if_elim affinely_elim. + intros. rewrite /Frame intuitionistically_if_elim affinely_elim. apply sep_elim_l, _. Qed. Global Instance frame_affinely_here p R : Frame p (<affine> R) R emp | 1. Proof. - intros. rewrite /Frame affinely_persistently_if_elim affinely_elim. + intros. rewrite /Frame intuitionistically_if_elim affinely_elim. apply sep_elim_l, _. Qed. Global Instance frame_here_pure p φ Q : FromPure false Q φ → Frame p ⌜φ⌠Q True. Proof. rewrite /FromPure /Frame=> <-. - by rewrite affinely_persistently_if_elim sep_elim_l. + by rewrite intuitionistically_if_elim sep_elim_l. Qed. Global Instance make_embed_pure `{BiEmbed PROP PROP'} φ : @@ -791,7 +799,7 @@ Global Instance frame_embed `{BiEmbed PROP PROP'} p P Q (Q' : PROP') R : Frame p R P Q → MakeEmbed Q Q' → Frame p ⎡R⎤ ⎡P⎤ Q'. Proof. rewrite /Frame /MakeEmbed => <- <-. - rewrite embed_sep embed_affinely_if embed_persistently_if => //. + rewrite embed_sep embed_intuitionistically_if => //. Qed. Global Instance frame_pure_embed `{BiEmbed PROP PROP'} p P Q (Q' : PROP') φ : Frame p ⌜φ⌠P Q → MakeEmbed Q Q' → Frame p ⌜φ⌠⎡P⎤ Q'. @@ -817,7 +825,7 @@ Global Instance frame_sep_persistent_l progress R P1 P2 Q1 Q2 Q' : Frame true R (P1 ∗ P2) Q' | 9. Proof. rewrite /Frame /MaybeFrame /MakeSep /= => <- <- <-. - rewrite {1}(affinely_persistently_sep_dup R). solve_sep_entails. + rewrite {1}(intuitionistically_sep_dup R). solve_sep_entails. Qed. Global Instance frame_sep_l R P1 P2 Q Q' : Frame false R P1 Q → MakeSep Q P2 Q' → Frame false R (P1 ∗ P2) Q' | 9. @@ -923,7 +931,7 @@ Global Instance frame_affinely R P Q Q' : Frame true R P Q → MakeAffinely Q Q' → Frame true R (<affine> P) Q'. Proof. rewrite /Frame /MakeAffinely=> <- <- /=. - by rewrite -{1}affinely_idemp affinely_sep_2. + rewrite -{1}(affine_affinely (â–¡ R)%I) affinely_sep_2 //. Qed. Global Instance make_absorbingly_emp : @KnownMakeAbsorbingly PROP emp True | 0. @@ -958,7 +966,7 @@ Global Instance frame_persistently R P Q Q' : Frame true R P Q → MakePersistently Q Q' → Frame true R (<pers> P) Q'. Proof. rewrite /Frame /MakePersistently=> <- <- /=. - rewrite -persistently_and_affinely_sep_l. + rewrite -persistently_and_intuitionistically_sep_l. by rewrite -persistently_sep_2 -persistently_and_sep_l_1 persistently_affinely persistently_idemp. Qed. @@ -974,16 +982,16 @@ Global Instance frame_impl_persistent R P1 P2 Q2 : Frame true R P2 Q2 → Frame true R (P1 → P2) (P1 → Q2). Proof. rewrite /Frame /= => ?. apply impl_intro_l. - by rewrite -persistently_and_affinely_sep_l assoc (comm _ P1) -assoc impl_elim_r - persistently_and_affinely_sep_l. + by rewrite -persistently_and_intuitionistically_sep_l assoc (comm _ P1) -assoc impl_elim_r + persistently_and_intuitionistically_sep_l. Qed. Global Instance frame_impl R P1 P2 Q2 : Persistent P1 → Absorbing P1 → Frame false R P2 Q2 → Frame false R (P1 → P2) (P1 → Q2). Proof. rewrite /Frame /==> ???. apply impl_intro_l. - rewrite {1}(persistent P1) persistently_and_affinely_sep_l assoc. - rewrite (comm _ (â–¡ P1)%I) -assoc -persistently_and_affinely_sep_l. + rewrite {1}(persistent P1) persistently_and_intuitionistically_sep_l assoc. + rewrite (comm _ (â–¡ P1)%I) -assoc -persistently_and_intuitionistically_sep_l. rewrite persistently_elim impl_elim_r //. Qed. @@ -1046,13 +1054,13 @@ Global Instance from_assumption_plainly_l_true `{BiPlainly PROP} P Q : FromAssumption true P Q → KnownLFromAssumption true (â– P) Q. Proof. rewrite /KnownLFromAssumption /FromAssumption /= =><-. - by rewrite persistently_elim plainly_elim_persistently. + rewrite intuitionistically_plainly_elim //. Qed. Global Instance from_assumption_plainly_l_false `{BiPlainly PROP, BiAffine PROP} P Q : FromAssumption true P Q → KnownLFromAssumption false (â– P) Q. Proof. rewrite /KnownLFromAssumption /FromAssumption /= =><-. - by rewrite affine_affinely plainly_elim_persistently. + rewrite plainly_elim_persistently intuitionistically_persistently //. Qed. (* FromPure *) @@ -1091,71 +1099,71 @@ Global Instance into_wand_later p q R P Q : IntoWand p q R P Q → IntoWand p q (â–· R) (â–· P) (â–· Q). Proof. rewrite /IntoWand /= => HR. - by rewrite !later_affinely_persistently_if_2 -later_wand HR. + by rewrite !later_intuitionistically_if_2 -later_wand HR. Qed. Global Instance into_wand_later_args p q R P Q : IntoWand p q R P Q → IntoWand' p q R (â–· P) (â–· Q). Proof. rewrite /IntoWand' /IntoWand /= => HR. - by rewrite !later_affinely_persistently_if_2 + by rewrite !later_intuitionistically_if_2 (later_intro (â–¡?p R)%I) -later_wand HR. Qed. Global Instance into_wand_laterN n p q R P Q : IntoWand p q R P Q → IntoWand p q (â–·^n R) (â–·^n P) (â–·^n Q). Proof. rewrite /IntoWand /= => HR. - by rewrite !laterN_affinely_persistently_if_2 -laterN_wand HR. + by rewrite !laterN_intuitionistically_if_2 -laterN_wand HR. Qed. Global Instance into_wand_laterN_args n p q R P Q : IntoWand p q R P Q → IntoWand' p q R (â–·^n P) (â–·^n Q). Proof. rewrite /IntoWand' /IntoWand /= => HR. - by rewrite !laterN_affinely_persistently_if_2 + by rewrite !laterN_intuitionistically_if_2 (laterN_intro _ (â–¡?p R)%I) -laterN_wand HR. Qed. Global Instance into_wand_bupd `{BiBUpd PROP} p q R P Q : IntoWand false false R P Q → IntoWand p q (|==> R) (|==> P) (|==> Q). Proof. - rewrite /IntoWand /= => HR. rewrite !affinely_persistently_if_elim HR. + rewrite /IntoWand /= => HR. rewrite !intuitionistically_if_elim HR. apply wand_intro_l. by rewrite bupd_sep wand_elim_r. Qed. Global Instance into_wand_bupd_persistent `{BiBUpd PROP} p q R P Q : IntoWand false q R P Q → IntoWand p q (|==> R) P (|==> Q). Proof. - rewrite /IntoWand /= => HR. rewrite affinely_persistently_if_elim HR. + rewrite /IntoWand /= => HR. rewrite intuitionistically_if_elim HR. apply wand_intro_l. by rewrite bupd_frame_l wand_elim_r. Qed. Global Instance into_wand_bupd_args `{BiBUpd PROP} p q R P Q : IntoWand p false R P Q → IntoWand' p q R (|==> P) (|==> Q). Proof. rewrite /IntoWand' /IntoWand /= => ->. - apply wand_intro_l. by rewrite affinely_persistently_if_elim bupd_wand_r. + apply wand_intro_l. by rewrite intuitionistically_if_elim bupd_wand_r. Qed. Global Instance into_wand_fupd `{BiFUpd PROP} E p q R P Q : IntoWand false false R P Q → IntoWand p q (|={E}=> R) (|={E}=> P) (|={E}=> Q). Proof. - rewrite /IntoWand /= => HR. rewrite !affinely_persistently_if_elim HR. + rewrite /IntoWand /= => HR. rewrite !intuitionistically_if_elim HR. apply wand_intro_l. by rewrite fupd_sep wand_elim_r. Qed. Global Instance into_wand_fupd_persistent `{BiFUpd PROP} E1 E2 p q R P Q : IntoWand false q R P Q → IntoWand p q (|={E1,E2}=> R) P (|={E1,E2}=> Q). Proof. - rewrite /IntoWand /= => HR. rewrite affinely_persistently_if_elim HR. + rewrite /IntoWand /= => HR. rewrite intuitionistically_if_elim HR. apply wand_intro_l. by rewrite fupd_frame_l wand_elim_r. Qed. Global Instance into_wand_fupd_args `{BiFUpd PROP} E1 E2 p q R P Q : IntoWand p false R P Q → IntoWand' p q R (|={E1,E2}=> P) (|={E1,E2}=> Q). Proof. rewrite /IntoWand' /IntoWand /= => ->. - apply wand_intro_l. by rewrite affinely_persistently_if_elim fupd_wand_r. + apply wand_intro_l. by rewrite intuitionistically_if_elim fupd_wand_r. Qed. Global Instance into_wand_plainly_true `{BiPlainly PROP} q R P Q : IntoWand true q R P Q → IntoWand true q (â– R) P Q. -Proof. by rewrite /IntoWand /= persistently_plainly plainly_elim_persistently. Qed. +Proof. rewrite /IntoWand /= intuitionistically_plainly_elim //. Qed. Global Instance into_wand_plainly_false `{BiPlainly PROP} q R P Q : Absorbing R → IntoWand false q R P Q → IntoWand false q (â– R) P Q. Proof. intros ?. by rewrite /IntoWand plainly_elim. Qed. @@ -1201,32 +1209,31 @@ Proof. rewrite /FromSep=> <-. by rewrite plainly_sep_2. Qed. Global Instance into_and_later p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p (â–· P) (â–· Q1) (â–· Q2). Proof. - rewrite /IntoAnd=> HP. apply affinely_persistently_if_intro'. - by rewrite later_affinely_persistently_if_2 HP - affinely_persistently_if_elim later_and. + rewrite /IntoAnd=> HP. apply intuitionistically_if_intro'. + by rewrite later_intuitionistically_if_2 HP + intuitionistically_if_elim later_and. Qed. Global Instance into_and_laterN n p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p (â–·^n P) (â–·^n Q1) (â–·^n Q2). Proof. - rewrite /IntoAnd=> HP. apply affinely_persistently_if_intro'. - by rewrite laterN_affinely_persistently_if_2 HP - affinely_persistently_if_elim laterN_and. + rewrite /IntoAnd=> HP. apply intuitionistically_if_intro'. + by rewrite laterN_intuitionistically_if_2 HP + intuitionistically_if_elim laterN_and. Qed. Global Instance into_and_except_0 p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p (â—‡ P) (â—‡ Q1) (â—‡ Q2). Proof. - rewrite /IntoAnd=> HP. apply affinely_persistently_if_intro'. - by rewrite except_0_affinely_persistently_if_2 HP - affinely_persistently_if_elim except_0_and. + rewrite /IntoAnd=> HP. apply intuitionistically_if_intro'. + by rewrite except_0_intuitionistically_if_2 HP + intuitionistically_if_elim except_0_and. Qed. Global Instance into_and_plainly `{BiPlainly PROP} p P Q1 Q2 : IntoAnd p P Q1 Q2 → IntoAnd p (â– P) (â– Q1) (â– Q2). Proof. rewrite /IntoAnd /=. destruct p; simpl. - - rewrite -plainly_and persistently_plainly -plainly_persistently - -plainly_affinely => ->. - by rewrite plainly_affinely plainly_persistently persistently_plainly. + - rewrite -plainly_and -[(â–¡ â– P)%I]intuitionistically_idemp intuitionistically_plainly =>->. + rewrite [(â–¡ (_ ∧ _))%I]intuitionistically_elim //. - intros ->. by rewrite plainly_and. Qed. @@ -1575,14 +1582,14 @@ Global Instance frame_later p R R' P Q Q' : Frame p R P Q → MakeLaterN 1 Q Q' → Frame p R' (â–· P) Q'. Proof. rewrite /Frame /MakeLaterN /MaybeIntoLaterN=>-[->] <- <-. - by rewrite later_affinely_persistently_if_2 later_sep. + by rewrite later_intuitionistically_if_2 later_sep. Qed. Global Instance frame_laterN p n R R' P Q Q' : NoBackTrack (MaybeIntoLaterN true n R' R) → Frame p R P Q → MakeLaterN n Q Q' → Frame p R' (â–·^n P) Q'. Proof. rewrite /Frame /MakeLaterN /MaybeIntoLaterN=>-[->] <- <-. - by rewrite laterN_affinely_persistently_if_2 laterN_sep. + by rewrite laterN_intuitionistically_if_2 laterN_sep. Qed. Global Instance frame_bupd `{BiBUpd PROP} p R P Q : diff --git a/theories/proofmode/coq_tactics.v b/theories/proofmode/coq_tactics.v index 1b17e82c3..26afcd885 100644 --- a/theories/proofmode/coq_tactics.v +++ b/theories/proofmode/coq_tactics.v @@ -171,10 +171,10 @@ Proof. - rewrite pure_True ?left_id; last (destruct Hwf, rp; constructor; naive_solver eauto using env_delete_wf, env_delete_fresh). destruct rp. - + rewrite (env_lookup_perm Γp) //= affinely_persistently_and. - by rewrite and_sep_affinely_persistently -assoc. - + rewrite {1}affinely_persistently_sep_dup {1}(env_lookup_perm Γp) //=. - by rewrite affinely_persistently_and and_elim_l -assoc. + + rewrite (env_lookup_perm Γp) //= intuitionistically_and. + by rewrite and_sep_intuitionistically -assoc. + + rewrite {1}intuitionistically_sep_dup {1}(env_lookup_perm Γp) //=. + by rewrite intuitionistically_and and_elim_l -assoc. - destruct (Γs !! i) eqn:?; simplify_eq/=. rewrite pure_True ?left_id; last (destruct Hwf; constructor; naive_solver eauto using env_delete_wf, env_delete_fresh). @@ -194,7 +194,7 @@ Proof. rewrite /envs_lookup /of_envs=>?. apply pure_elim_l=> Hwf. destruct Δ as [Γp Γs], (Γp !! i) eqn:?; simplify_eq/=. - rewrite pure_True // left_id (env_lookup_perm Γp) //= - affinely_persistently_and and_sep_affinely_persistently. + intuitionistically_and and_sep_intuitionistically. cancel [â–¡ P]%I. apply wand_intro_l. solve_sep_entails. - destruct (Γs !! i) eqn:?; simplify_eq/=. rewrite (env_lookup_perm Γs) //=. rewrite pure_True // left_id. @@ -210,13 +210,13 @@ Lemma envs_lookup_delete_list_sound Δ Δ' rp js p Ps : of_envs Δ ⊢ â–¡?p [∗] Ps ∗ of_envs Δ'. Proof. revert Δ Δ' p Ps. induction js as [|j js IH]=> Δ Δ'' p Ps ?; simplify_eq/=. - { by rewrite affinely_persistently_emp left_id. } + { by rewrite intuitionistically_emp left_id. } destruct (envs_lookup_delete rp j Δ) as [[[q1 P] Δ']|] eqn:Hj; simplify_eq/=. apply envs_lookup_delete_Some in Hj as [Hj ->]. destruct (envs_lookup_delete_list _ js _) as [[[q2 Ps'] ?]|] eqn:?; simplify_eq/=. - rewrite -affinely_persistently_if_sep_2 -assoc. + rewrite -intuitionistically_if_sep_2 -assoc. rewrite envs_lookup_sound' //; rewrite IH //. - repeat apply sep_mono=>//; apply affinely_persistently_if_flag_mono; by destruct q1. + repeat apply sep_mono=>//; apply intuitionistically_if_flag_mono; by destruct q1. Qed. Lemma envs_lookup_delete_list_cons Δ Δ' Δ'' rp j js p1 p2 P Ps : @@ -251,7 +251,7 @@ Proof. - apply and_intro; [apply pure_intro|]. + destruct Hwf; constructor; simpl; eauto using Esnoc_wf. intros j; destruct (ident_beq_reflect j i); naive_solver. - + by rewrite affinely_persistently_and and_sep_affinely_persistently assoc. + + by rewrite intuitionistically_and and_sep_intuitionistically assoc. - apply and_intro; [apply pure_intro|]. + destruct Hwf; constructor; simpl; eauto using Esnoc_wf. intros j; destruct (ident_beq_reflect j i); naive_solver. @@ -271,7 +271,7 @@ Proof. intros j. apply (env_app_disjoint _ _ _ j) in Happ. naive_solver eauto using env_app_fresh. + rewrite (env_app_perm _ _ Γp') //. - rewrite big_opL_app affinely_persistently_and and_sep_affinely_persistently. + rewrite big_opL_app intuitionistically_and and_sep_intuitionistically. solve_sep_entails. - destruct (env_app Γ Γp) eqn:Happ, (env_app Γ Γs) as [Γs'|] eqn:?; simplify_eq/=. @@ -299,7 +299,7 @@ Proof. intros j. apply (env_app_disjoint _ _ _ j) in Happ. destruct (decide (i = j)); try naive_solver eauto using env_replace_fresh. + rewrite (env_replace_perm _ _ Γp') //. - rewrite big_opL_app affinely_persistently_and and_sep_affinely_persistently. + rewrite big_opL_app intuitionistically_and and_sep_intuitionistically. solve_sep_entails. - destruct (env_app Γ Γp) eqn:Happ, (env_replace i Γ Γs) as [Γs'|] eqn:?; simplify_eq/=. @@ -370,11 +370,11 @@ Proof. apply pure_intro. destruct Hwf; constructor; simpl; auto using Enil_wf. Qed. -Lemma env_spatial_is_nil_affinely_persistently Δ : +Lemma env_spatial_is_nil_intuitionistically Δ : env_spatial_is_nil Δ = true → of_envs Δ ⊢ â–¡ of_envs Δ. Proof. intros. unfold of_envs; destruct Δ as [? []]; simplify_eq/=. - rewrite !right_id {1}affinely_and_r persistently_and. + rewrite !right_id /bi_intuitionistically {1}affinely_and_r persistently_and. by rewrite persistently_affinely persistently_idemp persistently_pure. Qed. @@ -420,10 +420,10 @@ Lemma envs_split_sound Δ d js Δ1 Δ2 : Proof. rewrite /envs_split=> ?. rewrite -(idemp bi_and (of_envs Δ)). rewrite {2}envs_clear_spatial_sound. - rewrite (env_spatial_is_nil_affinely_persistently (envs_clear_spatial _)) //. - rewrite -persistently_and_affinely_sep_l. + rewrite (env_spatial_is_nil_intuitionistically (envs_clear_spatial _)) //. + rewrite -persistently_and_intuitionistically_sep_l. rewrite (and_elim_l (<pers> _)%I) - persistently_and_affinely_sep_r affinely_persistently_elim. + persistently_and_intuitionistically_sep_r intuitionistically_elim. destruct (envs_split_go _ _) as [[Δ1' Δ2']|] eqn:HΔ; [|done]. apply envs_split_go_sound in HΔ as ->; last first. { intros j P. by rewrite envs_lookup_envs_clear_spatial=> ->. } @@ -481,8 +481,8 @@ Proof. rewrite envs_entails_eq=> Δ1 Δ2 ? P1 P2 <- <-. by f_equiv. Qed. (** * Adequacy *) Lemma tac_adequate P : envs_entails (Envs Enil Enil 1) P → P. Proof. - rewrite envs_entails_eq /of_envs /= persistently_True_emp - affinely_persistently_emp left_id=><-. + rewrite envs_entails_eq /of_envs /= intuitionistically_True_emp + left_id=><-. apply and_intro=> //. apply pure_intro; repeat constructor. Qed. @@ -532,7 +532,7 @@ Lemma tac_assumption Δ Δ' i p P Q : Proof. intros ?? H. rewrite envs_entails_eq envs_lookup_delete_sound //. destruct (env_spatial_is_nil Δ') eqn:?. - - by rewrite (env_spatial_is_nil_affinely_persistently Δ') // sep_elim_l. + - by rewrite (env_spatial_is_nil_intuitionistically Δ') // sep_elim_l. - rewrite from_assumption. destruct H; by rewrite sep_elim_l. Qed. @@ -566,7 +566,7 @@ Lemma tac_false_destruct Δ i p P Q : envs_entails Δ Q. Proof. rewrite envs_entails_eq => ??. subst. rewrite envs_lookup_sound //; simpl. - by rewrite affinely_persistently_if_elim sep_elim_l False_elim. + by rewrite intuitionistically_if_elim sep_elim_l False_elim. Qed. (** * Pure *) @@ -576,8 +576,8 @@ Lemma tac_pure_intro Δ Q φ af : env_spatial_is_nil Δ = af → FromPure af Q φ → φ → envs_entails Δ Q. Proof. intros ???. rewrite envs_entails_eq -(from_pure _ Q). destruct af. - - rewrite env_spatial_is_nil_affinely_persistently //=. f_equiv. - by apply pure_intro. + - rewrite env_spatial_is_nil_intuitionistically //= /bi_intuitionistically. + f_equiv. by apply pure_intro. - by apply pure_intro. Qed. @@ -589,7 +589,7 @@ Lemma tac_pure Δ Δ' i p P φ Q : Proof. rewrite envs_entails_eq=> ?? HPQ HQ. rewrite envs_lookup_delete_sound //; simpl. destruct p; simpl. - - rewrite (into_pure P) -persistently_and_affinely_sep_l persistently_pure. + - rewrite (into_pure P) -persistently_and_intuitionistically_sep_l persistently_pure. by apply pure_elim_l. - destruct HPQ. + rewrite -(affine_affinely P) (into_pure P) -persistent_and_affinely_sep_l. @@ -610,13 +610,13 @@ Lemma tac_persistent Δ Δ' i p P P' Q : envs_entails Δ' Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq=>?? HPQ ? HQ. rewrite envs_replace_singleton_sound //=. - destruct p; simpl. + destruct p; simpl; rewrite /bi_intuitionistically. - by rewrite -(into_persistent _ P) /= wand_elim_r. - destruct HPQ. + rewrite -(affine_affinely P) (_ : P = <pers>?false P)%I // (into_persistent _ P) wand_elim_r //. + rewrite (_ : P = <pers>?false P)%I // (into_persistent _ P). - by rewrite -{1}absorbingly_affinely_persistently + by rewrite -{1}absorbingly_intuitionistically absorbingly_sep_l wand_elim_r HQ. Qed. @@ -629,10 +629,10 @@ Lemma tac_impl_intro Δ Δ' i P P' Q R : envs_entails Δ' Q → envs_entails Δ R. Proof. rewrite /FromImpl envs_entails_eq => <- ??? <-. destruct (env_spatial_is_nil Δ) eqn:?. - - rewrite (env_spatial_is_nil_affinely_persistently Δ) //; simpl. apply impl_intro_l. + - rewrite (env_spatial_is_nil_intuitionistically Δ) //; simpl. apply impl_intro_l. rewrite envs_app_singleton_sound //; simpl. rewrite -(from_affinely P') -affinely_and_lr. - by rewrite persistently_and_affinely_sep_r affinely_persistently_elim wand_elim_r. + by rewrite persistently_and_intuitionistically_sep_r intuitionistically_elim wand_elim_r. - apply impl_intro_l. rewrite envs_app_singleton_sound //; simpl. by rewrite -(from_affinely P') persistent_and_affinely_sep_l_1 wand_elim_r. Qed. @@ -645,7 +645,7 @@ Proof. rewrite /FromImpl envs_entails_eq => <- ?? <-. rewrite envs_app_singleton_sound //=. apply impl_intro_l. rewrite (_ : P = <pers>?false P)%I // (into_persistent false P). - by rewrite persistently_and_affinely_sep_l wand_elim_r. + by rewrite persistently_and_intuitionistically_sep_l wand_elim_r. Qed. Lemma tac_impl_intro_drop Δ P Q R : FromImpl R P Q → envs_entails Δ Q → envs_entails Δ R. @@ -672,8 +672,8 @@ Proof. rewrite envs_app_singleton_sound //=. apply wand_intro_l. destruct HPQ. - rewrite -(affine_affinely P) (_ : P = <pers>?false P)%I // (into_persistent _ P) wand_elim_r //. - - rewrite (_ : P = â–¡?false P)%I // (into_persistent _ P). - by rewrite -{1}absorbingly_affinely_persistently + - rewrite (_ : P = <pers>?false P)%I // (into_persistent _ P). + by rewrite -{1}absorbingly_intuitionistically absorbingly_sep_l wand_elim_r HQ. Qed. Lemma tac_wand_intro_pure Δ P φ Q R : @@ -714,9 +714,9 @@ Proof. rewrite (envs_lookup_sound' _ false) //; simpl. destruct p; simpl. - move: Hj; rewrite envs_delete_persistent=> Hj. rewrite envs_simple_replace_singleton_sound //; simpl. - rewrite -affinely_persistently_if_idemp -affinely_persistently_idemp into_wand /=. - rewrite assoc (affinely_persistently_affinely_persistently_if q). - by rewrite affinely_persistently_if_sep_2 wand_elim_r wand_elim_r. + rewrite -intuitionistically_if_idemp -intuitionistically_idemp into_wand /=. + rewrite assoc (intuitionistically_intuitionistically_if q). + by rewrite intuitionistically_if_sep_2 wand_elim_r wand_elim_r. - move: Hj Hj'; rewrite envs_delete_spatial=> Hj Hj'. rewrite envs_lookup_sound // (envs_replace_singleton_sound' _ Δ'') //; simpl. by rewrite into_wand /= assoc wand_elim_r wand_elim_r. @@ -768,7 +768,7 @@ Lemma tac_specialize_assert_pure Δ Δ' j q R P1 P2 φ Q : φ → envs_entails Δ' Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq=> ????? <-. rewrite envs_simple_replace_singleton_sound //=. - rewrite -affinely_persistently_if_idemp into_wand /= -(from_pure _ P1). + rewrite -intuitionistically_if_idemp into_wand /= -(from_pure _ P1) /bi_intuitionistically. rewrite pure_True //= persistently_affinely persistently_pure affinely_True_emp affinely_emp. by rewrite emp_wand wand_elim_r. @@ -787,10 +787,10 @@ Proof. rewrite -(idemp bi_and (of_envs (envs_delete _ _ _ _))). rewrite {2}envs_simple_replace_singleton_sound' //; simpl. rewrite {1}HP1 (into_absorbingly P1') (persistent_persistently_2 P1). - rewrite absorbingly_persistently persistently_and_affinely_sep_l assoc. - rewrite -affinely_persistently_if_idemp -affinely_persistently_idemp. - rewrite (affinely_persistently_affinely_persistently_if q). - by rewrite affinely_persistently_if_sep_2 into_wand wand_elim_l wand_elim_r. + rewrite absorbingly_persistently persistently_and_intuitionistically_sep_l assoc. + rewrite -intuitionistically_if_idemp -intuitionistically_idemp. + rewrite (intuitionistically_intuitionistically_if q). + by rewrite intuitionistically_if_sep_2 into_wand wand_elim_l wand_elim_r. Qed. Lemma tac_specialize_persistent_helper Δ Δ'' j q P R R' Q : @@ -804,9 +804,9 @@ Proof. rewrite envs_entails_eq => ? HR ? Hpos ? <-. rewrite -(idemp bi_and (of_envs Δ)) {1}HR. rewrite envs_replace_singleton_sound //; destruct q; simpl. - by rewrite (_ : R = <pers>?false R)%I // (into_persistent _ R) - absorbingly_persistently sep_elim_r persistently_and_affinely_sep_l wand_elim_r. + absorbingly_persistently sep_elim_r persistently_and_intuitionistically_sep_l wand_elim_r. - by rewrite (absorbing_absorbingly R) (_ : R = <pers>?false R)%I // - (into_persistent _ R) sep_elim_r persistently_and_affinely_sep_l wand_elim_r. + (into_persistent _ R) sep_elim_r persistently_and_intuitionistically_sep_l wand_elim_r. Qed. (* A special version of [tac_assumption] that does not do any of the @@ -816,7 +816,7 @@ Lemma tac_specialize_persistent_helper_done Δ i q P : envs_entails Δ (<absorb> P). Proof. rewrite envs_entails_eq /bi_absorbingly=> /envs_lookup_sound=> ->. - rewrite affinely_persistently_if_elim comm. f_equiv; auto. + rewrite intuitionistically_if_elim comm. f_equiv; auto. Qed. Lemma tac_revert Δ Δ' i p P Q : @@ -846,9 +846,9 @@ Lemma tac_revert_ih Δ P Q {φ : Prop} (Hφ : φ) : envs_entails Δ Q. Proof. rewrite /IntoIH envs_entails_eq. intros HP ? HPQ. - rewrite (env_spatial_is_nil_affinely_persistently Δ) //. + rewrite (env_spatial_is_nil_intuitionistically Δ) //. rewrite -(idemp bi_and (â–¡ (of_envs Δ))%I) {1}HP // HPQ. - by rewrite -{1}persistently_idemp !affinely_persistently_elim impl_elim_r. + rewrite {1}intuitionistically_persistently_1 intuitionistically_elim impl_elim_r //. Qed. Lemma tac_assert Δ Δ' j P Q : @@ -856,7 +856,7 @@ Lemma tac_assert Δ Δ' j P Q : envs_entails Δ' Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq=> ? <-. rewrite (envs_app_singleton_sound Δ) //; simpl. - by rewrite -(entails_wand P) // affinely_persistently_emp emp_wand. + by rewrite -(entails_wand P) // intuitionistically_emp emp_wand. Qed. Lemma tac_pose_proof Δ Δ' j P Q : @@ -865,7 +865,7 @@ Lemma tac_pose_proof Δ Δ' j P Q : envs_entails Δ' Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq => HP ? <-. rewrite envs_app_singleton_sound //=. - by rewrite -HP /= affinely_persistently_emp emp_wand. + by rewrite -HP /= intuitionistically_emp emp_wand. Qed. Lemma tac_pose_proof_hyp Δ Δ' Δ'' i p j P Q : @@ -970,7 +970,7 @@ Lemma tac_frame_pure Δ (φ : Prop) P Q : φ → Frame true ⌜φ⌠P Q → envs_entails Δ Q → envs_entails Δ P. Proof. rewrite envs_entails_eq => ?? ->. rewrite -(frame ⌜φ⌠P) /=. - rewrite -persistently_and_affinely_sep_l persistently_pure. + rewrite -persistently_and_intuitionistically_sep_l persistently_pure. auto using and_intro, pure_intro. Qed. @@ -1002,7 +1002,7 @@ Lemma tac_or_destruct Δ Δ1 Δ2 i p j1 j2 P P1 P2 Q : envs_entails Δ1 Q → envs_entails Δ2 Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq. intros ???? HP1 HP2. rewrite envs_lookup_sound //. - rewrite (into_or P) affinely_persistently_if_or sep_or_r; apply or_elim. + rewrite (into_or P) intuitionistically_if_or sep_or_r; apply or_elim. - rewrite (envs_simple_replace_singleton_sound' _ Δ1) //. by rewrite wand_elim_r. - rewrite (envs_simple_replace_singleton_sound' _ Δ2) //. @@ -1048,7 +1048,7 @@ Lemma tac_exist_destruct {A} Δ i p j P (Φ : A → PROP) Q : envs_entails Δ Q. Proof. rewrite envs_entails_eq => ?? HΦ. rewrite envs_lookup_sound //. - rewrite (into_exist P) affinely_persistently_if_exist sep_exist_r. + rewrite (into_exist P) intuitionistically_if_exist sep_exist_r. apply exist_elim=> a; destruct (HΦ a) as (Δ'&?&?). rewrite envs_simple_replace_singleton_sound' //; simpl. by rewrite wand_elim_r. Qed. @@ -1062,7 +1062,7 @@ Lemma tac_modal_elim Δ Δ' i p φ P' P Q Q' : envs_entails Δ' Q' → envs_entails Δ Q. Proof. rewrite envs_entails_eq => ???? HΔ. rewrite envs_replace_singleton_sound //=. - rewrite HΔ affinely_persistently_if_elim. by eapply elim_modal. + rewrite HΔ intuitionistically_if_elim. by eapply elim_modal. Qed. (** * Invariants *) @@ -1078,7 +1078,7 @@ Proof. rewrite envs_entails_eq=> /envs_lookup_delete_Some [? ->] ?? /(_ Q) [Δ'' [? <-]]. rewrite (envs_lookup_sound' _ false) // envs_app_singleton_sound //; simpl. apply wand_elim_r', wand_mono; last done. apply wand_intro_r, wand_intro_r. - rewrite affinely_persistently_if_elim -assoc wand_curry. auto. + rewrite intuitionistically_if_elim -assoc wand_curry. auto. Qed. (** * Accumulate hypotheses *) @@ -1218,8 +1218,7 @@ Section tac_modal_intro. Global Instance transform_persistent_env_nil C : TransformPersistentEnv M C Enil Enil. Proof. split; [|eauto using Enil_wf|done]=> /= ??. - rewrite !persistently_pure !affinely_True_emp. - by rewrite !affinely_emp -modality_emp. + rewrite !intuitionistically_True_emp -modality_emp //. Qed. Global Instance transform_persistent_env_snoc (C : PROP2 → PROP1 → Prop) Γ Γ' i P Q : C P Q → @@ -1227,8 +1226,8 @@ Section tac_modal_intro. TransformPersistentEnv M C (Esnoc Γ i P) (Esnoc Γ' i Q). Proof. intros ? [HΓ Hwf Hdom]; split; simpl. - - intros HC Hand. rewrite affinely_persistently_and HC // HΓ //. - by rewrite Hand -affinely_persistently_and. + - intros HC Hand. rewrite intuitionistically_and HC // HΓ //. + by rewrite Hand -intuitionistically_and. - inversion 1; constructor; auto. - intros j. destruct (ident_beq _ _); naive_solver. Qed. @@ -1278,7 +1277,7 @@ Section tac_modal_intro. (** The actual introduction tactic *) Lemma tac_modal_intro {A} (sel : A) Γp Γs n Γp' Γs' Q Q' fi : FromModal M sel Q' Q → - IntoModalPersistentEnv M Γp Γp' (modality_persistent_spec M) → + IntoModalPersistentEnv M Γp Γp' (modality_intuitionistic_spec M) → IntoModalSpatialEnv M Γs Γs' (modality_spatial_spec M) fi → (if fi then Absorbing Q' else TCTrue) → envs_entails (Envs Γp' Γs' n) Q → envs_entails (Envs Γp Γs n) Q'. @@ -1294,16 +1293,16 @@ Section tac_modal_intro. { destruct HΓs as [| |?????? []| |]; eauto. } naive_solver. } assert (â–¡ [∧] Γp ⊢ M (â–¡ [∧] Γp'))%I as HMp. - { remember (modality_persistent_spec M). + { remember (modality_intuitionistic_spec M). destruct HΓp as [?|M C Γp ?%TCForall_Forall|? M C Γp Γp' []|? M Γp|M Γp]; simpl. - - by rewrite {1}affinely_elim_emp (modality_emp M) - persistently_True_emp affinely_persistently_emp. - - eauto using modality_persistent_forall_big_and. - - eauto using modality_persistent_transform, + - rewrite {1}intuitionistically_elim_emp (modality_emp M) + intuitionistically_True_emp //. + - eauto using modality_intuitionistic_forall_big_and. + - eauto using modality_intuitionistic_transform, modality_and_transform. - - by rewrite {1}affinely_elim_emp (modality_emp M) - persistently_True_emp affinely_persistently_emp. - - eauto using modality_persistent_id. } + - by rewrite {1}intuitionistically_elim_emp (modality_emp M) + intuitionistically_True_emp. + - eauto using modality_intuitionistic_id. } move: HQ'; rewrite -HQ pure_True // left_id HMp=> HQ' {HQ Hwf HMp}. remember (modality_spatial_spec M). destruct HΓs as [?|M C Γs ?%TCForall_Forall|? M C Γs Γs' fi []|? M Γs|M Γs]; simpl. @@ -1341,7 +1340,7 @@ Lemma tac_rewrite Δ i p Pxy d Q : Proof. intros ? A x y ? HPxy -> ?. rewrite envs_entails_eq. apply internal_eq_rewrite'; auto. rewrite {1}envs_lookup_sound //. - rewrite (into_internal_eq Pxy x y) affinely_persistently_if_elim sep_elim_l. + rewrite (into_internal_eq Pxy x y) intuitionistically_if_elim sep_elim_l. destruct d; auto using internal_eq_sym. Qed. @@ -1359,7 +1358,7 @@ Proof. rewrite envs_entails_eq /IntoInternalEq => ?? A Δ' x y Φ HPxy HP ?? <-. rewrite -(idemp bi_and (of_envs Δ)) {2}(envs_lookup_sound _ i) //. rewrite (envs_simple_replace_singleton_sound _ _ j) //=. - rewrite HP HPxy (affinely_persistently_if_elim _ (_ ≡ _)%I) sep_elim_l. + rewrite HP HPxy (intuitionistically_if_elim _ (_ ≡ _)%I) sep_elim_l. rewrite persistent_and_affinely_sep_r -assoc. apply wand_elim_r'. rewrite -persistent_and_affinely_sep_r. apply impl_elim_r'. destruct d. - apply (internal_eq_rewrite x y (λ y, â–¡?q Φ y -∗ of_envs Δ')%I). solve_proper. @@ -1392,7 +1391,7 @@ Proof. rewrite -{1}laterN_intro. apply and_mono, sep_mono. - apply pure_mono; destruct 1; constructor; naive_solver. - apply Hp; rewrite /= /MaybeIntoLaterN. - + intros P Q ->. by rewrite laterN_affinely_persistently_2. + + intros P Q ->. by rewrite laterN_intuitionistically_2. + intros P Q. by rewrite laterN_and. - by rewrite Hs //= right_id. Qed. @@ -1403,11 +1402,11 @@ Lemma tac_löb Δ Δ' i Q : envs_entails Δ' Q → envs_entails Δ Q. Proof. rewrite envs_entails_eq => ?? HQ. - rewrite (env_spatial_is_nil_affinely_persistently Δ) //. + rewrite (env_spatial_is_nil_intuitionistically Δ) //. rewrite -(persistently_and_emp_elim Q). apply and_intro; first apply: affine. rewrite -(löb (<pers> Q)%I) later_persistently. apply impl_intro_l. rewrite envs_app_singleton_sound //; simpl; rewrite HQ. - rewrite persistently_and_affinely_sep_l -{1}affinely_persistently_idemp. - by rewrite affinely_persistently_sep_2 wand_elim_r affinely_elim. + rewrite persistently_and_intuitionistically_sep_l -{1}intuitionistically_idemp. + rewrite intuitionistically_sep_2 wand_elim_r intuitionistically_persistently_1 //. Qed. End sbi_tactics. diff --git a/theories/proofmode/modalities.v b/theories/proofmode/modalities.v index 814d93b99..38ccec446 100644 --- a/theories/proofmode/modalities.v +++ b/theories/proofmode/modalities.v @@ -6,8 +6,8 @@ Import bi. (** The `iModIntro` tactic is not tied the Iris modalities, but can be instantiated with a variety of modalities. -In order to plug in a modality, one has to decide for both the persistent and -spatial what action should be performed upon introducing the modality: +In order to plug in a modality, one has to decide for both the intuitionistic and +spatial context what action should be performed upon introducing the modality: - Introduction is only allowed when the context is empty. - Introduction is only allowed when all hypotheses satisfy some predicate @@ -35,7 +35,7 @@ Arguments MIEnvId {_}. Notation MIEnvFilter C := (MIEnvTransform (TCDiag C)). -Definition modality_intro_spec_persistent {PROP1 PROP2} +Definition modality_intro_spec_intuitionistic {PROP1 PROP2} (s : modality_intro_spec PROP1 PROP2) : (PROP1 → PROP2) → Prop := match s with | MIEnvIsEmpty => λ M, True @@ -63,7 +63,7 @@ Definition modality_intro_spec_spatial {PROP1 PROP2} should satisfy to justify the given actions for both contexts: *) Record modality_mixin {PROP1 PROP2 : bi} (M : PROP1 → PROP2) (pspec sspec : modality_intro_spec PROP1 PROP2) := { - modality_mixin_persistent : modality_intro_spec_persistent pspec M; + modality_mixin_intuitionistic : modality_intro_spec_intuitionistic pspec M; modality_mixin_spatial : modality_intro_spec_spatial sspec M; modality_mixin_emp : emp ⊢ M emp; modality_mixin_mono P Q : (P ⊢ Q) → M P ⊢ M Q; @@ -72,23 +72,23 @@ Record modality_mixin {PROP1 PROP2 : bi} (M : PROP1 → PROP2) Record modality (PROP1 PROP2 : bi) := Modality { modality_car :> PROP1 → PROP2; - modality_persistent_spec : modality_intro_spec PROP1 PROP2; + modality_intuitionistic_spec : modality_intro_spec PROP1 PROP2; modality_spatial_spec : modality_intro_spec PROP1 PROP2; modality_mixin_of : - modality_mixin modality_car modality_persistent_spec modality_spatial_spec + modality_mixin modality_car modality_intuitionistic_spec modality_spatial_spec }. Arguments Modality {_ _} _ {_ _} _. -Arguments modality_persistent_spec {_ _} _. +Arguments modality_intuitionistic_spec {_ _} _. Arguments modality_spatial_spec {_ _} _. Section modality. Context {PROP1 PROP2} (M : modality PROP1 PROP2). - Lemma modality_persistent_transform C P Q : - modality_persistent_spec M = MIEnvTransform C → C P Q → â–¡ P ⊢ M (â–¡ Q). + Lemma modality_intuitionistic_transform C P Q : + modality_intuitionistic_spec M = MIEnvTransform C → C P Q → â–¡ P ⊢ M (â–¡ Q). Proof. destruct M as [??? []]; naive_solver. Qed. Lemma modality_and_transform C P Q : - modality_persistent_spec M = MIEnvTransform C → M P ∧ M Q ⊢ M (P ∧ Q). + modality_intuitionistic_spec M = MIEnvTransform C → M P ∧ M Q ⊢ M (P ∧ Q). Proof. destruct M as [??? []]; naive_solver. Qed. Lemma modality_spatial_transform C P Q : modality_spatial_spec M = MIEnvTransform C → C P Q → P ⊢ M Q. @@ -114,14 +114,14 @@ End modality. Section modality1. Context {PROP} (M : modality PROP PROP). - Lemma modality_persistent_forall C P : - modality_persistent_spec M = MIEnvForall C → C P → â–¡ P ⊢ M (â–¡ P). + Lemma modality_intuitionistic_forall C P : + modality_intuitionistic_spec M = MIEnvForall C → C P → â–¡ P ⊢ M (â–¡ P). Proof. destruct M as [??? []]; naive_solver. Qed. Lemma modality_and_forall C P Q : - modality_persistent_spec M = MIEnvForall C → M P ∧ M Q ⊢ M (P ∧ Q). + modality_intuitionistic_spec M = MIEnvForall C → M P ∧ M Q ⊢ M (P ∧ Q). Proof. destruct M as [??? []]; naive_solver. Qed. - Lemma modality_persistent_id P : - modality_persistent_spec M = MIEnvId → â–¡ P ⊢ M (â–¡ P). + Lemma modality_intuitionistic_id P : + modality_intuitionistic_spec M = MIEnvId → â–¡ P ⊢ M (â–¡ P). Proof. destruct M as [??? []]; naive_solver. Qed. Lemma modality_spatial_forall C P : modality_spatial_spec M = MIEnvForall C → C P → P ⊢ M P. @@ -130,14 +130,14 @@ Section modality1. modality_spatial_spec M = MIEnvId → P ⊢ M P. Proof. destruct M as [??? []]; naive_solver. Qed. - Lemma modality_persistent_forall_big_and C Ps : - modality_persistent_spec M = MIEnvForall C → + Lemma modality_intuitionistic_forall_big_and C Ps : + modality_intuitionistic_spec M = MIEnvForall C → Forall C Ps → â–¡ [∧] Ps ⊢ M (â–¡ [∧] Ps). Proof. induction 2 as [|P Ps ? _ IH]; simpl. - - by rewrite persistently_pure affinely_True_emp affinely_emp -modality_emp. - - rewrite affinely_persistently_and -modality_and_forall // -IH. - by rewrite {1}(modality_persistent_forall _ P). + - by rewrite intuitionistically_True_emp -modality_emp. + - rewrite intuitionistically_and -modality_and_forall // -IH. + by rewrite {1}(modality_intuitionistic_forall _ P). Qed. Lemma modality_spatial_forall_big_sep C Ps : modality_spatial_spec M = MIEnvForall C → diff --git a/theories/proofmode/modality_instances.v b/theories/proofmode/modality_instances.v index af0e205e4..b780300aa 100644 --- a/theories/proofmode/modality_instances.v +++ b/theories/proofmode/modality_instances.v @@ -24,15 +24,15 @@ Section bi_modalities. Definition modality_affinely := Modality _ modality_affinely_mixin. - Lemma modality_affinely_persistently_mixin : + Lemma modality_intuitionistically_mixin : modality_mixin (λ P : PROP, â–¡ P)%I MIEnvId MIEnvIsEmpty. Proof. - split; simpl; eauto using equiv_entails_sym, affinely_persistently_emp, - affinely_mono, persistently_mono, affinely_persistently_idemp, - affinely_persistently_sep_2 with typeclass_instances. + split; simpl; eauto using equiv_entails_sym, intuitionistically_emp, + affinely_mono, persistently_mono, intuitionistically_idemp, + intuitionistically_sep_2 with typeclass_instances. Qed. - Definition modality_affinely_persistently := - Modality _ modality_affinely_persistently_mixin. + Definition modality_intuitionistically := + Modality _ modality_intuitionistically_mixin. Lemma modality_embed_mixin `{BiEmbed PROP PROP'} : modality_mixin (@embed PROP PROP' _) @@ -66,7 +66,7 @@ Section sbi_modalities. Proof. split; simpl; split_and?; eauto using equiv_entails_sym, laterN_intro, laterN_mono, laterN_and, laterN_sep with typeclass_instances. - rewrite /MaybeIntoLaterN=> P Q ->. by rewrite laterN_affinely_persistently_2. + rewrite /MaybeIntoLaterN=> P Q ->. by rewrite laterN_intuitionistically_2. Qed. Definition modality_laterN n := Modality _ (modality_laterN_mixin n). diff --git a/theories/proofmode/monpred.v b/theories/proofmode/monpred.v index ba13064ec..ee833a1a4 100644 --- a/theories/proofmode/monpred.v +++ b/theories/proofmode/monpred.v @@ -62,8 +62,8 @@ Proof. rewrite /FromModal /MakeMonPredAt /==> <- <-. by rewrite monPred_at_persistently. Qed. Global Instance from_modal_affinely_persistently_monPred_at `(sel : A) P Q ð“ i : - FromModal modality_affinely_persistently sel P Q → MakeMonPredAt i Q ð“ → - FromModal modality_affinely_persistently sel (P i) ð“ | 0. + FromModal modality_intuitionistically sel P Q → MakeMonPredAt i Q ð“ → + FromModal modality_intuitionistically sel (P i) ð“ | 0. Proof. rewrite /FromModal /MakeMonPredAt /==> <- <-. by rewrite monPred_at_affinely monPred_at_persistently. @@ -126,13 +126,13 @@ Global Instance from_assumption_make_monPred_at_l p i j P ð“Ÿ : MakeMonPredAt i P 𓟠→ IsBiIndexRel j i → KnownLFromAssumption p (P j) ð“Ÿ. Proof. rewrite /MakeMonPredAt /KnownLFromAssumption /FromAssumption /IsBiIndexRel=><- ->. - apply bi.affinely_persistently_if_elim. + apply bi.intuitionistically_if_elim. Qed. Global Instance from_assumption_make_monPred_at_r p i j P ð“Ÿ : MakeMonPredAt i P 𓟠→ IsBiIndexRel i j → KnownRFromAssumption p ð“Ÿ (P j). Proof. rewrite /MakeMonPredAt /KnownRFromAssumption /FromAssumption /IsBiIndexRel=><- ->. - apply bi.affinely_persistently_if_elim. + apply bi.intuitionistically_if_elim. Qed. Global Instance from_assumption_make_monPred_objectively P Q : diff --git a/theories/proofmode/tactics.v b/theories/proofmode/tactics.v index 355154bec..13d3e4474 100644 --- a/theories/proofmode/tactics.v +++ b/theories/proofmode/tactics.v @@ -1981,6 +1981,7 @@ Hint Extern 1 (envs_entails _ (â–· _)) => iNext. Hint Extern 1 (envs_entails _ (â– _)) => iAlways. Hint Extern 1 (envs_entails _ (<pers> _)) => iAlways. Hint Extern 1 (envs_entails _ (<affine> _)) => iAlways. +Hint Extern 1 (envs_entails _ (â–¡ _)) => iAlways. Hint Extern 1 (envs_entails _ (∃ _, _)) => iExists _. Hint Extern 1 (envs_entails _ (â—‡ _)) => iModIntro. Hint Extern 1 (envs_entails _ (_ ∨ _)) => iLeft. diff --git a/theories/tests/proofmode_monpred.v b/theories/tests/proofmode_monpred.v index 1d4bcc5f9..4a0a99b97 100644 --- a/theories/tests/proofmode_monpred.v +++ b/theories/tests/proofmode_monpred.v @@ -1,5 +1,4 @@ From iris.proofmode Require Import tactics monpred. -From iris.base_logic Require Import base_logic lib.invariants. Section tests. Context {I : biIndex} {PROP : sbi}. -- GitLab