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
Dan Frumin
ReLoC-v1
Commits
aa7404a7
Commit
aa7404a7
authored
Sep 12, 2017
by
Dan Frumin
Browse files
Merge branch 'robbert' of bitbucket.org:Danya/iris-logrel
parents
9dc6e3a8
6ee8a3be
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/examples/stack/refinement.v
View file @
aa7404a7
...
...
@@ -84,13 +84,22 @@ Section Stack_refinement.
inv
stackN
(
sinv
τ
i
st
st
'
l
)
-
∗
{
⊤
,
⊤
;
τ
i
::
Δ
;
Γ
}
⊨
(
FG_pop
$
/
LitV
(
Loc
st
))
#()
≤
log
≤
(
CG_locked_pop
$
/
LitV
(
Loc
st
'
)
$
/
LitV
(
Loc
l
))
#()
:
TSum
TUnit
(
TVar
0
).
Proof
.
Transparent
CG_locked_pop
FG_pop
CG_pop
.
iIntros
"#Hinv"
.
Transparent
CG_locked_pop
FG_pop
CG_pop
.
unfold
FG_pop
,
CG_locked_pop
.
unlock
.
simpl_subst
/=
.
rel_rec_l
.
rel_rec_r
.
iL
ö
b
as
"IH"
.
rewrite
{
2
}/
FG_pop
.
unlock
.
simpl_subst
/=
.
replace
((
rec
:
"pop"
"st"
<>
:=
let:
"stv"
:=
!
"st"
in
let:
"x"
:=
!
(
Unfold
"stv"
)
in
match:
"x"
with
InjL
<>
=>
InjL
#()
|
InjR
"x"
=>
let:
"y"
:=
Fst
"x"
in
let
:
"ys"
:=
Snd
"x"
in
if
:
CAS
"st"
"stv"
"ys"
then
InjR
"y"
else
(
"pop"
"st"
)
#()
end
))
%
E
with
(
of_val
FG_pop
)
by
(
by
rewrite
/
FG_pop
;
unlock
).
rel_rec_l
.
rel_load_l_atomic
.
iInv
stackN
as
(
istk
v
h
)
"[Hoe [Hst' [Hst [#HLK Hl]]]]"
"Hclose"
.
iExists
_.
iFrame
.
...
...
@@ -103,6 +112,8 @@ Section Stack_refinement.
iDestruct
"HLK"
as
(
istk2
w
)
"(% & Histk & HLK)"
.
simplify_eq
/=
.
iDestruct
"HLK"
as
"[[% %] | HLK]"
;
simplify_eq
/=
.
-
(
*
The
stack
is
empty
*
)
rewrite
{
2
}/
CG_locked_pop
.
unlock
.
simpl_subst
/=
.
rel_rec_r
.
rel_apply_r
(
bin_log_related_acquire_r
with
"Hl"
).
{
solve_ndisj
.
}
iIntros
"Hl /="
.
...
...
@@ -160,6 +171,8 @@ Section Stack_refinement.
iDestruct
"HLK2"
as
"[[% %]|HLK2]"
;
simplify_eq
/=
.
iDestruct
"HLK2"
as
(
ym1
ym2
zm1
zm2
)
"[% [% [#Hrel #HLK2_tail]]]"
;
simplify_eq
/=
.
rewrite
{
2
}/
CG_locked_pop
.
unlock
.
simpl_subst
/=
.
rel_rec_r
.
rel_apply_r
(
bin_log_related_acquire_r
with
"Hl"
).
{
solve_ndisj
.
}
iIntros
"Hl /="
.
...
...
@@ -191,8 +204,8 @@ Section Stack_refinement.
iIntros
(
?
).
iNext
.
iIntros
"Hst"
.
rel_if_l
.
close_sinv
"Hclose"
"[Hoe Hst Hst' Hl HLK2]"
.
do
2
rel_rec_l
.
by
iApply
"IH"
.
rel_rec_l
.
iApply
"IH"
.
Qed
.
Lemma
FG_CG_pop_refinement
st
st
'
(
τ
i
:
D
)
l
{
τ
P
:
∀
ww
,
PersistentP
(
τ
i
ww
)
}
Δ
Γ
:
...
...
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