Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
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
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
Paolo G. Giarrusso
iris
Commits
c82cc68e
Commit
c82cc68e
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
generalize core to all BIs
parent
272d3554
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_CoqProject
+1
-1
1 addition, 1 deletion
_CoqProject
theories/bi/lib/core.v
+66
-0
66 additions, 0 deletions
theories/bi/lib/core.v
theories/bi/plainly.v
+1
-1
1 addition, 1 deletion
theories/bi/plainly.v
with
68 additions
and
2 deletions
_CoqProject
+
1
−
1
View file @
c82cc68e
...
...
@@ -39,6 +39,7 @@ theories/bi/monpred.v
theories/bi/embedding.v
theories/bi/lib/fractional.v
theories/bi/lib/atomic.v
theories/bi/lib/core.v
theories/base_logic/upred.v
theories/base_logic/derived.v
theories/base_logic/base_logic.v
...
...
@@ -58,7 +59,6 @@ theories/base_logic/lib/boxes.v
theories/base_logic/lib/na_invariants.v
theories/base_logic/lib/cancelable_invariants.v
theories/base_logic/lib/gen_heap.v
theories/base_logic/lib/core.v
theories/base_logic/lib/fancy_updates_from_vs.v
theories/program_logic/adequacy.v
theories/program_logic/lifting.v
...
...
This diff is collapsed.
Click to expand it.
theories/b
ase_logic
/lib/core.v
→
theories/b
i
/lib/core.v
+
66
−
0
View file @
c82cc68e
From
iris
.
b
ase_logic
Require
Im
port
b
ase_logic
.
From
iris
.
b
i
Require
Ex
port
b
i
plainly
.
From
iris
.
proofmode
Require
Import
tactics
.
Set
Default
Proof
Using
"Type"
.
Import
uPred
.
Import
bi
.
(** The "core" of an assertion is its maximal persistent part,
i.e. the conjunction of all persistent assertions that are weaker
than P (as in, implied by P). *)
Definition
coreP
{
M
:
ucmraT
}
(
P
:
uPred
M
)
:
uPred
M
:=
(
∀
Q
,
■
(
P
→
□
Q
)
→
□
Q
)
%
I
.
Definition
coreP
`{
!
BiPlainly
PROP
}
(
P
:
PROP
)
:
PROP
:=
(
∀
Q
:
PROP
,
■
(
Q
-∗
<
pers
>
Q
)
→
■
(
P
-∗
Q
)
→
Q
)
%
I
.
Instance
:
Params
(
@
coreP
)
1
.
Typeclasses
Opaque
coreP
.
Section
core
.
Context
{
M
:
ucmraT
}
.
Implicit
Types
P
Q
:
uPred
M
.
Context
`{
!
BiPlainly
PROP
}
.
Implicit
Types
P
Q
:
PROP
.
Lemma
coreP_intro
P
:
P
-∗
coreP
P
.
Proof
.
rewrite
/
coreP
.
iIntros
"HP"
(
Q
)
"HPQ"
.
by
iApply
"HPQ"
.
Qed
.
Proof
.
rewrite
/
coreP
.
iIntros
"HP"
(
Q
)
"_ HPQ"
.
(* FIXME: Cannot apply HPQ directly. *)
iDestruct
(
affinely_plainly_elim
with
"HPQ"
)
as
"HPQ"
.
by
iApply
"HPQ"
.
Qed
.
Global
Instance
coreP_persistent
P
:
Persistent
(
coreP
P
)
.
Proof
.
rewrite
/
coreP
/
Persistent
.
iIntros
"#HC"
(
Q
)
"!#"
.
iApply
"HC"
.
Qed
.
Proof
.
rewrite
/
coreP
/
Persistent
.
iIntros
"HC"
(
Q
)
.
iApply
persistently_impl_plainly
.
iIntros
"#HQ"
.
iApply
persistently_impl_plainly
.
iIntros
"#HPQ"
.
iApply
"HQ"
.
(* FIXME: [iApply "HC"] should work. *)
iSpecialize
(
"HC"
with
"HQ"
)
.
iSpecialize
(
"HC"
with
"HPQ"
)
.
done
.
Qed
.
Global
Instance
coreP_ne
:
NonExpansive
(
@
coreP
M
)
.
Global
Instance
coreP_ne
:
NonExpansive
(
coreP
(
PROP
:=
PROP
)
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
coreP_proper
:
Proper
((
⊣⊢
)
==>
(
⊣⊢
))
(
@
coreP
M
)
.
Global
Instance
coreP_proper
:
Proper
((
⊣⊢
)
==>
(
⊣⊢
))
(
coreP
(
PROP
:=
PROP
)
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
coreP_mono
:
Proper
((
⊢
)
==>
(
⊢
))
(
@
coreP
M
)
.
Global
Instance
coreP_mono
:
Proper
((
⊢
)
==>
(
⊢
))
(
coreP
(
PROP
:=
PROP
)
)
.
Proof
.
solve_proper
.
Qed
.
Lemma
coreP_elim
P
:
Persistent
P
→
coreP
P
-∗
P
.
Proof
.
rewrite
/
coreP
.
iIntros
(?)
"HCP"
.
iApply
(
"HCP"
$!
P
with
"[]"
)
.
auto
.
rewrite
/
coreP
.
iIntros
(?)
"HCP"
.
iSpecialize
(
"HCP"
$!
P
)
.
(* FIXME: [iApply "HCP"] should work. *)
iAssert
(
■
(
P
-∗
<
pers
>
P
))
%
I
as
"#HPpers"
.
{
iModIntro
.
iApply
persistent
.
}
iSpecialize
(
"HCP"
with
"HPpers"
)
.
iAssert
(
■
(
P
-∗
P
))
%
I
as
"#HP"
.
{
iIntros
"!> HP"
.
done
.
}
iSpecialize
(
"HCP"
with
"HP"
)
.
done
.
Qed
.
Lemma
coreP_wand
P
Q
:
(
coreP
P
⊢
Q
)
↔
(
P
⊢
□
Q
)
.
(* TODO: Can we generalize this to non-affine BIs? *)
Lemma
coreP_wand
`{
!
BiAffine
PROP
}
P
Q
:
(
coreP
P
⊢
Q
)
↔
(
P
⊢
<
pers
>
Q
)
.
Proof
.
split
.
-
iIntros
(
HP
)
"HP"
.
iDestruct
(
coreP_intro
with
"HP"
)
as
"#HcP"
.
...
...
This diff is collapsed.
Click to expand it.
theories/bi/plainly.v
+
1
−
1
View file @
c82cc68e
From
iris
.
bi
Require
Ex
port
derived_laws
.
From
iris
.
bi
Require
Im
port
derived_laws
.
From
iris
.
algebra
Require
Import
monoid
.
Import
interface
.
bi
derived_laws
.
bi
.
...
...
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