Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PierreMarie Pédrot
Iris
Commits
c82cc68e
Commit
c82cc68e
authored
Mar 07, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generalize core to all BIs
parent
272d3554
Changes
3
Hide whitespace changes
Inline
Sidebyside
Showing
3 changed files
with
68 additions
and
2 deletions
+68
2
_CoqProject
_CoqProject
+1
1
theories/bi/lib/core.v
theories/bi/lib/core.v
+66
0
theories/bi/plainly.v
theories/bi/plainly.v
+1
1
No files found.
_CoqProject
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
...
...
theories/b
ase_logic
/lib/core.v
→
theories/b
i
/lib/core.v
View file @
c82cc68e
From
iris
.
b
ase_logic
Require
Import
base_logic
.
From
iris
.
b
i
Require
Export
bi
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 nonaffine 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"
.
...
...
theories/bi/plainly.v
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
.
...
...
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