Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Actris
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Dan Frumin
Actris
Commits
b62c61b1
Commit
b62c61b1
authored
4 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Clean up ugly proof.
parent
afe8722d
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
theories/utils/llist.v
+12
-16
12 additions, 16 deletions
theories/utils/llist.v
with
12 additions
and
16 deletions
theories/utils/llist.v
+
12
−
16
View file @
b62c61b1
...
...
@@ -264,13 +264,13 @@ Lemma lreverse_at_spec l xs acc ys :
{{{
l'
,
RET
#
l'
;
llist
I
l'
(
reverse
xs
++
ys
)
}}}
.
Proof
.
iIntros
(
Φ
)
"[Hl Hacc] HΦ"
.
iInduction
xs
as
[|
x
xs
]
"IH"
forall
(
l
acc
Φ
ys
)
.
-
wp_lam
.
wp_load
.
wp_pures
.
iApply
"HΦ"
.
rewrite
app_nil_l
.
iApply
"Hacc"
.
-
wp_lam
.
iDestruct
"Hl"
as
(
v
l'
)
"[HI [Hl Hl']]"
.
iInduction
xs
as
[|
x
xs
]
"IH"
forall
(
l
acc
Φ
ys
)
;
simpl
;
wp_lam
.
-
wp_load
.
wp_pures
.
iApply
"HΦ"
.
iApply
"Hacc"
.
-
iDestruct
"Hl"
as
(
v
l'
)
"[HI [Hl Hl']]"
.
wp_load
.
wp_smart_apply
(
lcons_spec
with
"[$Hacc $HI]"
)
.
iIntros
"Hacc"
.
wp_smart_apply
(
"IH"
with
"Hl' Hacc"
)
.
iIntros
(
l''
)
"Hl''"
.
iApply
"HΦ"
.
rewrite
reverse_cons
-
app_
assoc
.
iApply
"Hl''"
.
rewrite
reverse_cons
-
assoc
_L
.
iApply
"Hl''"
.
Qed
.
Lemma
lreverse_spec
l
xs
:
...
...
@@ -279,29 +279,25 @@ Lemma lreverse_spec l xs :
{{{
RET
#
();
llist
I
l
(
reverse
xs
)
}}}
.
Proof
.
iIntros
(
Φ
)
"Hl HΦ"
.
wp_lam
.
destruct
xs
.
destruct
xs
as
[|
x
xs
];
simpl
.
-
wp_load
.
wp_alloc
l'
as
"Hl'"
.
wp_smart_apply
(
lnil_spec
)=>
//
.
wp_smart_apply
(
lnil_spec
with
"[//]"
)
.
iIntros
(
lnil
)
"Hlnil"
.
iAssert
(
llist
I
l'
[])
with
"Hl'"
as
"Hl'"
.
wp_smart_apply
(
lreverse_at_spec
with
"[$Hl' $Hlnil]"
)
.
iIntros
(
l''
)
"Hl''"
.
wp_load
.
wp_store
.
iApply
"HΦ"
.
rewrite
app_nil_r
.
iApply
"Hl"
.
wp_load
.
wp_store
.
iApply
"HΦ"
.
rewrite
right_id_L
.
iApply
"Hl"
.
-
iDestruct
"Hl"
as
(
v
lcons
)
"[HI [Hlcons Hrec]]"
.
wp_load
.
wp_alloc
l'
as
"Hl'"
.
wp_smart_apply
(
lnil_spec
)=>
//
.
wp_smart_apply
(
lnil_spec
with
"[//]"
)
.
iIntros
(
lnil
)
"Hlnil"
.
wp_smart_apply
(
lreverse_at_spec
_
(
a
::
xs
)
with
"[Hl' HI Hrec Hlnil]"
)
.
{
iFrame
"Hlnil"
.
iExists
v
,
lcons
.
iFrame
.
}
iIntros
(
l''
)
"Hl''"
.
assert
(
∃
ys
,
ys
=
reverse
(
a
::
xs
))
as
[
ys
Hys
]
.
{
by
exists
(
reverse
(
a
::
xs
))
.
}
rewrite
-
Hys
.
destruct
ys
.
wp_smart_apply
(
lreverse_at_spec
_
(
x
::
xs
)
with
"[Hl' HI Hrec $Hlnil]"
)
.
{
simpl
;
eauto
with
iFrame
.
}
iIntros
(
l''
)
"Hl''"
.
rewrite
right_id_L
.
destruct
(
reverse
_)
as
[|
y
ys
]
.
+
wp_load
.
wp_store
.
by
iApply
"HΦ"
.
+
simpl
.
iDestruct
"Hl''"
as
(
v'
lcons'
)
"[HI [Hcons Hrec]]"
.
wp_load
.
wp_store
.
iApply
"HΦ"
.
rewrite
app_nil_r
.
eauto
with
iFrame
.
iApply
"HΦ"
.
eauto
with
iFrame
.
Qed
.
End
lists
.
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