Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
stdpp
Commits
34a3138e
Commit
34a3138e
authored
Feb 23, 2019
by
Robbert Krebbers
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move conversion functions list/option to set/disj_set to base.
parent
905a6df0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
theories/base.v
theories/base.v
+7
-0
theories/sets.v
theories/sets.v
+0
-7
No files found.
theories/base.v
View file @
34a3138e
...
...
@@ -868,6 +868,13 @@ Notation "X ⊆ Y ⊂ Z" := (X ⊆ Y ∧ Y ⊂ Z) (at level 70, Y at next level)
Notation
"X ⊂ Y ⊆ Z"
:
=
(
X
⊂
Y
∧
Y
⊆
Z
)
(
at
level
70
,
Y
at
next
level
)
:
stdpp_scope
.
Notation
"X ⊂ Y ⊂ Z"
:
=
(
X
⊂
Y
∧
Y
⊂
Z
)
(
at
level
70
,
Y
at
next
level
)
:
stdpp_scope
.
Definition
option_to_set
`
{
Singleton
A
C
,
Empty
C
}
(
mx
:
option
A
)
:
C
:
=
match
mx
with
None
=>
∅
|
Some
x
=>
{[
x
]}
end
.
Fixpoint
list_to_set
`
{
Singleton
A
C
,
Empty
C
,
Union
C
}
(
l
:
list
A
)
:
C
:
=
match
l
with
[]
=>
∅
|
x
::
l
=>
{[
x
]}
∪
list_to_set
l
end
.
Fixpoint
list_to_set_disj
`
{
Singleton
A
C
,
Empty
C
,
DisjUnion
C
}
(
l
:
list
A
)
:
C
:
=
match
l
with
[]
=>
∅
|
x
::
l
=>
{[
x
]}
⊎
list_to_set_disj
l
end
.
(** The class [Lexico A] is used for the lexicographic order on [A]. This order
is used to create finite maps, finite sets, etc, and is typically different from
the order [(⊆)]. *)
...
...
theories/sets.v
View file @
34a3138e
...
...
@@ -748,13 +748,6 @@ End set.
(** * Conversion of option and list *)
Definition
option_to_set
`
{
Singleton
A
C
,
Empty
C
}
(
mx
:
option
A
)
:
C
:
=
match
mx
with
None
=>
∅
|
Some
x
=>
{[
x
]}
end
.
Fixpoint
list_to_set
`
{
Singleton
A
C
,
Empty
C
,
Union
C
}
(
l
:
list
A
)
:
C
:
=
match
l
with
[]
=>
∅
|
x
::
l
=>
{[
x
]}
∪
list_to_set
l
end
.
Fixpoint
list_to_set_disj
`
{
Singleton
A
C
,
Empty
C
,
DisjUnion
C
}
(
l
:
list
A
)
:
C
:
=
match
l
with
[]
=>
∅
|
x
::
l
=>
{[
x
]}
⊎
list_to_set_disj
l
end
.
Section
option_and_list_to_set
.
Context
`
{
SemiSet
A
C
}.
Implicit
Types
l
:
list
A
.
...
...
Robbert Krebbers
@robbertkrebbers
mentioned in issue
#27 (closed)
·
Feb 23, 2019
mentioned in issue
#27 (closed)
mentioned in issue #27
Toggle commit list
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