Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examples
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
Iris
examples
Commits
4f54a325
Commit
4f54a325
authored
4 months ago
by
Ralf Jung
Browse files
Options
Downloads
Plain Diff
Merge branch 'amin/ci/filer-spec' into 'master'
Make the spec for filter stronger See merge request
!68
parents
6cd37fd3
031d822e
No related branches found
Branches containing commit
No related tags found
1 merge request
!68
Make the spec for filter stronger
Pipeline
#115011
passed
2 months ago
Changes
1
Pipelines
59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/lecture_notes/lists.v
+13
-14
13 additions, 14 deletions
theories/lecture_notes/lists.v
with
13 additions
and
14 deletions
theories/lecture_notes/lists.v
+
13
−
14
View file @
4f54a325
...
...
@@ -385,31 +385,30 @@ Proof.
Qed
.
Lemma
filter_spec
(
hd
p
:
val
)
(
xs
:
list
val
)
(
P
:
val
->
bool
)
:
Lemma
filter_spec
(
hd
p
:
val
)
(
xs
:
list
val
)
(
R
:
val
->
bool
)
(
Q
:
val
→
iProp
Σ
)
:
{{{
is_list
hd
xs
∗
(
∀
x
:
val
,
{{{
True
}}}
{{{
Q
x
}}}
p
x
{{{
r
,
RET
r
;
⌜
r
=
#
(
P
x
)
⌝
}}})
{{{
r
,
RET
r
;
⌜
r
=
#
(
R
x
)
⌝
}}})
∗
[
∗
list
]
x
∈
xs
,
Q
x
}}}
filter
p
hd
{{{
v
,
RET
v
;
is_list
hd
xs
∗
is_list
v
(
List
.
filter
P
xs
)
∗
is_list
v
(
List
.
filter
R
xs
)
}}}
.
Proof
.
iIntros
(
ϕ
)
"
[
H_isList #H_p
]
H_ϕ"
.
wp_rec
.
wp_pures
.
iApply
(
foldr_spec_PI
(
fun
x
=>
True
)
%
I
(
fun
xs'
acc
=>
is_list
acc
(
List
.
filter
P
xs'
))
%
I
with
"[$H_isList] [H_ϕ]"
)
.
-
iSplit
L
.
+
iIntros
(
x
a'
?)
"!# %ϕ'"
.
iIntros
"[
_
H_isList] H_ϕ'"
.
repeat
(
wp_pure
_)
.
wp_bind
(
p
x
)
.
iApply
"H_p"
;
first
done
.
iNext
.
iIntros
(
r
)
"H"
.
iSimplifyEq
.
destruct
(
P
x
);
wp_if
.
iIntros
(
ϕ
)
"
(
H_isList
&
#H_p
& HQs)
H_ϕ"
.
wp_rec
.
wp_pures
.
iApply
(
foldr_spec_PI
Q
(
fun
xs'
acc
=>
is_list
acc
(
List
.
filter
R
xs'
))
%
I
with
"[$H_isList
HQs
] [H_ϕ]"
)
.
-
iSplit
R
.
+
iIntros
(
x
a'
?)
"!# %ϕ'"
.
iIntros
"[
HQ
H_isList] H_ϕ'"
.
repeat
(
wp_pure
_)
.
wp_bind
(
p
x
)
.
iApply
(
"H_p"
with
"[$HQ]"
)
.
iNext
.
iIntros
(
r
)
"H"
.
iSimplifyEq
.
destruct
(
R
x
);
wp_if
.
*
wp_rec
.
wp_pures
.
wp_alloc
l
.
wp_pures
.
iApply
"H_ϕ'"
.
iExists
l
,
a'
.
by
iFrame
.
*
by
iApply
"H_ϕ'"
.
+
iSplit
;
last
done
.
rewrite
big_sepL_forall
.
eauto
.
+
by
iSplit
.
-
iNext
.
iApply
"H_ϕ"
.
Qed
.
...
...
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