Skip to content
Snippets Groups Projects
Commit 1e9db5bd authored by Ralf Jung's avatar Ralf Jung
Browse files

Merge branch 'robbert/iSpecialize_forall' into 'master'

Better instance for `IntoWand` of `∀ _ : φ, P`

Closes #492

See merge request iris/iris!860
parents c4aeb8dd 8812a3a3
No related branches found
No related tags found
No related merge requests found
...@@ -497,11 +497,13 @@ Proof. ...@@ -497,11 +497,13 @@ Proof.
-impl_wand_intuitionistically -pure_impl_forall -impl_wand_intuitionistically -pure_impl_forall
bi.persistently_elim //. bi.persistently_elim //.
Qed. Qed.
Global Instance into_wand_forall_prop_false p (φ : Prop) P : Global Instance into_wand_forall_prop_false p (φ : Prop) P :
Absorbing P IntoWand p false ( _ : φ, P) φ P. MakeAffinely φ
IntoWand p false ( _ : φ, P) P.
Proof. Proof.
intros ?. rewrite /MakeAffinely /IntoWand=> <-.
rewrite /IntoWand (intuitionistically_if_elim p) /= pure_wand_forall //. rewrite (intuitionistically_if_elim p) /=.
by rewrite -pure_impl_forall -persistent_impl_wand_affinely.
Qed. Qed.
Global Instance into_wand_forall {A} p q (Φ : A PROP) P Q x : Global Instance into_wand_forall {A} p q (Φ : A PROP) P Q x :
......
...@@ -178,6 +178,50 @@ Tactic failure: iSpecialize: Q not persistent. ...@@ -178,6 +178,50 @@ Tactic failure: iSpecialize: Q not persistent.
⌜φ⌝ ⌜φ⌝
1 goal 1 goal
PROP : bi
BiAffine0 : BiAffine PROP
φ : Prop
P, Q : PROP
H : φ
============================
"H1" : P
--------------------------------------□
⌜φ⌝
"test_iSpecialize_impl_pure"
: string
1 goal
PROP : bi
φ : Prop
P, Q : PROP
H : φ
============================
--------------------------------------∗
<affine> ⌜φ⌝
1 goal
PROP : bi
φ : Prop
P, Q : PROP
H : φ
============================
"H1" : P
--------------------------------------□
<affine> ⌜φ⌝
"test_iSpecialize_impl_pure_affine"
: string
1 goal
PROP : bi
BiAffine0 : BiAffine PROP
φ : Prop
P, Q : PROP
H : φ
============================
--------------------------------------∗
⌜φ⌝
1 goal
PROP : bi PROP : bi
BiAffine0 : BiAffine PROP BiAffine0 : BiAffine PROP
φ : Prop φ : Prop
......
...@@ -480,6 +480,38 @@ Restart. ...@@ -480,6 +480,38 @@ Restart.
by iFrame. by iFrame.
Abort. Abort.
Check "test_iSpecialize_impl_pure".
Lemma test_iSpecialize_forall_pure (φ : Prop) P Q :
φ ( _ : φ, P) -∗ ( _ : φ, Q) -∗ P Q.
Proof.
iIntros (?) "#H1 H2".
(* Adds an affine modality *)
iSpecialize ("H1" with "[]"). { Show. done. }
iSpecialize ("H2" with "[]"). { Show. done. }
Restart.
iIntros (?) "#H1 H2".
(* Solving it directly as a pure goal also works. *)
iSpecialize ("H1" with "[% //]").
iSpecialize ("H2" with "[% //]").
by iFrame.
Abort.
Check "test_iSpecialize_impl_pure_affine".
Lemma test_iSpecialize_forall_pure_affine `{!BiAffine PROP} (φ : Prop) P Q :
φ ( _ : φ, P) -∗ ( _ : φ, Q) -∗ P Q.
Proof.
iIntros (?) "#H1 H2".
(* Does not add an affine modality *)
iSpecialize ("H1" with "[]"). { Show. done. }
iSpecialize ("H2" with "[]"). { Show. done. }
Restart.
iIntros (?) "#H1 H2".
(* Solving it directly as a pure goal also works. *)
iSpecialize ("H1" with "[% //]").
iSpecialize ("H2" with "[% //]").
by iFrame.
Abort.
Check "test_iAssert_intuitionistic". Check "test_iAssert_intuitionistic".
Lemma test_iAssert_intuitionistic `{!BiBUpd PROP} P : Lemma test_iAssert_intuitionistic `{!BiBUpd PROP} P :
P -∗ |==> P. P -∗ |==> P.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment