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
Gaurav Parthasarathy
examples_rdcss_old
Commits
630bae21
Commit
630bae21
authored
Oct 19, 2016
by
Zhen Zhang
Browse files
Add doc; simplify proofs
parent
9bd501fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
evmap.v
View file @
630bae21
...
...
@@ -55,15 +55,17 @@ Section evmapR.
Global
Instance
persistent_ev
γ
m
k
v
:
PersistentP
(
ev
γ
m
k
v
).
Proof
.
apply
_
.
Qed
.
Lemma
evmap_alloc
γ
m
m
k
v
q
:
m
!!
k
=
None
→
✓
q
→
own
γ
m
(
●
m
)
⊢
|=
r
=>
own
γ
m
(
●
(<[
k
:
=
(
q
,
DecAgree
v
)
]>
m
)
⋅
◯
{[
k
:
=
(
q
,
DecAgree
v
)
]}).
(* Alloc a new mapsto *)
Lemma
evmap_alloc
γ
m
m
k
v
:
m
!!
k
=
None
→
own
γ
m
(
●
m
)
⊢
|=
r
=>
own
γ
m
(
●
(<[
k
:
=
((),
DecAgree
v
)
]>
m
)
⋅
◯
{[
k
:
=
((),
DecAgree
v
)
]}).
Proof
.
iIntros
(?
?
)
"Hm"
.
iIntros
(?)
"Hm"
.
iDestruct
(
own_update
with
"Hm"
)
as
"?"
;
last
by
iAssumption
.
apply
auth_update_alloc
.
apply
alloc_singleton_local_update
=>//.
Qed
.
(* Some other supporting lemmas *)
Lemma
map_agree_none'
γ
m
(
m
:
evmapR
K
A
unitR
)
hd
x
:
m
!!
hd
=
None
→
own
γ
m
(
●
m
)
★
ev
γ
m
hd
x
⊢
False
.
...
...
@@ -75,8 +77,8 @@ Section evmapR.
eapply
(
map_agree_none
_
_
_
m
)=>//.
Qed
.
Lemma
map_agree_eq'
γ
m
m
hd
p
x
agy
:
m
!!
hd
=
Some
(
p
,
agy
)
→
Lemma
map_agree_eq'
γ
m
m
hd
x
agy
:
m
!!
hd
=
Some
(
()
,
agy
)
→
ev
γ
m
hd
x
★
own
γ
m
(
●
m
)
⊢
DecAgree
x
=
agy
.
Proof
.
iIntros
(?)
"[#Hev Hom]"
.
...
...
@@ -94,30 +96,27 @@ Section evmapR.
by
destruct
H1
as
[?
?].
Qed
.
(* Evidence is the witness of membership *)
Lemma
ev_map_witness
γ
m
m
hd
x
:
ev
γ
m
hd
x
★
own
γ
m
(
●
m
)
⊢
m
!!
hd
=
Some
(
∅
,
DecAgree
x
).
Proof
.
iIntros
"[#Hev Hom]"
.
destruct
(
m
!!
hd
)
as
[[[]
agy
]|]
eqn
:
Heqn
.
-
iDestruct
(
map_agree_eq'
with
"[-]"
)
as
%
H'
=>//
;
first
by
iFrame
.
by
subst
.
-
iExFalso
.
iApply
map_agree_none'
=>//.
by
iFrame
.
-
iDestruct
(
map_agree_eq'
with
"[-]"
)
as
%
H'
=>//
;
first
by
iFrame
.
by
subst
.
-
iExFalso
.
iApply
map_agree_none'
=>//.
by
iFrame
.
Qed
.
Lemma
evmap_frag_agree_split
γ
m
p
q1
q2
(
a1
a2
:
A
)
:
own
γ
m
(
◯
{[
p
:
=
(
q1
,
DecAgree
a1
)]})
★
own
γ
m
(
◯
{[
p
:
=
(
q2
,
DecAgree
a2
)]})
⊢
(
a1
=
a2
).
(* Two evidences coincides *)
Lemma
evmap_frag_agree_split
γ
m
p
(
a1
a2
:
A
)
:
ev
γ
m
p
a1
★
ev
γ
m
p
a2
⊢
a1
=
a2
.
Proof
.
iIntros
"[Ho Ho']"
.
destruct
(
decide
(
a1
=
a2
))
as
[->|
Hneq
].
-
by
iFrame
.
-
iCombine
"Ho"
"Ho'"
as
"Ho"
.
rewrite
-(@
auth_frag_op
(
evmapR
K
A
unitR
)
{[
p
:
=
(
q1
,
DecAgree
a1
)]}
{[
p
:
=
(
q2
,
DecAgree
a2
)]}).
rewrite
-(@
auth_frag_op
(
evmapR
K
A
unitR
)
{[
p
:
=
(
_
,
DecAgree
a1
)]}
{[
p
:
=
(
_
,
DecAgree
a2
)]}).
iDestruct
(
own_valid
with
"Ho"
)
as
%
Hvalid
.
exfalso
.
rewrite
op_singleton
in
Hvalid
.
exfalso
.
rewrite
op_singleton
in
Hvalid
.
apply
auth_valid_discrete
in
Hvalid
.
simpl
in
Hvalid
.
apply
singleton_valid
in
Hvalid
.
destruct
Hvalid
as
[
_
Hvalid
].
...
...
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