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
9d497b89
Commit
9d497b89
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Let set_solver handle mkSet.
parent
6c6ef520
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/collections.v
+8
-0
8 additions, 0 deletions
theories/collections.v
theories/sets.v
+5
-3
5 additions, 3 deletions
theories/sets.v
with
13 additions
and
3 deletions
theories/collections.v
+
8
−
0
View file @
9d497b89
...
...
@@ -4,6 +4,7 @@
importantly, it implements some tactics to automatically solve goals involving
collections. *)
From
stdpp
Require
Export
base
tactics
orders
.
From
stdpp
Require
Import
sets
.
Instance
collection_subseteq
`{
ElemOf
A
C
}
:
SubsetEq
C
:=
λ
X
Y
,
∀
x
,
x
∈
X
→
x
∈
Y
.
...
...
@@ -153,6 +154,9 @@ Tactic Notation "decompose_elem_of" hyp(H) :=
let
rec
go
H
:=
lazymatch
type
of
H
with
|
_
∈
∅
=>
apply
elem_of_empty
in
H
;
destruct
H
|
_
∈
⊤
=>
clear
H
|
_
∈
{[
_
|
_
]}
=>
rewrite
elem_of_mkSet
in
H
|
¬
_
∈
{[
_
|
_
]}
=>
rewrite
not_elem_of_mkSet
in
H
|
?x
∈
{[
?y
]}
=>
apply
elem_of_singleton
in
H
;
try
first
[
subst
y
|
subst
x
]
|
?x
∉
{[
?y
]}
=>
...
...
@@ -217,7 +221,9 @@ Ltac set_unfold :=
|
context
[
_
=
∅
]
=>
setoid_rewrite
elem_of_equiv_empty_L
in
H
|
context
[
_
=
_
]
=>
setoid_rewrite
elem_of_equiv_alt_L
in
H
|
context
[
_
∈
∅
]
=>
setoid_rewrite
elem_of_empty
in
H
|
context
[
_
∈
⊤
]
=>
setoid_rewrite
elem_of_all
in
H
|
context
[
_
∈
{[
_
]}
]
=>
setoid_rewrite
elem_of_singleton
in
H
|
context
[
_
∈
{[_|
_
]}
]
=>
setoid_rewrite
elem_of_mkSet
in
H
;
simpl
in
H
|
context
[
_
∈
_
∪
_
]
=>
setoid_rewrite
elem_of_union
in
H
|
context
[
_
∈
_
∩
_
]
=>
setoid_rewrite
elem_of_intersection
in
H
|
context
[
_
∈
_
∖
_
]
=>
setoid_rewrite
elem_of_difference
in
H
...
...
@@ -237,7 +243,9 @@ Ltac set_unfold :=
|
|
-
context
[
_
=
∅
]
=>
setoid_rewrite
elem_of_equiv_empty_L
|
|
-
context
[
_
=
_
]
=>
setoid_rewrite
elem_of_equiv_alt_L
|
|
-
context
[
_
∈
∅
]
=>
setoid_rewrite
elem_of_empty
|
|
-
context
[
_
∈
⊤
]
=>
setoid_rewrite
elem_of_all
|
|
-
context
[
_
∈
{[
_
]}
]
=>
setoid_rewrite
elem_of_singleton
|
|
-
context
[
_
∈
{[
_
|
_
]}
]
=>
setoid_rewrite
elem_of_mkSet
;
simpl
|
|
-
context
[
_
∈
_
∪
_
]
=>
setoid_rewrite
elem_of_union
|
|
-
context
[
_
∈
_
∩
_
]
=>
setoid_rewrite
elem_of_intersection
|
|
-
context
[
_
∈
_
∖
_
]
=>
setoid_rewrite
elem_of_difference
...
...
This diff is collapsed.
Click to expand it.
theories/sets.v
+
5
−
3
View file @
9d497b89
...
...
@@ -23,9 +23,11 @@ Instance set_difference {A} : Difference (set A) := λ X1 X2,
Instance
set_collection
:
Collection
A
(
set
A
)
.
Proof
.
split
;
[
split
|
|];
by
repeat
intro
.
Qed
.
Lemma
elem_of_
mkSet
{
A
}
(
P
:
A
→
Prop
)
x
:
(
x
∈
{[
x
|
P
x
]})
=
P
x
.
Lemma
elem_of_
all
{
A
}
(
x
:
A
)
:
x
∈
⊤
↔
True
.
Proof
.
done
.
Qed
.
Lemma
not_elem_of_mkSet
{
A
}
(
P
:
A
→
Prop
)
x
:
(
x
∉
{[
x
|
P
x
]})
=
(
¬
P
x
)
.
Lemma
elem_of_mkSet
{
A
}
(
P
:
A
→
Prop
)
x
:
x
∈
{[
x
|
P
x
]}
↔
P
x
.
Proof
.
done
.
Qed
.
Lemma
not_elem_of_mkSet
{
A
}
(
P
:
A
→
Prop
)
x
:
x
∉
{[
x
|
P
x
]}
↔
¬
P
x
.
Proof
.
done
.
Qed
.
Instance
set_ret
:
MRet
set
:=
λ
A
(
x
:
A
),
{[
x
]}
.
...
...
@@ -38,4 +40,4 @@ Instance set_join : MJoin set := λ A (XX : set (set A)),
Instance
set_collection_monad
:
CollectionMonad
set
.
Proof
.
by
split
;
try
apply
_
.
Qed
.
Global
Opaque
set_union
set_intersection
set_difference
.
Global
Opaque
set_elem_of
set_union
set_intersection
set_difference
.
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