Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Maxime Dénès
iris-coq
Commits
2796b786
Commit
2796b786
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make wp_strong_mono stronger and use it to prove wp_pvs.
parent
c390d512
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program_logic/weakestpre.v
+21
-26
21 additions, 26 deletions
program_logic/weakestpre.v
with
21 additions
and
26 deletions
program_logic/weakestpre.v
+
21
−
26
View file @
2796b786
...
...
@@ -89,6 +89,21 @@ Proof.
by
iDestruct
"H"
as
(
v'
)
"[% ?]"
;
simplify_eq
.
Qed
.
Lemma
wp_strong_mono
E1
E2
e
Φ
Ψ
:
E1
⊆
E2
→
(
∀
v
,
Φ
v
=
{
E2
}
=★
Ψ
v
)
★
WP
e
@
E1
{{
Φ
}}
⊢
WP
e
@
E2
{{
Ψ
}}
.
Proof
.
iIntros
(?)
"[HΦ H]"
.
iLöb
(
e
)
as
"IH"
.
rewrite
!
wp_unfold
/
wp_pre
.
iDestruct
"H"
as
"[Hv|[% H]]"
;
[
iLeft
|
iRight
]
.
{
iDestruct
"Hv"
as
(
v
)
"[% Hv]"
.
iExists
v
;
iSplit
;
first
done
.
iApply
(
"HΦ"
with
"==>[-]"
)
.
by
iApply
(
pvs_mask_mono
E1
_)
.
}
iSplit
;
[
done
|];
iIntros
(
σ1
)
"Hσ"
.
iApply
(
pvs_trans
_
E1
);
iApply
pvs_intro'
;
auto
.
iIntros
"Hclose"
.
iVs
(
"H"
$!
σ1
with
"Hσ"
)
as
"[$ H]"
.
iVsIntro
.
iNext
.
iIntros
(
e2
σ2
ef
Hstep
)
.
iVs
(
"H"
$!
_
σ2
ef
with
"[#]"
)
as
"($ & H & $)"
;
auto
.
iVs
"Hclose"
as
"_"
.
by
iApply
(
"IH"
with
"HΦ"
)
.
Qed
.
Lemma
pvs_wp
E
e
Φ
:
(|
=
{
E
}=>
WP
e
@
E
{{
Φ
}})
⊢
WP
e
@
E
{{
Φ
}}
.
Proof
.
rewrite
wp_unfold
/
wp_pre
.
iIntros
"H"
.
destruct
(
to_val
e
)
as
[
v
|]
eqn
:?
.
...
...
@@ -99,16 +114,7 @@ Proof.
iDestruct
"H"
as
(
v'
)
"[% ?]"
;
simplify_eq
.
Qed
.
Lemma
wp_pvs
E
e
Φ
:
WP
e
@
E
{{
v
,
|
=
{
E
}=>
Φ
v
}}
⊢
WP
e
@
E
{{
Φ
}}
.
Proof
.
iIntros
"H"
.
iLöb
(
E
e
Φ
)
as
"IH"
.
rewrite
!
wp_unfold
/
wp_pre
.
iDestruct
"H"
as
"[Hv|[% H]]"
;
[
iLeft
|
iRight
]
.
{
iDestruct
"Hv"
as
(
v
)
"[% Hv]"
.
iExists
v
;
iSplit
;
first
done
.
by
iVs
"Hv"
.
}
iSplit
;
[
done
|];
iIntros
(
σ1
)
"Hσ1"
.
iVs
(
"H"
$!
_
with
"Hσ1"
)
as
"[$ H]"
.
iVsIntro
;
iNext
;
iIntros
(
e2
σ2
ef
Hstep
)
.
iVs
(
"H"
$!
e2
σ2
ef
with
"[%]"
)
as
"($ & ? & $)"
;
eauto
.
by
iApply
"IH"
.
Qed
.
Proof
.
iIntros
"H"
.
iApply
(
wp_strong_mono
E
);
try
iFrame
;
auto
.
Qed
.
Lemma
wp_atomic
E1
E2
e
Φ
:
atomic
e
→
...
...
@@ -127,20 +133,6 @@ Proof.
iVs
(
wp_value_inv
with
"H"
)
as
"==> H"
.
by
iApply
wp_value'
.
Qed
.
Lemma
wp_strong_mono
E1
E2
e
Φ
Ψ
:
E1
⊆
E2
→
(
∀
v
,
Φ
v
-★
Ψ
v
)
★
WP
e
@
E1
{{
Φ
}}
⊢
WP
e
@
E2
{{
Ψ
}}
.
Proof
.
iIntros
(?)
"[HΦ H]"
.
iLöb
(
e
)
as
"IH"
.
rewrite
!
wp_unfold
/
wp_pre
.
iDestruct
"H"
as
"[Hv|[% H]]"
;
[
iLeft
|
iRight
]
.
{
iDestruct
"Hv"
as
(
v
)
"[% Hv]"
.
iExists
v
;
iSplit
;
first
done
.
iApply
(
pvs_mask_mono
E1
_);
first
done
.
by
iApply
(
"HΦ"
with
"==>[-]"
)
.
}
iSplit
;
[
done
|];
iIntros
(
σ1
)
"Hσ"
.
iApply
(
pvs_trans
_
E1
);
iApply
pvs_intro'
;
auto
.
iIntros
"Hclose"
.
iVs
(
"H"
$!
σ1
with
"Hσ"
)
as
"[$ H]"
.
iVsIntro
.
iNext
.
iIntros
(
e2
σ2
ef
Hstep
)
.
iVs
(
"H"
$!
_
σ2
ef
with
"[#]"
)
as
"($ & H & $)"
;
auto
.
iVs
"Hclose"
as
"_"
.
by
iApply
(
"IH"
with
"HΦ"
)
.
Qed
.
Lemma
wp_frame_step_l
E1
E2
e
Φ
R
:
to_val
e
=
None
→
E2
⊆
E1
→
(|
=
{
E1
,
E2
}=>
▷
|
=
{
E2
,
E1
}=>
R
)
★
WP
e
@
E2
{{
Φ
}}
⊢
WP
e
@
E1
{{
v
,
R
★
Φ
v
}}
.
...
...
@@ -175,7 +167,7 @@ Qed.
Lemma
wp_mono
E
e
Φ
Ψ
:
(
∀
v
,
Φ
v
⊢
Ψ
v
)
→
WP
e
@
E
{{
Φ
}}
⊢
WP
e
@
E
{{
Ψ
}}
.
Proof
.
iIntros
(
HΦ
)
"H"
;
iApply
(
wp_strong_mono
E
E
);
auto
.
iFrame
.
iIntros
(
v
)
.
iApply
HΦ
.
iFrame
.
iIntros
(
v
)
"?"
.
by
iApply
HΦ
.
Qed
.
Lemma
wp_mask_mono
E1
E2
e
Φ
:
E1
⊆
E2
→
WP
e
@
E1
{{
Φ
}}
⊢
WP
e
@
E2
{{
Φ
}}
.
Proof
.
iIntros
(?)
"H"
;
iApply
(
wp_strong_mono
E1
E2
);
auto
.
iFrame
;
eauto
.
Qed
.
...
...
@@ -212,7 +204,10 @@ Proof. iIntros (?) "[??]". iApply (wp_frame_step_r E E); try iFrame; eauto. Qed.
Lemma
wp_wand_l
E
e
Φ
Ψ
:
(
∀
v
,
Φ
v
-★
Ψ
v
)
★
WP
e
@
E
{{
Φ
}}
⊢
WP
e
@
E
{{
Ψ
}}
.
Proof
.
by
apply
wp_strong_mono
.
Qed
.
Proof
.
iIntros
"[H Hwp]"
.
iApply
(
wp_strong_mono
E
);
auto
.
iFrame
"Hwp"
.
iIntros
(?)
"?"
.
by
iApply
"H"
.
Qed
.
Lemma
wp_wand_r
E
e
Φ
Ψ
:
WP
e
@
E
{{
Φ
}}
★
(
∀
v
,
Φ
v
-★
Ψ
v
)
⊢
WP
e
@
E
{{
Ψ
}}
.
Proof
.
by
rewrite
comm
wp_wand_l
.
Qed
.
...
...
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