Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
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
stdpp
Commits
3cbd41e4
Commit
3cbd41e4
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Conversion list -> collection.
parent
e5cf4bab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/collections.v
+19
-6
19 additions, 6 deletions
theories/collections.v
with
19 additions
and
6 deletions
theories/collections.v
+
19
−
6
View file @
3cbd41e4
...
...
@@ -93,14 +93,27 @@ Section simple_collection.
End
dec
.
End
simple_collection
.
Definition
of_option
`{
Singleton
A
C
}
`{
Empty
C
}
(
x
:
option
A
)
:
C
:=
Definition
of_option
`{
Singleton
A
C
,
Empty
C
}
(
x
:
option
A
)
:
C
:=
match
x
with
None
=>
∅
|
Some
a
=>
{[
a
]}
end
.
Fixpoint
of_list
`{
Singleton
A
C
,
Empty
C
,
Union
C
}
(
l
:
list
A
)
:
C
:=
match
l
with
[]
=>
∅
|
x
::
l
=>
{[
x
]}
∪
of_list
l
end
.
Lemma
elem_of_of_option
`{
SimpleCollection
A
C
}
(
x
:
A
)
o
:
x
∈
of_option
o
↔
o
=
Some
x
.
Proof
.
destruct
o
;
simpl
;
rewrite
?elem_of_empty
,
?elem_of_singleton
;
naive_solver
.
Qed
.
Section
of_option_list
.
Context
`{
SimpleCollection
A
C
}
.
Lemma
elem_of_of_option
(
x
:
A
)
o
:
x
∈
of_option
o
↔
o
=
Some
x
.
Proof
.
destruct
o
;
simpl
;
rewrite
?elem_of_empty
,
?elem_of_singleton
;
naive_solver
.
Qed
.
Lemma
elem_of_of_list
(
x
:
A
)
l
:
x
∈
of_list
l
↔
x
∈
l
.
Proof
.
split
.
*
induction
l
;
simpl
;
[
by
rewrite
elem_of_empty
|]
.
rewrite
elem_of_union
,
elem_of_singleton
;
intros
[
->
|?];
constructor
(
auto
)
.
*
induction
1
;
simpl
;
rewrite
elem_of_union
,
elem_of_singleton
;
auto
.
Qed
.
End
of_option_list
.
Global
Instance
collection_guard
`{
CollectionMonad
M
}
:
MGuard
M
:=
λ
P
dec
A
x
,
match
dec
with
left
H
=>
x
H
|
_
=>
∅
end
.
...
...
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