Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
Iris
Commits
1698a876
Commit
1698a876
authored
Feb 23, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support `bi_embed` in `iModIntro'. This fixes
#147
.
parent
6d1f3392
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
5 deletions
+38
-5
theories/proofmode/class_instances.v
theories/proofmode/class_instances.v
+23
-5
theories/proofmode/classes.v
theories/proofmode/classes.v
+10
-0
theories/tests/proofmode_monpred.v
theories/tests/proofmode_monpred.v
+5
-0
No files found.
theories/proofmode/class_instances.v
View file @
1698a876
...
...
@@ -62,6 +62,19 @@ Section bi_modalities.
Qed
.
Definition
modality_absorbingly
:
=
Modality
_
modality_absorbingly_mixin
.
Lemma
modality_embed_mixin
`
{
BiEmbedding
PROP
PROP'
}
:
modality_mixin
(@
bi_embed
PROP
PROP'
_
)
(
MIEnvTransform
IntoEmbed
)
(
MIEnvTransform
IntoEmbed
).
Proof
.
split
;
simpl
;
split_and
?
;
eauto
using
equiv_entails_sym
,
bi_embed_emp
,
bi_embed_sep
,
bi_embed_and
.
-
intros
P
Q
.
rewrite
/
IntoEmbed
=>
->.
by
rewrite
bi_embed_affinely
bi_embed_persistently
.
-
by
intros
P
Q
->.
Qed
.
Definition
modality_embed
`
{
BiEmbedding
PROP
PROP'
}
:
=
Modality
_
modality_embed_mixin
.
End
bi_modalities
.
Section
sbi_modalities
.
...
...
@@ -1126,11 +1139,16 @@ Qed.
Global
Instance
from_modal_absorbingly
P
:
FromModal
modality_absorbingly
(
bi_absorbingly
P
)
P
.
Proof
.
by
rewrite
/
FromModal
.
Qed
.
(* FIXME
Global Instance from_modal_embed `{BiEmbedding PROP PROP'} P Q :
FromModal P Q → FromModal ⎡P⎤ ⎡Q⎤.
Proof. by rewrite /FromModal=> ->. Qed.
*)
Global
Instance
from_modal_embed
`
{
BiEmbedding
PROP
PROP'
}
(
P
:
PROP
)
:
FromModal
(@
modality_embed
PROP
PROP'
_
_
)
⎡
P
⎤
P
.
Proof
.
by
rewrite
/
FromModal
.
Qed
.
(* ElimModal *)
(* IntoEmbed *)
Global
Instance
into_embed_embed
{
PROP'
:
bi
}
`
{
BiEmbed
PROP
PROP'
}
P
:
IntoEmbed
⎡
P
⎤
P
.
Proof
.
by
rewrite
/
IntoEmbed
.
Qed
.
(* AsValid *)
Global
Instance
as_valid_valid
{
PROP
:
bi
}
(
P
:
PROP
)
:
AsValid0
(
bi_valid
P
)
P
|
0
.
...
...
theories/proofmode/classes.v
View file @
1698a876
...
...
@@ -563,6 +563,16 @@ Arguments FromLaterN {_} _%nat_scope _%I _%I.
Arguments
from_laterN
{
_
}
_
%
nat_scope
_
%
I
_
%
I
{
_
}.
Hint
Mode
FromLaterN
+
-
!
-
:
typeclass_instances
.
(** The class [IntoEmbed P Q] is used to transform hypotheses while introducing
embeddings using [iModIntro].
Input: the proposition [P], output: the proposition [Q] so that [P ⊢ ⎡Q⎤] *)
Class
IntoEmbed
{
PROP
PROP'
:
bi
}
`
{
BiEmbed
PROP
PROP'
}
(
P
:
PROP'
)
(
Q
:
PROP
)
:
=
into_embed
:
P
⊢
⎡
Q
⎤
.
Arguments
IntoEmbed
{
_
_
_
}
_
%
I
_
%
I
.
Arguments
into_embed
{
_
_
_
}
_
%
I
_
%
I
{
_
}.
Hint
Mode
IntoEmbed
+
+
+
!
-
:
typeclass_instances
.
(* We use two type classes for [AsValid], in order to avoid loops in
typeclass search. Indeed, the [as_valid_embed] instance would try
to add an arbitrary number of embeddings. To avoid this, the
...
...
theories/tests/proofmode_monpred.v
View file @
1698a876
...
...
@@ -7,6 +7,7 @@ Section tests.
Local
Notation
monPredI
:
=
(
monPredI
I
PROP
).
Local
Notation
monPredSI
:
=
(
monPredSI
I
PROP
).
Implicit
Types
P
Q
R
:
monPred
.
Implicit
Types
𝓟
𝓠
𝓡
:
PROP
.
Implicit
Types
i
j
:
I
.
Lemma
test0
P
:
P
-
∗
P
.
...
...
@@ -79,6 +80,10 @@ Section tests.
∀
ᵢ
emp
-
∗
∀
ᵢ
P
-
∗
∀
ᵢ
Q
-
∗
R
-
∗
∀
ᵢ
(
P
∗
Q
).
Proof
.
iIntros
"#? HP HQ HR"
.
iAlways
.
by
iSplitL
"HP"
.
Qed
.
Lemma
test_iModIntro_embed
P
`
{!
Affine
Q
}
𝓟
𝓠
:
□
P
-
∗
Q
-
∗
⎡𝓟⎤
-
∗
⎡𝓠⎤
-
∗
⎡
𝓟
∗
𝓠
⎤
.
Proof
.
iIntros
"#H1 _ H2 H3"
.
iAlways
.
iFrame
.
Qed
.
(* This is a hack to avoid avoid coq bug #5735: sections variables
ignore hint modes. So we assume the instances in a way that
cannot be used by type class resolution, and then declare the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment