Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Ike Mulder
Iris
Commits
abe35b9c
Commit
abe35b9c
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add Robbert's global.v, change some names around, and prove allocation
parent
388fadb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_CoqProject
+1
-0
1 addition, 0 deletions
_CoqProject
program_logic/global_cmra.v
+76
-0
76 additions, 0 deletions
program_logic/global_cmra.v
with
77 additions
and
0 deletions
_CoqProject
+
1
−
0
View file @
abe35b9c
...
...
@@ -63,6 +63,7 @@ program_logic/resources.v
program_logic/hoare.v
program_logic/language.v
program_logic/tests.v
program_logic/global_cmra.v
heap_lang/heap_lang.v
heap_lang/heap_lang_tactics.v
heap_lang/lifting.v
...
...
This diff is collapsed.
Click to expand it.
program_logic/global_cmra.v
0 → 100644
+
76
−
0
View file @
abe35b9c
Require
Export
program_logic
.
ownership
program_logic
.
pviewshifts
.
Import
uPred
.
Definition
gid
:=
positive
.
Definition
globalC
(
Δ
:
gid
→
iFunctor
)
:
iFunctor
:=
iprodF
(
λ
i
,
mapF
gid
(
Δ
i
))
.
Class
InG
Λ
(
Δ
:
gid
→
iFunctor
)
(
i
:
gid
)
(
A
:
cmraT
)
:=
inG
:
A
=
Δ
i
(
laterC
(
iPreProp
Λ
(
globalC
Δ
)))
.
Definition
to_funC
{
Λ
}
{
Δ
:
gid
→
iFunctor
}
(
i
:
gid
)
`{
!
InG
Λ
Δ
i
A
}
(
a
:
A
)
:
Δ
i
(
laterC
(
iPreProp
Λ
(
globalC
Δ
)))
:=
eq_rect
A
id
a
_
inG
.
Definition
to_globalC
{
Λ
}
{
Δ
:
gid
→
iFunctor
}
(
i
:
gid
)
(
γ
:
gid
)
`{
!
InG
Λ
Δ
i
A
}
(
a
:
A
)
:
iGst
Λ
(
globalC
Δ
)
:=
iprod_singleton
i
{[
γ
↦
to_funC
_
a
]}
.
Definition
own
{
Λ
}
{
Δ
:
gid
→
iFunctor
}
(
i
:
gid
)
`{
!
InG
Λ
Δ
i
A
}
(
γ
:
gid
)
(
a
:
A
)
:
iProp
Λ
(
globalC
Δ
)
:=
ownG
(
Σ
:=
globalC
Δ
)
(
iprod_singleton
i
{[
γ
↦
to_funC
_
a
]})
.
Section
global
.
Context
{
Λ
:
language
}
{
Δ
:
gid
→
iFunctor
}
(
i
:
gid
)
`{
!
InG
Λ
Δ
i
A
}
.
Implicit
Types
a
:
A
.
Global
Instance
own_ne
γ
n
:
Proper
(
dist
n
==>
dist
n
)
(
own
i
γ
)
.
Proof
.
intros
m
m'
Hm
;
apply
ownG_ne
,
iprod_singleton_ne
,
singleton_ne
.
by
rewrite
/
to_funC
;
destruct
inG
.
Qed
.
Global
Instance
own_proper
γ
:
Proper
((
≡
)
==>
(
≡
))
(
own
i
γ
)
:=
ne_proper
_
.
Lemma
own_op
γ
a1
a2
:
own
i
γ
(
a1
⋅
a2
)
≡
(
own
i
γ
a1
★
own
i
γ
a2
)
%
I
.
Proof
.
rewrite
/
own
-
ownG_op
iprod_op_singleton
map_op_singleton
.
apply
ownG_proper
,
iprod_singleton_proper
,
(
fin_maps
.
singleton_proper
(
M
:=
gmap
_))
.
by
rewrite
/
to_funC
;
destruct
inG
.
Qed
.
(* TODO: This also holds if we just have ✓a at the current step-idx, as Iris
assertion. However, the map_updateP_alloc does not suffice to show this. *)
Lemma
own_alloc
E
a
:
✓
a
→
True
⊑
pvs
E
E
(
∃
γ
,
own
(
Δ
:=
Δ
)
i
γ
a
)
.
Proof
.
intros
Hm
.
set
(
P
m
:=
∃
γ
,
m
=
to_globalC
(
Δ
:=
Δ
)
i
γ
a
)
.
rewrite
-
(
pvs_mono
_
_
(
∃
m
,
■
P
m
∧
ownG
m
)
%
I
)
.
-
rewrite
-
pvs_updateP_empty
//
;
[]
.
subst
P
.
eapply
(
iprod_singleton_updateP_empty
i
)
.
+
eapply
map_updateP_alloc'
with
(
x
:=
to_funC
i
a
)
.
by
rewrite
/
to_funC
;
destruct
inG
.
+
simpl
.
move
=>?
[
γ
[
->
?]]
.
exists
γ
.
done
.
-
apply
exist_elim
=>
m
.
apply
const_elim_l
.
move
=>[
p
->
]
{
P
}
.
by
rewrite
-
(
exist_intro
p
)
.
Qed
.
Lemma
always_own_unit
γ
m
:
(
□
own
i
γ
(
unit
m
))
%
I
≡
own
i
γ
(
unit
m
)
.
Proof
.
rewrite
/
own
.
Admitted
.
Lemma
own_valid
γ
m
:
(
own
i
γ
m
)
⊑
(
✓
m
)
.
Proof
.
rewrite
/
own
ownG_valid
;
apply
uPred
.
valid_mono
.
intros
n
?
.
SearchAbout
validN
singletonM
.
Admitted
.
Lemma
own_valid_r'
γ
m
:
(
own
i
γ
m
)
⊑
(
own
i
γ
m
★
✓
m
)
.
Proof
.
apply
(
uPred
.
always_entails_r'
_
_),
own_valid
.
Qed
.
Global
Instance
ownG_timeless
γ
m
:
Timeless
m
→
TimelessP
(
own
i
γ
m
)
.
Proof
.
intros
.
apply
ownG_timeless
.
SearchAbout
singletonM
Timeless
.
Admitted
.
End
global
.
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