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
Iris
Iris
Commits
18221e5f
Commit
18221e5f
authored
Feb 17, 2016
by
Robbert Krebbers
Browse files
wp tactical to apply lemmas under contexts.
parent
d80e20a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
barrier/barrier.v
View file @
18221e5f
...
...
@@ -129,7 +129,7 @@ Section proof.
⊑
wp
⊤
(
newchan
'
())
Q
.
Proof
.
rewrite
/
newchan
.
wp_rec
.
(* TODO: wp_seq. *)
rewrite
-
wp_pvs
.
eapply
wp_alloc
;
eauto
with
I
ndisj
.
rewrite
-
later_intro
.
rewrite
-
wp_pvs
.
wp
>
eapply
wp_alloc
;
eauto
with
I
ndisj
.
apply
forall_intro
=>
l
.
rewrite
(
forall_elim
l
).
apply
wand_intro_l
.
rewrite
!
assoc
.
apply
pvs_wand_r
.
(* The core of this proof: Allocating the STS and the saved prop. *)
...
...
heap_lang/tests.v
View file @
18221e5f
...
...
@@ -31,19 +31,10 @@ Section LiftingTests.
Goal
∀
N
,
heap_ctx
N
⊑
wp
N
e
(
λ
v
,
v
=
'
2
).
Proof
.
move
=>
N
.
rewrite
/
e
.
wp_focus
(
ref
'
1
)%
L
.
eapply
wp_alloc
;
eauto
;
[].
rewrite
-
later_intro
;
apply
forall_intro
=>
l
;
apply
wand_intro_l
.
wp_rec
.
wp_focus
(!
LocV
l
)%
L
.
eapply
wp_load
;
eauto
with
I
;
[].
rewrite
-
later_intro
.
apply
sep_mono_r
.
rewrite
-
later_intro
;
apply
wand_intro_l
.
wp_bin_op
.
wp_focus
(
_
<-
_
)%
L
.
eapply
wp_store
;
eauto
with
I
;
[].
rewrite
-
later_intro
.
apply
sep_mono_r
.
rewrite
-
later_intro
.
apply
wand_intro_l
.
wp_rec
.
eapply
wp_load
;
eauto
with
I
;
[].
rewrite
-
later_intro
.
apply
sep_mono_r
.
rewrite
-
later_intro
.
apply
wand_intro_l
.
wp
>
eapply
wp_alloc
;
eauto
.
apply
forall_intro
=>
l
;
apply
wand_intro_l
.
wp_rec
.
wp
>
eapply
wp_load
;
eauto
with
I
.
apply
sep_mono_r
,
wand_intro_l
.
wp_bin_op
.
wp
>
eapply
wp_store
;
eauto
with
I
.
apply
sep_mono_r
,
wand_intro_l
.
wp_rec
.
wp
>
eapply
wp_load
;
eauto
with
I
.
apply
sep_mono_r
,
wand_intro_l
.
by
apply
const_intro
.
Qed
.
...
...
@@ -74,17 +65,15 @@ Section LiftingTests.
Proof
.
wp_rec
>
;
apply
later_mono
;
wp_bin_op
=>
?
;
wp_if
.
-
wp_un_op
.
wp_bin_op
.
wp
_focus
(
FindPred
_
_
)
;
rewrite
-
FindPred_spec
.
e
wp
apply
FindPred_spec
.
apply
and_intro
;
first
auto
with
I
omega
.
wp_un_op
.
by
replace
(
n
-
1
)
with
(-
(-
n
+
2
-
1
))
by
omega
.
-
r
ew
rite
-
FindPred_spec
.
auto
with
I
omega
.
-
ew
p
apply
FindPred_spec
.
auto
with
I
omega
.
Qed
.
Goal
∀
E
,
True
⊑
wp
(
Σ
:
=
globalF
Σ
)
E
(
let
:
"x"
:
=
Pred
'
42
in
Pred
"x"
)
(
λ
v
,
v
=
'
40
).
Proof
.
intros
E
.
wp_focus
(
Pred
_
)
;
rewrite
-
Pred_spec
-
later_intro
.
wp_rec
.
rewrite
-
Pred_spec
-
later_intro
;
auto
with
I
.
intros
.
ewp
>
apply
Pred_spec
.
wp_rec
.
ewp
>
apply
Pred_spec
.
auto
with
I
.
Qed
.
End
LiftingTests
.
heap_lang/wp_tactics.v
View file @
18221e5f
...
...
@@ -81,3 +81,13 @@ Tactic Notation "wp_focus" open_constr(efoc) :=
|
|-
_
⊑
wp
?E
?e
?Q
=>
reshape_expr
e
ltac
:
(
fun
K
e'
=>
match
e'
with
efoc
=>
unify
e'
efoc
;
wp_bind
K
end
)
end
.
Tactic
Notation
"wp"
tactic
(
tac
)
:
=
match
goal
with
|
|-
_
⊑
wp
?E
?e
?Q
=>
reshape_expr
e
ltac
:
(
fun
K
e'
=>
wp_bind
K
;
tac
)
end
.
Tactic
Notation
"wp"
">"
tactic
(
tac
)
:
=
(
wp
tac
)
;
wp_strip_later
.
(* In case the precondition does not match *)
Tactic
Notation
"ewp"
tactic
(
tac
)
:
=
wp
(
etransitivity
;
[|
tac
]).
Tactic
Notation
"ewp"
">"
tactic
(
tac
)
:
=
wp
>
(
etransitivity
;
[|
tac
]).
Write
Preview
Supports
Markdown
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