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
Rodolphe Lepigre
Iris
Commits
228f3a2e
Commit
228f3a2e
authored
Nov 29, 2017
by
Robbert Krebbers
Browse files
A tactic `wp_simpl_subst` that only simplifies in the `e` of `WP e @ E {{ Φ }}`.
parent
074339d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
theories/heap_lang/proofmode.v
View file @
228f3a2e
...
...
@@ -12,6 +12,18 @@ Ltac wp_simpl :=
let
e'
:
=
eval
simpl
in
e
in
change
(
envs_entails
Δ
(
wp
E
e'
Q
))
end
.
Lemma
tac_wp_simpl_subst
`
{
heapG
Σ
}
Δ
E
Φ
e
e'
:
e
=
e'
→
envs_entails
Δ
(
WP
e'
@
E
{{
Φ
}})
→
envs_entails
Δ
(
WP
e
@
E
{{
Φ
}}).
Proof
.
by
intros
->.
Qed
.
Ltac
wp_simpl_subst
:
=
try
iStartProof
;
try
lazymatch
goal
with
|
|-
envs_entails
?
Δ
(
wp
?E
?e
?Q
)
=>
eapply
tac_wp_simpl_subst
;
[
simpl_subst
;
reflexivity
|]
end
.
Lemma
tac_wp_pure
`
{
heapG
Σ
}
Δ
Δ
'
E
e1
e2
φ
Φ
:
PureExec
φ
e1
e2
→
φ
→
...
...
@@ -41,7 +53,7 @@ Tactic Notation "wp_pure" open_constr(efoc) :=
[
apply
_
(* PureExec *)
|
try
fast_done
(* The pure condition for PureExec *)
|
apply
_
(* IntoLaters *)
|
simpl_subst
;
try
wp_value_head
(* new goal *)
|
wp_
simpl_subst
;
try
wp_value_head
(* new goal *)
])
||
fail
"wp_pure: cannot find"
efoc
"in"
e
"or"
efoc
"is not a reduct"
|
_
=>
fail
"wp_pure: not a 'wp'"
...
...
theories/tests/tree_sum.v
View file @
228f3a2e
...
...
@@ -40,7 +40,7 @@ Lemma sum_loop_wp `{!heapG Σ} v t l (n : Z) :
{{{
RET
#()
;
l
↦
#(
sum
t
+
n
)
∗
is_tree
v
t
}}}.
Proof
.
iIntros
(
Φ
)
"[Hl Ht] HΦ"
.
iInduction
t
as
[
n'
|
tl
?
tr
]
"IH"
forall
(
v
l
n
Φ
)
;
wp_rec
;
wp_let
.
iInduction
t
as
[
n'
|
tl
?
tr
]
"IH"
forall
(
v
l
n
Φ
)
;
simpl
;
wp_rec
;
wp_let
.
-
iDestruct
"Ht"
as
"%"
;
subst
.
wp_match
.
wp_load
.
wp_op
.
wp_store
.
by
iApply
(
"HΦ"
with
"[$Hl]"
).
...
...
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