Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Khalanskiy
Iris
Commits
a1ea5292
Commit
a1ea5292
authored
Aug 23, 2016
by
Robbert Krebbers
Browse files
Prove adequacy of observational view shifts.
This implements issue #3.
parent
8111cab0
Changes
1
Hide whitespace changes
Inline
Side-by-side
program_logic/adequacy.v
View file @
a1ea5292
...
...
@@ -87,6 +87,13 @@ Qed.
Instance
rvs_iter_mono
n
:
Proper
((
⊢
)
==>
(
⊢
))
(
Nat
.
iter
n
(
λ
P
,
|=
r
=>
▷
P
)%
I
).
Proof
.
intros
P
Q
HP
.
induction
n
;
simpl
;
do
2
?f_equiv
;
auto
.
Qed
.
Lemma
rvs_iter_frame_l
n
R
Q
:
R
★
Nat
.
iter
n
(
λ
P
,
|=
r
=>
▷
P
)
Q
⊢
Nat
.
iter
n
(
λ
P
,
|=
r
=>
▷
P
)
(
R
★
Q
).
Proof
.
induction
n
as
[|
n
IH
]
;
simpl
;
[
done
|].
by
rewrite
rvs_frame_l
{
1
}(
later_intro
R
)
-
later_sep
IH
.
Qed
.
Lemma
wptp_result
n
e1
t1
v2
t2
σ
1
σ
2
φ
:
nsteps
step
n
(
e1
::
t1
,
σ
1
)
(
of_val
v2
::
t2
,
σ
2
)
→
world
σ
1
★
WP
e1
{{
v
,
■
φ
v
}}
★
wptp
t1
⊢
...
...
@@ -119,6 +126,23 @@ Proof.
iApply
wp_safe
.
iFrame
"Hw"
.
iApply
(
big_sep_elem_of
with
"Htp"
)
;
apply
elem_of_list_fmap
;
eauto
.
Qed
.
Lemma
wptp_invariance
n
e1
e2
t1
t2
σ
1
σ
2
I
φ
:
PersistentP
I
→
nsteps
step
n
(
e1
::
t1
,
σ
1
)
(
t2
,
σ
2
)
→
(
I
={
⊤
,
∅
}=>
∃
σ
'
,
ownP
σ
'
∧
■
φ
σ
'
)
→
I
★
world
σ
1
★
WP
e1
{{
_
,
True
}}
★
wptp
t1
⊢
Nat
.
iter
(
S
(
S
n
))
(
λ
P
,
|=
r
=>
▷
P
)
(
■
φ
σ
2
).
Proof
.
intros
??
HI
.
rewrite
wptp_steps
//.
rewrite
(
Nat_iter_S_r
(
S
n
))
rvs_iter_frame_l
.
apply
rvs_iter_mono
.
iIntros
"[HI H]"
.
iDestruct
"H"
as
(
e2'
t2'
)
"(% & (Hw&HE&Hσ) & _)"
;
subst
.
rewrite
pvs_eq
in
HI
;
iVs
(
HI
with
"HI [Hw HE]"
)
as
"> (_ & _ & H)"
;
first
by
iFrame
.
iDestruct
"H"
as
(
σ
2
'
)
"[Hσf %]"
.
iDestruct
(
ownP_agree
σ
2
σ
2
'
with
"[#]"
)
as
%<-.
by
iFrame
.
eauto
.
Qed
.
End
adequacy
.
Theorem
wp_adequacy
Σ
`
{
irisPreG
Λ
Σ
}
e
σ
φ
:
...
...
@@ -137,3 +161,18 @@ Proof.
iVsIntro
.
iNext
.
iApply
wptp_safe
;
eauto
.
iFrame
"Hw HE Hσ"
.
iSplitL
;
auto
.
by
iApply
Hwp
.
Qed
.
Theorem
wp_invariance
Σ
`
{
irisPreG
Λ
Σ
}
(
I
:
iProp
Σ
)
e
φ
σ
1
t2
σ
2
:
PersistentP
I
→
(
∀
`
{
irisG
Λ
Σ
},
ownP
σ
1
={
⊤
}=>
I
★
WP
e
{{
_
,
True
}})
→
(
∀
`
{
irisG
Λ
Σ
},
I
={
⊤
,
∅
}=>
∃
σ
'
,
ownP
σ
'
∧
■
φ
σ
'
)
→
rtc
step
([
e
],
σ
1
)
(
t2
,
σ
2
)
→
φ
σ
2
.
Proof
.
intros
?
Hwp
HI
[
n
?]%
rtc_nsteps
.
eapply
(
adequacy
(
M
:
=
iResUR
Σ
)
_
(
S
(
S
(
S
n
))))
;
iIntros
""
.
rewrite
Nat_iter_S
.
iVs
(
iris_alloc
σ
1
)
as
(?)
"(Hw & HE & ? & Hσ)"
.
rewrite
pvs_eq
in
Hwp
.
iVs
(
Hwp
_
with
"Hσ [Hw HE]"
)
as
">(? & ? & ? & ?)"
;
first
by
iFrame
.
iVsIntro
.
iNext
.
iApply
wptp_invariance
;
eauto
.
by
iFrame
.
Qed
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment