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
Marianna Rapoport
iris-coq
Commits
ab1f6c67
Commit
ab1f6c67
authored
Jun 23, 2016
by
Robbert Krebbers
Browse files
Remove wp_case, add wp_match.
This is more natural, match should be used in user code, not case.
parent
91d50c60
Changes
4
Hide whitespace changes
Inline
Side-by-side
heap_lang/lib/spawn.v
View file @
ab1f6c67
...
...
@@ -77,11 +77,11 @@ Proof.
iL
ö
b
as
"IH"
.
wp_rec
.
wp_focus
(!
_
)%
E
.
iInv
N
as
{
v
}
"[Hl Hinv]"
.
wp_load
.
iDestruct
"Hinv"
as
"[%|Hinv]"
;
subst
.
-
iSplitL
"Hl"
;
[
iNext
;
iExists
_;
iFrame
;
eauto
|].
wp_
case
.
wp_seq
.
iApply
(
"IH"
with
"Hγ Hv"
).
-
iDestruct
"Hinv"
as
{
v'
}
"[% [HΨ|Hγ']]"
;
s
ubst
.
wp_
match
.
iApply
(
"IH"
with
"Hγ Hv"
).
-
iDestruct
"Hinv"
as
{
v'
}
"[% [HΨ|Hγ']]"
;
s
implify_eq
/=
.
+
iSplitL
"Hl Hγ"
.
{
iNext
.
iExists
_;
iFrame
;
eauto
.
}
wp_
case
.
wp_let
.
iPvsIntro
.
by
iApply
"Hv"
.
wp_
match
.
by
iApply
"Hv"
.
+
iCombine
"Hγ"
"Hγ'"
as
"Hγ"
.
iDestruct
(
own_valid
with
"Hγ"
)
as
%[].
Qed
.
End
proof
.
...
...
heap_lang/wp_tactics.v
View file @
ab1f6c67
...
...
@@ -92,16 +92,16 @@ Tactic Notation "wp_if" :=
|
_
=>
fail
"wp_if: not a 'wp'"
end
.
Tactic
Notation
"wp_
case
"
:
=
Tactic
Notation
"wp_
match
"
:
=
lazymatch
goal
with
|
|-
_
⊢
wp
?E
?e
?Q
=>
reshape_expr
e
ltac
:
(
fun
K
e'
=>
match
eval
hnf
in
e'
with
|
Case
_
_
_
=>
wp_bind
K
;
etrans
;
[|
first
[
eapply
wp_
case
_inl
;
wp_done
|
eapply
wp_
case
_inr
;
wp_done
]]
;
wp_finish
end
)
||
fail
"wp_
case
: cannot find '
Case
' in"
e
|
_
=>
fail
"wp_
case
: not a 'wp'"
etrans
;
[|
first
[
eapply
wp_
match
_inl
;
wp_done
|
eapply
wp_
match
_inr
;
wp_done
]]
;
simpl_subst
;
wp_finish
end
)
||
fail
"wp_
match
: cannot find '
Match
' in"
e
|
_
=>
fail
"wp_
match
: not a 'wp'"
end
.
Tactic
Notation
"wp_focus"
open_constr
(
efoc
)
:
=
...
...
tests/one_shot.v
View file @
ab1f6c67
...
...
@@ -71,15 +71,15 @@ Proof.
+
iSplit
.
iRight
;
iExists
m
;
by
iSplitL
"Hl"
.
eauto
.
}
wp_let
.
iPvsIntro
.
iIntros
"!"
.
wp_seq
.
iDestruct
"Hv"
as
"[%|Hv]"
;
last
iDestruct
"Hv"
as
{
m
}
"[% Hγ']"
;
subst
.
{
wp_
case
.
wp_seq
.
by
iPvsIntro
.
}
wp_
case
.
wp_let
.
wp_focus
(!
_
)%
E
.
{
wp_
match
.
by
iPvsIntro
.
}
wp_
match
.
wp_focus
(!
_
)%
E
.
iInv
>
N
as
"[[Hl Hγ]|Hinv]"
;
last
iDestruct
"Hinv"
as
{
m'
}
"[Hl Hγ]"
.
{
iCombine
"Hγ"
"Hγ'"
as
"Hγ"
.
by
iDestruct
(
own_valid
with
"Hγ"
)
as
"%"
.
}
wp_load
.
iCombine
"Hγ"
"Hγ'"
as
"Hγ"
.
iDestruct
(
own_valid
with
"#Hγ"
)
as
%[=->]%
dec_agree_op_inv
.
iSplitL
"Hl"
;
[
iRight
;
by
eauto
|].
wp_
case
.
wp_let
.
iApply
wp_assert'
.
wp_op
=>?
;
simplify_eq
/=
;
eauto
.
wp_
match
.
iApply
wp_assert'
.
wp_op
=>?
;
simplify_eq
/=
;
eauto
.
Qed
.
Lemma
hoare_one_shot
(
Φ
:
val
→
iProp
)
:
...
...
tests/tree_sum.v
View file @
ab1f6c67
...
...
@@ -40,13 +40,13 @@ Lemma sum_loop_wp `{!heapG Σ} heapN v t l (n : Z) (Φ : val → iPropG heap_lan
⊢
WP
sum_loop
v
#
l
{{
Φ
}}.
Proof
.
iIntros
"(#Hh & Hl & Ht & HΦ)"
.
iL
ö
b
{
v
t
l
n
Φ
}
as
"IH"
.
wp_rec
.
wp_let
.
iL
ö
b
{
v
t
l
n
Φ
}
as
"IH"
.
wp_rec
;
wp_let
.
destruct
t
as
[
n'
|
tl
tr
]
;
simpl
in
*.
-
iDestruct
"Ht"
as
"%"
;
subst
.
wp_
case
.
wp_let
.
wp_load
.
wp_op
.
wp_store
.
wp_
match
.
wp_load
.
wp_op
.
wp_store
.
by
iApply
(
"HΦ"
with
"Hl"
).
-
iDestruct
"Ht"
as
{
ll
lr
vl
vr
}
"(% & Hll & Htl & Hlr & Htr)"
;
subst
.
wp_
case
.
wp_let
.
wp_proj
.
wp_load
.
wp_
match
.
wp_proj
.
wp_load
.
wp_apply
(
"IH"
with
"Hl Htl"
).
iIntros
"Hl Htl"
.
wp_seq
.
wp_proj
.
wp_load
.
wp_apply
(
"IH"
with
"Hl Htr"
).
iIntros
"Hl Htr"
.
...
...
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