Commit c54e1692 authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan

Revert "Make FromPure depend on an affinity parameter."

This reverts commit 78ba9509.
parent 78ba9509
...@@ -31,10 +31,10 @@ Global Instance into_pure_cmra_valid `{CmraDiscrete A} (a : A) : ...@@ -31,10 +31,10 @@ Global Instance into_pure_cmra_valid `{CmraDiscrete A} (a : A) :
@IntoPure (uPredI M) ( a) ( a). @IntoPure (uPredI M) ( a) ( a).
Proof. by rewrite /IntoPure discrete_valid. Qed. Proof. by rewrite /IntoPure discrete_valid. Qed.
Global Instance from_pure_cmra_valid {A : cmraT} af (a : A) : Global Instance from_pure_cmra_valid {A : cmraT} (a : A) :
@FromPure (uPredI M) af ( a) ( a). @FromPure (uPredI M) ( a) ( a).
Proof. Proof.
rewrite /FromPure. eapply bi.pure_elim; [by apply affinely_if_elim|]=> ?. rewrite /FromPure. eapply bi.pure_elim; [done|]=> ?.
rewrite -cmra_valid_intro //. by apply pure_intro. rewrite -cmra_valid_intro //. by apply pure_intro.
Qed. Qed.
......
...@@ -138,8 +138,8 @@ Global Instance into_pure_pure_or (φ1 φ2 : Prop) P1 P2 : ...@@ -138,8 +138,8 @@ Global Instance into_pure_pure_or (φ1 φ2 : Prop) P1 P2 :
IntoPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2). IntoPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2).
Proof. rewrite /IntoPure pure_or. by intros -> ->. Qed. Proof. rewrite /IntoPure pure_or. by intros -> ->. Qed.
Global Instance into_pure_pure_impl (φ1 φ2 : Prop) P1 P2 : Global Instance into_pure_pure_impl (φ1 φ2 : Prop) P1 P2 :
FromPure false P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2). FromPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2).
Proof. rewrite /FromPure /IntoPure pure_impl=> <- -> //. Qed. Proof. rewrite /FromPure /IntoPure pure_impl. by intros -> ->. Qed.
Global Instance into_pure_exist {A} (Φ : A PROP) (φ : A Prop) : Global Instance into_pure_exist {A} (Φ : A PROP) (φ : A Prop) :
( x, IntoPure (Φ x) (φ x)) IntoPure ( x, Φ x) ( x, φ x). ( x, IntoPure (Φ x) (φ x)) IntoPure ( x, Φ x) ( x, φ x).
...@@ -152,13 +152,8 @@ Global Instance into_pure_pure_sep (φ1 φ2 : Prop) P1 P2 : ...@@ -152,13 +152,8 @@ Global Instance into_pure_pure_sep (φ1 φ2 : Prop) P1 P2 :
IntoPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2). IntoPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 P2) (φ1 φ2).
Proof. rewrite /IntoPure=> -> ->. by rewrite sep_and pure_and. Qed. Proof. rewrite /IntoPure=> -> ->. by rewrite sep_and pure_and. Qed.
Global Instance into_pure_pure_wand (φ1 φ2 : Prop) P1 P2 : Global Instance into_pure_pure_wand (φ1 φ2 : Prop) P1 P2 :
FromPure true P1 φ1 IntoPure P2 φ2 IntoPure (P1 - P2) (φ1 φ2). FromPure P1 φ1 IntoPure P2 φ2 IntoPure (P1 - P2) (φ1 φ2).
Proof. Proof. rewrite /FromPure /IntoPure=> <- ->. by rewrite pure_impl impl_wand_2. Qed.
rewrite /FromPure /IntoPure=> <- -> /=.
rewrite pure_impl -impl_wand_2. apply bi.wand_intro_l.
rewrite {1}(persistent_absorbingly_affinely ⌜φ1%I) absorbingly_sep_l
bi.wand_elim_r absorbing //.
Qed.
Global Instance into_pure_affinely P φ : Global Instance into_pure_affinely P φ :
IntoPure P φ IntoPure (bi_affinely P) φ. IntoPure P φ IntoPure (bi_affinely P) φ.
...@@ -175,83 +170,53 @@ Global Instance into_pure_embed `{BiEmbedding PROP PROP'} P φ : ...@@ -175,83 +170,53 @@ Global Instance into_pure_embed `{BiEmbedding PROP PROP'} P φ :
Proof. rewrite /IntoPure=> ->. by rewrite bi_embed_pure. Qed. Proof. rewrite /IntoPure=> ->. by rewrite bi_embed_pure. Qed.
(* FromPure *) (* FromPure *)
Global Instance from_pure_pure a φ : @FromPure PROP a ⌜φ⌝ φ. Global Instance from_pure_pure φ : @FromPure PROP ⌜φ⌝ φ.
Proof. rewrite /FromPure. apply affinely_if_elim. Qed. Proof. by rewrite /FromPure. Qed.
Global Instance from_pure_pure_and a (φ1 φ2 : Prop) P1 P2 : Global Instance from_pure_pure_and (φ1 φ2 : Prop) P1 P2 :
FromPure a P1 φ1 FromPure a P2 φ2 FromPure a (P1 P2) (φ1 φ2). FromPure P1 φ1 FromPure P2 φ2 FromPure (P1 P2) (φ1 φ2).
Proof. rewrite /FromPure pure_and=> <- <- /=. by rewrite affinely_if_and. Qed. Proof. rewrite /FromPure pure_and. by intros -> ->. Qed.
Global Instance from_pure_pure_or a (φ1 φ2 : Prop) P1 P2 : Global Instance from_pure_pure_or (φ1 φ2 : Prop) P1 P2 :
FromPure a P1 φ1 FromPure a P2 φ2 FromPure a (P1 P2) (φ1 φ2). FromPure P1 φ1 FromPure P2 φ2 FromPure (P1 P2) (φ1 φ2).
Proof. by rewrite /FromPure pure_or affinely_if_or=><- <-. Qed. Proof. rewrite /FromPure pure_or. by intros -> ->. Qed.
Global Instance from_pure_pure_impl a (φ1 φ2 : Prop) P1 P2 : Global Instance from_pure_pure_impl (φ1 φ2 : Prop) P1 P2 :
IntoPure P1 φ1 FromPure a P2 φ2 FromPure a (P1 P2) (φ1 φ2). IntoPure P1 φ1 FromPure P2 φ2 FromPure (P1 P2) (φ1 φ2).
Proof. Proof. rewrite /FromPure /IntoPure pure_impl. by intros -> ->. Qed.
rewrite /FromPure /IntoPure pure_impl=> -> <-. destruct a=>//=.
apply bi.impl_intro_l. by rewrite affinely_and_r bi.impl_elim_r. Global Instance from_pure_exist {A} (Φ : A PROP) (φ : A Prop) :
Qed. ( x, FromPure (Φ x) (φ x)) FromPure ( x, Φ x) ( x, φ x).
Proof. rewrite /FromPure=>Hx. rewrite pure_exist. by setoid_rewrite Hx. Qed.
Global Instance from_pure_exist {A} a (Φ : A PROP) (φ : A Prop) : Global Instance from_pure_forall {A} (Φ : A PROP) (φ : A Prop) :
( x, FromPure a (Φ x) (φ x)) FromPure a ( x, Φ x) ( x, φ x). ( x, FromPure (Φ x) (φ x)) FromPure ( x, Φ x) ( x, φ x).
Proof. Proof. rewrite /FromPure=>Hx. rewrite pure_forall. by setoid_rewrite Hx. Qed.
rewrite /FromPure=>Hx. rewrite pure_exist affinely_if_exist.
by setoid_rewrite Hx. Global Instance from_pure_pure_sep (φ1 φ2 : Prop) P1 P2 :
Qed. FromPure P1 φ1 FromPure P2 φ2 FromPure (P1 P2) (φ1 φ2).
Global Instance from_pure_forall {A} a (Φ : A PROP) (φ : A Prop) : Proof. rewrite /FromPure=> <- <-. by rewrite pure_and persistent_and_sep_1. Qed.
( x, FromPure a (Φ x) (φ x)) FromPure a ( x, Φ x) ( x, φ x). Global Instance from_pure_pure_wand (φ1 φ2 : Prop) P1 P2 :
Proof. IntoPure P1 φ1 FromPure P2 φ2 FromPure (P1 - P2) (φ1 φ2).
rewrite /FromPure=>Hx. rewrite pure_forall. setoid_rewrite <-Hx. Proof.
destruct a=>//=. apply affinely_forall. rewrite /FromPure /IntoPure=> -> <-.
Qed. by rewrite pure_wand_forall pure_impl pure_impl_forall.
Global Instance from_pure_pure_sep_true (φ1 φ2 : Prop) P1 P2 :
FromPure true P1 φ1 FromPure true P2 φ2 FromPure true (P1 P2) (φ1 φ2).
Proof.
rewrite /FromPure=> <- <- /=.
by rewrite -persistent_and_affinely_sep_l affinely_and_r pure_and.
Qed.
Global Instance from_pure_pure_sep_false_l (φ1 φ2 : Prop) P1 P2 :
FromPure false P1 φ1 FromPure true P2 φ2 FromPure false (P1 P2) (φ1 φ2).
Proof.
rewrite /FromPure=> <- <- /=. by rewrite -persistent_and_affinely_sep_r pure_and.
Qed.
Global Instance from_pure_pure_sep_false_r (φ1 φ2 : Prop) P1 P2 :
FromPure true P1 φ1 FromPure false P2 φ2 FromPure false (P1 P2) (φ1 φ2).
Proof.
rewrite /FromPure=> <- <- /=. by rewrite -persistent_and_affinely_sep_l pure_and.
Qed.
Global Instance from_pure_pure_wand (φ1 φ2 : Prop) a P1 P2 :
IntoPure P1 φ1 FromPure false P2 φ2 FromPure a (P1 - P2) (φ1 φ2).
Proof.
rewrite /FromPure /IntoPure=> -> <- /=.
by rewrite bi.affinely_if_elim pure_wand_forall pure_impl pure_impl_forall.
Qed. Qed.
Global Instance from_pure_plainly P φ : Global Instance from_pure_plainly P φ :
FromPure false P φ FromPure false (bi_plainly P) φ. FromPure P φ FromPure (bi_plainly P) φ.
Proof. rewrite /FromPure=> <-. by rewrite plainly_pure. Qed. Proof. rewrite /FromPure=> <-. by rewrite plainly_pure. Qed.
Global Instance from_pure_persistently P a φ : Global Instance from_pure_persistently P φ :
FromPure true P φ FromPure a (bi_persistently P) φ. FromPure P φ FromPure (bi_persistently P) φ.
Proof. Proof. rewrite /FromPure=> <-. by rewrite persistently_pure. Qed.
rewrite /FromPure=> <- /=. Global Instance from_pure_affinely P φ `{!Affine P} :
by rewrite persistently_affinely affinely_if_elim persistently_pure. FromPure P φ FromPure (bi_affinely P) φ.
Qed. Proof. by rewrite /FromPure affine_affinely. Qed.
Global Instance from_pure_affinely_true P φ : Global Instance from_pure_absorbingly P φ : FromPure P φ FromPure (bi_absorbingly P) φ.
FromPure true P φ FromPure true (bi_affinely P) φ. Proof. rewrite /FromPure=> <-. by rewrite absorbingly_pure. Qed.
Proof. rewrite /FromPure=><- /=. by rewrite affinely_idemp. Qed. Global Instance from_pure_embed `{BiEmbedding PROP PROP'} P φ :
Global Instance from_pure_affinely_false P φ `{!Affine P} : FromPure P φ FromPure P φ.
FromPure false P φ FromPure false (bi_affinely P) φ. Proof. rewrite /FromPure=> <-. by rewrite bi_embed_pure. Qed.
Proof. rewrite /FromPure /= affine_affinely //. Qed.
Global Instance from_pure_bupd `{BUpdFacts PROP} P φ :
Global Instance from_pure_absorbingly P φ : FromPure P φ FromPure (|==> P) φ.
FromPure true P φ FromPure false (bi_absorbingly P) φ. Proof. rewrite /FromPure=> ->. apply bupd_intro. Qed.
Proof. rewrite /FromPure=> <- /=. apply persistent_absorbingly_affinely, _. Qed.
Global Instance from_pure_embed `{BiEmbedding PROP PROP'} a P φ :
FromPure a P φ FromPure a P φ.
Proof. rewrite /FromPure=> <-. by rewrite bi_embed_affinely_if bi_embed_pure. Qed.
Global Instance from_pure_bupd `{BUpdFacts PROP} a P φ :
FromPure a P φ FromPure a (|==> P) φ.
Proof. rewrite /FromPure=> <-. apply bupd_intro. Qed.
(* IntoPersistent *) (* IntoPersistent *)
Global Instance into_persistent_persistently p P Q : Global Instance into_persistent_persistently p P Q :
...@@ -892,7 +857,7 @@ Proof. ...@@ -892,7 +857,7 @@ Proof.
intros. by rewrite /Frame affinely_persistently_if_elim affinely_elim sep_elim_l. intros. by rewrite /Frame affinely_persistently_if_elim affinely_elim sep_elim_l.
Qed. Qed.
Global Instance frame_here_pure p φ Q : FromPure false Q φ Frame p ⌜φ⌝ Q True. Global Instance frame_here_pure p φ Q : FromPure Q φ Frame p ⌜φ⌝ Q True.
Proof. Proof.
rewrite /FromPure /Frame=> <-. by rewrite affinely_persistently_if_elim sep_elim_l. rewrite /FromPure /Frame=> <-. by rewrite affinely_persistently_if_elim sep_elim_l.
Qed. Qed.
...@@ -1161,17 +1126,17 @@ Global Instance from_assumption_fupd `{FUpdFacts PROP} E p P Q : ...@@ -1161,17 +1126,17 @@ Global Instance from_assumption_fupd `{FUpdFacts PROP} E p P Q :
Proof. rewrite /FromAssumption=>->. apply bupd_fupd. Qed. Proof. rewrite /FromAssumption=>->. apply bupd_fupd. Qed.
(* FromPure *) (* FromPure *)
Global Instance from_pure_internal_eq af {A : ofeT} (a b : A) : Global Instance from_pure_internal_eq {A : ofeT} (a b : A) :
@FromPure PROP af (a b) (a b). @FromPure PROP (a b) (a b).
Proof. by rewrite /FromPure pure_internal_eq affinely_if_elim. Qed. Proof. by rewrite /FromPure pure_internal_eq. Qed.
Global Instance from_pure_later a P φ : FromPure a P φ FromPure a ( P) φ. Global Instance from_pure_later P φ : FromPure P φ FromPure ( P) φ.
Proof. rewrite /FromPure=> ->. apply later_intro. Qed. Proof. rewrite /FromPure=> ->. apply later_intro. Qed.
Global Instance from_pure_laterN a n P φ : FromPure a P φ FromPure a (^n P) φ. Global Instance from_pure_laterN n P φ : FromPure P φ FromPure (^n P) φ.
Proof. rewrite /FromPure=> ->. apply laterN_intro. Qed. Proof. rewrite /FromPure=> ->. apply laterN_intro. Qed.
Global Instance from_pure_except_0 a P φ : FromPure a P φ FromPure a ( P) φ. Global Instance from_pure_except_0 P φ : FromPure P φ FromPure ( P) φ.
Proof. rewrite /FromPure=> ->. apply except_0_intro. Qed. Proof. rewrite /FromPure=> ->. apply except_0_intro. Qed.
Global Instance from_pure_fupd `{FUpdFacts PROP} a E P φ : Global Instance from_pure_fupd `{FUpdFacts PROP} E P φ :
FromPure a P φ FromPure a (|={E}=> P) φ. FromPure P φ FromPure (|={E}=> P) φ.
Proof. rewrite /FromPure. intros <-. apply fupd_intro. Qed. Proof. rewrite /FromPure. intros <-. apply fupd_intro. Qed.
(* IntoPure *) (* IntoPure *)
...@@ -1368,17 +1333,16 @@ Global Instance into_forall_except_0 {A} P (Φ : A → PROP) : ...@@ -1368,17 +1333,16 @@ Global Instance into_forall_except_0 {A} P (Φ : A → PROP) :
IntoForall P Φ IntoForall ( P) (λ a, (Φ a))%I. IntoForall P Φ IntoForall ( P) (λ a, (Φ a))%I.
Proof. rewrite /IntoForall=> HP. by rewrite HP except_0_forall. Qed. Proof. rewrite /IntoForall=> HP. by rewrite HP except_0_forall. Qed.
Global Instance into_forall_impl_pure φ P Q : Global Instance into_forall_impl_pure φ P Q :
FromPureT false P φ IntoForall (P Q) (λ _ : φ, Q). FromPureT P φ IntoForall (P Q) (λ _ : φ, Q).
Proof. Proof.
rewrite /FromPureT /FromPure /IntoForall=> -[φ' [-> <-]]. rewrite /FromPureT /FromPure /IntoForall=> -[φ' [-> <-]].
by rewrite pure_impl_forall. by rewrite pure_impl_forall.
Qed. Qed.
Global Instance into_forall_wand_pure φ P Q : Global Instance into_forall_wand_pure φ P Q :
FromPureT true P φ IntoForall (P - Q) (λ _ : φ, Q). Absorbing Q FromPureT P φ IntoForall (P - Q) (λ _ : φ, Q).
Proof. Proof.
rewrite /FromPureT /FromPure /IntoForall=> -[φ' [-> <-]] /=. rewrite /FromPureT /FromPure /IntoForall=> ? -[φ' [-> <-]].
apply forall_intro=>? /=. by rewrite pure_wand_forall.
by rewrite -(pure_intro True%I) // /bi_affinely right_id emp_wand.
Qed. Qed.
(* FromForall *) (* FromForall *)
......
...@@ -43,19 +43,18 @@ Proof. by exists φ. Qed. ...@@ -43,19 +43,18 @@ Proof. by exists φ. Qed.
Hint Extern 0 (IntoPureT _ _) => Hint Extern 0 (IntoPureT _ _) =>
notypeclasses refine (into_pureT_hint _ _ _) : typeclass_instances. notypeclasses refine (into_pureT_hint _ _ _) : typeclass_instances.
Class FromPure {PROP : bi} (a : bool) (P : PROP) (φ : Prop) := Class FromPure {PROP : bi} (P : PROP) (φ : Prop) :=
from_pure : bi_affinely_if a ⌜φ⌝ P. from_pure : ⌜φ⌝ P.
Arguments FromPure {_} _ _%I _%type_scope : simpl never. Arguments FromPure {_} _%I _%type_scope : simpl never.
Arguments from_pure {_} _ _%I _%type_scope {_}. Arguments from_pure {_} _%I _%type_scope {_}.
Hint Mode FromPure + + ! - : typeclass_instances. Hint Mode FromPure + ! - : typeclass_instances.
Class FromPureT {PROP : bi} (a : bool) (P : PROP) (φ : Type) := Class FromPureT {PROP : bi} (P : PROP) (φ : Type) :=
from_pureT : ψ : Prop, φ = ψ FromPure a P ψ. from_pureT : ψ : Prop, φ = ψ FromPure P ψ.
Lemma from_pureT_hint {PROP : bi} (a : bool) (P : PROP) (φ : Prop) : Lemma from_pureT_hint {PROP : bi} (P : PROP) (φ : Prop) : FromPure P φ FromPureT P φ.
FromPure a P φ FromPureT a P φ.
Proof. by exists φ. Qed. Proof. by exists φ. Qed.
Hint Extern 0 (FromPureT _ _ _) => Hint Extern 0 (FromPureT _ _) =>
notypeclasses refine (from_pureT_hint _ _ _ _) : typeclass_instances. notypeclasses refine (from_pureT_hint _ _ _) : typeclass_instances.
Class IntoInternalEq {PROP : sbi} {A : ofeT} (P : PROP) (x y : A) := Class IntoInternalEq {PROP : sbi} {A : ofeT} (P : PROP) (x y : A) :=
into_internal_eq : P x y. into_internal_eq : P x y.
...@@ -449,8 +448,8 @@ with the exception of: ...@@ -449,8 +448,8 @@ with the exception of:
*) *)
Instance into_pure_tc_opaque {PROP : bi} (P : PROP) φ : Instance into_pure_tc_opaque {PROP : bi} (P : PROP) φ :
IntoPure P φ IntoPure (tc_opaque P) φ := id. IntoPure P φ IntoPure (tc_opaque P) φ := id.
Instance from_pure_tc_opaque {PROP : bi} (a : bool) (P : PROP) φ : Instance from_pure_tc_opaque {PROP : bi} (P : PROP) φ :
FromPure a P φ FromPure a (tc_opaque P) φ := id. FromPure P φ FromPure (tc_opaque P) φ := id.
Instance from_laterN_tc_opaque {PROP : sbi} n (P Q : PROP) : Instance from_laterN_tc_opaque {PROP : sbi} n (P Q : PROP) :
FromLaterN n P Q FromLaterN n (tc_opaque P) Q := id. FromLaterN n P Q FromLaterN n (tc_opaque P) Q := id.
Instance from_wand_tc_opaque {PROP : bi} (P Q1 Q2 : PROP) : Instance from_wand_tc_opaque {PROP : bi} (P Q1 Q2 : PROP) :
......
...@@ -520,8 +520,8 @@ Proof. ...@@ -520,8 +520,8 @@ Proof.
Qed. Qed.
(** * Pure *) (** * Pure *)
Lemma tac_pure_intro Δ Q φ : FromPure false Q φ φ envs_entails Δ Q. Lemma tac_pure_intro Δ Q φ : FromPure Q φ φ envs_entails Δ Q.
Proof. intros ??. rewrite /envs_entails -(from_pure _ Q). by apply pure_intro. Qed. Proof. intros ??. rewrite /envs_entails -(from_pure Q). by apply pure_intro. Qed.
Lemma tac_pure Δ Δ' i p P φ Q : Lemma tac_pure Δ Δ' i p P φ Q :
envs_lookup_delete i Δ = Some (p, P, Δ') envs_lookup_delete i Δ = Some (p, P, Δ')
...@@ -821,14 +821,13 @@ Qed. ...@@ -821,14 +821,13 @@ Qed.
Lemma tac_specialize_assert_pure Δ Δ' j q R P1 P2 φ Q : Lemma tac_specialize_assert_pure Δ Δ' j q R P1 P2 φ Q :
envs_lookup j Δ = Some (q, R) envs_lookup j Δ = Some (q, R)
IntoWand q true R P1 P2 IntoWand q true R P1 P2
FromPure true P1 φ FromPure P1 φ
envs_simple_replace j q (Esnoc Enil j P2) Δ = Some Δ' envs_simple_replace j q (Esnoc Enil j P2) Δ = Some Δ'
φ envs_entails Δ' Q envs_entails Δ Q. φ envs_entails Δ' Q envs_entails Δ Q.
Proof. Proof.
rewrite /envs_entails=> ????? <-. rewrite envs_simple_replace_singleton_sound //=. rewrite /envs_entails=> ????? <-. rewrite envs_simple_replace_singleton_sound //=.
rewrite -affinely_persistently_if_idemp into_wand /= -(from_pure _ P1). rewrite -affinely_persistently_if_idemp into_wand /= -(from_pure P1).
rewrite pure_True //= persistently_affinely persistently_pure rewrite pure_True // persistently_pure affinely_True_emp affinely_emp.
affinely_True_emp affinely_emp.
by rewrite emp_wand wand_elim_r. by rewrite emp_wand wand_elim_r.
Qed. Qed.
...@@ -927,14 +926,14 @@ Proof. ...@@ -927,14 +926,14 @@ Proof.
Qed. Qed.
Lemma tac_assert_pure Δ Δ' j P P' φ Q : Lemma tac_assert_pure Δ Δ' j P P' φ Q :
FromPure true P φ FromPure P φ
FromAffinely P' P FromAffinely P' P
envs_app false (Esnoc Enil j P') Δ = Some Δ' envs_app false (Esnoc Enil j P') Δ = Some Δ'
φ envs_entails Δ' Q envs_entails Δ Q. φ envs_entails Δ' Q envs_entails Δ Q.
Proof. Proof.
rewrite /envs_entails => ???? <-. rewrite envs_app_singleton_sound //=. rewrite /envs_entails => ???? <-. rewrite envs_app_singleton_sound //=.
rewrite -(from_affinely P') -(from_pure _ P) pure_True //. rewrite -(from_affinely P') -(from_pure P) pure_True //.
by rewrite affinely_idemp affinely_True_emp affinely_emp emp_wand. by rewrite affinely_True_emp affinely_emp emp_wand.
Qed. Qed.
Lemma tac_pose_proof Δ Δ' j P Q : Lemma tac_pose_proof Δ Δ' j P Q :
......
...@@ -157,12 +157,12 @@ Qed. ...@@ -157,12 +157,12 @@ Qed.
Global Instance into_pure_monPred_at P φ i : IntoPure P φ IntoPure (P i) φ. Global Instance into_pure_monPred_at P φ i : IntoPure P φ IntoPure (P i) φ.
Proof. rewrite /IntoPure=>->. by rewrite monPred_at_pure. Qed. Proof. rewrite /IntoPure=>->. by rewrite monPred_at_pure. Qed.
Global Instance from_pure_monPred_at a P φ i : FromPure a P φ FromPure a (P i) φ. Global Instance from_pure_monPred_at P φ i : FromPure P φ FromPure (P i) φ.
Proof. rewrite /FromPure=><-. by rewrite monPred_at_affinely_if monPred_at_pure. Qed. Proof. rewrite /FromPure=><-. by rewrite monPred_at_pure. Qed.
Global Instance into_pure_monPred_in i j : @IntoPure PROP (monPred_in i j) (i j). Global Instance into_pure_monPred_in i j : @IntoPure PROP (monPred_in i j) (i j).
Proof. by rewrite /IntoPure monPred_at_in. Qed. Proof. by rewrite /IntoPure monPred_at_in. Qed.
Global Instance from_pure_monPred_in i j af : @FromPure PROP af (monPred_in i j) (i j). Global Instance from_pure_monPred_in i j : @FromPure PROP (monPred_in i j) (i j).
Proof. by rewrite /FromPure monPred_at_in bi.affinely_if_elim. Qed. Proof. by rewrite /FromPure monPred_at_in. Qed.
Global Instance into_persistent_monPred_at p P Q 𝓠 i : Global Instance into_persistent_monPred_at p P Q 𝓠 i :
IntoPersistent p P Q MakeMonPredAt i Q 𝓠 IntoPersistent p (P i) 𝓠 | 0. IntoPersistent p P Q MakeMonPredAt i Q 𝓠 IntoPersistent p (P i) 𝓠 | 0.
......
...@@ -230,7 +230,7 @@ Tactic Notation "iPureIntro" := ...@@ -230,7 +230,7 @@ Tactic Notation "iPureIntro" :=
iStartProof; iStartProof;
eapply tac_pure_intro; eapply tac_pure_intro;
[apply _ || [apply _ ||
let P := match goal with |- FromPure _ ?P _ => P end in let P := match goal with |- FromPure ?P _ => P end in
fail "iPureIntro:" P "not pure" fail "iPureIntro:" P "not pure"
|]. |].
...@@ -494,7 +494,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) := ...@@ -494,7 +494,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
[env_reflexivity || fail "iSpecialize:" H1 "not found" [env_reflexivity || fail "iSpecialize:" H1 "not found"
|solve_to_wand H1 |solve_to_wand H1
|apply _ || |apply _ ||
let Q := match goal with |- FromPure _ ?Q _ => Q end in let Q := match goal with |- FromPure ?Q _ => Q end in
fail "iSpecialize:" Q "not pure" fail "iSpecialize:" Q "not pure"
|env_reflexivity |env_reflexivity
|done_if d (*goal*) |done_if d (*goal*)
...@@ -1663,10 +1663,10 @@ Tactic Notation "iAssertCore" open_constr(Q) ...@@ -1663,10 +1663,10 @@ Tactic Notation "iAssertCore" open_constr(Q)
let Hs := spec_pat.parse Hs in let Hs := spec_pat.parse Hs in
lazymatch Hs with lazymatch Hs with
| [SPureGoal ?d] => | [SPureGoal ?d] =>
eapply tac_assert_pure with _ H Q _ _; eapply tac_assert_pure with _ H Q _;
[apply _ || fail "iAssert:" Q "not pure" [env_reflexivity
|apply _ || fail "iAssert:" Q "not pure"
|apply _ |apply _
|env_reflexivity
|done_if d (*goal*) |done_if d (*goal*)
|tac H] |tac H]
| [SGoal (SpecGoal GPersistent _ ?Hs_frame [] ?d)] => | [SGoal (SpecGoal GPersistent _ ?Hs_frame [] ?d)] =>
......
...@@ -300,18 +300,4 @@ Lemma test_iNext_later_laterN P n : ▷^n ▷ P ⊢ ▷ ▷^n P. ...@@ -300,18 +300,4 @@ Lemma test_iNext_later_laterN P n : ▷^n ▷ P ⊢ ▷ ▷^n P.
Proof. iIntros "H". iNext. by iNext. Qed. Proof. iIntros "H". iNext. by iNext. Qed.
Lemma test_iNext_laterN_laterN P n1 n2 : ^n1 ^n2 P ^n1 ^n2 P. Lemma test_iNext_laterN_laterN P n1 n2 : ^n1 ^n2 P ^n1 ^n2 P.
Proof. iIntros "H". iNext. iNext. by iNext. Qed. Proof. iIntros "H". iNext. iNext. by iNext. Qed.
Lemma test_specialize_affine_pure (φ : Prop) P :
φ (bi_affinely ⌜φ⌝ - P) P.
Proof.
iIntros (Hφ) "H". by iSpecialize ("H" with "[% //]").
Qed.
Lemma test_assert_affine_pure (φ : Prop) P :
φ P P bi_affinely ⌜φ⌝.
Proof. iIntros (Hφ). iAssert (bi_affinely ⌜φ⌝) with "[%]" as "$"; auto. Qed.
Lemma test_assert_pure (φ : Prop) P :
φ P P ⌜φ⌝.
Proof. iIntros (Hφ). iAssert ⌜φ⌝%I with "[%]" as "$"; auto. Qed.
End tests. End tests.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment