Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
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
Rodolphe Lepigre
Iris
Commits
ab1f6c67
Commit
ab1f6c67
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Remove wp_case, add wp_match.
This is more natural, match should be used in user code, not case.
parent
91d50c60
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
heap_lang/lib/spawn.v
+3
-3
3 additions, 3 deletions
heap_lang/lib/spawn.v
heap_lang/wp_tactics.v
+5
-5
5 additions, 5 deletions
heap_lang/wp_tactics.v
tests/one_shot.v
+3
-3
3 additions, 3 deletions
tests/one_shot.v
tests/tree_sum.v
+3
-3
3 additions, 3 deletions
tests/tree_sum.v
with
14 additions
and
14 deletions
heap_lang/lib/spawn.v
+
3
−
3
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
.
...
...
This diff is collapsed.
Click to expand it.
heap_lang/wp_tactics.v
+
5
−
5
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
)
:=
...
...
This diff is collapsed.
Click to expand it.
tests/one_shot.v
+
3
−
3
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
)
:
...
...
This diff is collapsed.
Click to expand it.
tests/tree_sum.v
+
3
−
3
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"
.
...
...
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