Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marianna Rapoport
iris-coq
Commits
daef264e
Commit
daef264e
authored
7 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Port the core to use the plainness modality and prove it is non-expansive.
parent
25076b74
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/base_logic/lib/core.v
+12
-21
12 additions, 21 deletions
theories/base_logic/lib/core.v
with
12 additions
and
21 deletions
theories/base_logic/lib/core.v
+
12
−
21
View file @
daef264e
...
...
@@ -3,19 +3,9 @@ From iris.proofmode Require Import tactics.
Set
Default
Proof
Using
"Type"
.
Import
uPred
.
(** The "core" of an assertion is its maximal persistent part.
It can be defined entirely within the logic... at least
in the shallow embedding.
WARNING: The function "coreP" is NOT NON-EXPANSIVE.
This is because the turnstile is not non-expansive as a function
from iProp to (discreteC Prop).
To obtain a core that's non-expansive, we would have to add another
modality to the logic: a box that removes access to *all* resources,
not just restricts access to the core.
*)
(** The "core" of an assertion is its maximal persistent part. *)
Definition
coreP
{
M
:
ucmraT
}
(
P
:
uPred
M
)
:
uPred
M
:=
(
∀
`
(
!
Persistent
Q
),
⌜
P
⊢
Q
⌝
→
Q
)
%
I
.
(
∀
`
(
!
Persistent
Q
),
■
(
P
→
Q
)
→
Q
)
%
I
.
Instance
:
Params
(
@
coreP
)
1
.
Typeclasses
Opaque
coreP
.
...
...
@@ -24,25 +14,26 @@ Section core.
Implicit
Types
P
Q
:
uPred
M
.
Lemma
coreP_intro
P
:
P
-∗
coreP
P
.
Proof
.
rewrite
/
coreP
.
iIntros
"HP"
.
by
iIntros
(
Q
HQ
->
)
.
Qed
.
Proof
.
rewrite
/
coreP
.
iIntros
"HP"
.
iIntros
(
Q
HQ
)
"HPQ"
.
by
iApply
"HPQ"
.
Qed
.
Global
Instance
coreP_persistent
P
:
Persistent
(
coreP
P
)
.
Proof
.
rewrite
/
coreP
.
apply
_
.
Qed
.
Global
Instance
coreP_ne
:
NonExpansive
(
@
coreP
M
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
coreP_proper
:
Proper
((
⊣⊢
)
==>
(
⊣⊢
))
(
@
coreP
M
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
coreP_mono
:
Proper
((
⊢
)
==>
(
⊢
))
(
@
coreP
M
)
.
Proof
.
rewrite
/
coreP
.
iIntros
(
P
P'
?
)
"H"
;
iIntros
(
Q
?
?
)
.
iApply
(
"H"
$!
Q
with
"[
%
]"
)
.
by
etrans
.
rewrite
/
coreP
.
iIntros
(
P
P'
HP
)
"H"
;
iIntros
(
Q
?)
"#HPQ"
.
iApply
(
"H"
$!
Q
with
"[]"
)
.
by
rewrite
HP
.
Qed
.
Global
Instance
coreP_proper
:
Proper
((
⊣⊢
)
==>
(
⊣⊢
))
(
@
coreP
M
)
.
Proof
.
intros
P
Q
.
rewrite
!
equiv_spec
=>
-
[??]
.
by
split
;
apply
coreP_mono
.
Qed
.
Lemma
coreP_elim
P
:
Persistent
P
→
coreP
P
-∗
P
.
Proof
.
rewrite
/
coreP
.
iIntros
(?)
"HCP"
.
unshelve
iApply
(
"HCP"
$!
P
);
auto
.
Qed
.
Proof
.
rewrite
/
coreP
.
iIntros
(?)
"HCP"
.
iApply
(
"HCP"
$!
P
);
auto
.
Qed
.
Lemma
coreP_wand
P
Q
:
(
coreP
P
⊢
Q
)
↔
(
P
⊢
□
Q
)
.
Lemma
coreP_wand
P
Q
:
(
coreP
P
⊢
Q
)
↔
(
P
⊢
□
Q
)
.
Proof
.
split
.
-
iIntros
(
HP
)
"HP"
.
iDestruct
(
coreP_intro
with
"HP"
)
as
"#HcP"
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment