Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rodolphe Lepigre
Iris
Commits
ab91a93a
Commit
ab91a93a
authored
Feb 10, 2016
by
Ralf Jung
Browse files
separate gid and gname
parent
d64e67b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
program_logic/ghost_ownership.v
View file @
ab91a93a
...
...
@@ -2,18 +2,22 @@ Require Export algebra.iprod program_logic.pviewshifts.
Require
Import
program_logic
.
ownership
.
Import
uPred
.
Definition
gid
:
=
positive
.
(** Index of a CMRA in the product of global CMRAs. *)
Definition
gid
:
=
nat
.
(** Name of one instance of a particular CMRA in the ghost state. *)
Definition
gname
:
=
positive
.
(** The global CMRA: Indexed product over a gid i to (gname --fin--> Σ i) *)
Definition
globalC
(
Σ
:
gid
→
iFunctor
)
:
iFunctor
:
=
iprodF
(
λ
i
,
mapF
g
id
(
Σ
i
)).
iprodF
(
λ
i
,
mapF
g
name
(
Σ
i
)).
Class
InG
(
Λ
:
language
)
(
Σ
:
gid
→
iFunctor
)
(
i
:
gid
)
(
A
:
cmraT
)
:
=
inG
:
A
=
Σ
i
(
laterC
(
iPreProp
Λ
(
globalC
Σ
))).
Definition
to_globalC
{
Λ
Σ
A
}
(
i
:
gid
)
`
{!
InG
Λ
Σ
i
A
}
(
γ
:
g
id
)
(
a
:
A
)
:
iGst
Λ
(
globalC
Σ
)
:
=
(
i
:
gid
)
`
{!
InG
Λ
Σ
i
A
}
(
γ
:
g
name
)
(
a
:
A
)
:
iGst
Λ
(
globalC
Σ
)
:
=
iprod_singleton
i
{[
γ
↦
cmra_transport
inG
a
]}.
Definition
own
{
Λ
Σ
A
}
(
i
:
gid
)
`
{!
InG
Λ
Σ
i
A
}
(
γ
:
g
id
)
(
a
:
A
)
:
iProp
Λ
(
globalC
Σ
)
:
=
(
i
:
gid
)
`
{!
InG
Λ
Σ
i
A
}
(
γ
:
g
name
)
(
a
:
A
)
:
iProp
Λ
(
globalC
Σ
)
:
=
ownG
(
to_globalC
i
γ
a
).
Instance
:
Params
(@
to_globalC
)
6
.
Instance
:
Params
(@
own
)
6
.
...
...
@@ -76,7 +80,7 @@ Proof. unfold own; apply _. 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
).
Lemma
own_alloc
a
E
:
✓
a
→
True
⊑
pvs
E
E
(
∃
γ
,
own
i
γ
a
).
Proof
.
intros
Ha
.
rewrite
-(
pvs_mono
_
_
(
∃
m
,
■
(
∃
γ
,
m
=
to_globalC
i
γ
a
)
∧
ownG
m
)%
I
).
...
...
@@ -86,7 +90,7 @@ Proof.
by
rewrite
-(
exist_intro
γ
).
Qed
.
Lemma
own_updateP
E
γ
a
P
:
Lemma
own_updateP
γ
a
P
E
:
a
~~>
:
P
→
own
i
γ
a
⊑
pvs
E
E
(
∃
a'
,
■
P
a'
∧
own
i
γ
a'
).
Proof
.
intros
Ha
.
...
...
@@ -98,7 +102,7 @@ Proof.
rewrite
-(
exist_intro
a'
).
by
apply
and_intro
;
[
apply
const_intro
|].
Qed
.
Lemma
own_updateP_empty
`
{
Empty
A
,
!
CMRAIdentity
A
}
E
γ
a
P
:
Lemma
own_updateP_empty
`
{
Empty
A
,
!
CMRAIdentity
A
}
γ
a
P
E
:
∅
~~>
:
P
→
True
⊑
pvs
E
E
(
∃
a
,
■
P
a
∧
own
i
γ
a
).
Proof
.
intros
Hemp
.
...
...
@@ -110,9 +114,9 @@ Proof.
rewrite
-(
exist_intro
a'
).
by
apply
and_intro
;
[
apply
const_intro
|].
Qed
.
Lemma
own_update
E
γ
a
a'
:
a
~~>
a'
→
own
i
γ
a
⊑
pvs
E
E
(
own
i
γ
a'
).
Lemma
own_update
γ
a
a'
E
:
a
~~>
a'
→
own
i
γ
a
⊑
pvs
E
E
(
own
i
γ
a'
).
Proof
.
intros
;
rewrite
(
own_updateP
E
_
_
(
a'
=))
;
last
by
apply
cmra_update_updateP
.
intros
;
rewrite
(
own_updateP
_
_
(
a'
=))
;
last
by
apply
cmra_update_updateP
.
by
apply
pvs_mono
,
uPred
.
exist_elim
=>
m''
;
apply
uPred
.
const_elim_l
=>
->.
Qed
.
End
global
.
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