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
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
Glen Mével
stdpp
Commits
8db5c86f
Commit
8db5c86f
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More type class opacity for multisets.
parent
fed72f20
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/gmultiset.v
+8
-1
8 additions, 1 deletion
theories/gmultiset.v
with
8 additions
and
1 deletion
theories/gmultiset.v
+
8
−
1
View file @
8db5c86f
...
...
@@ -41,6 +41,10 @@ Section definitions.
let
z
:=
x
-
y
in
guard
(
0
<
z
);
Some
(
pred
z
))
X
Y
.
End
definitions
.
Typeclasses
Opaque
gmultiset_elem_of
gmultiset_subseteq
.
Typeclasses
Opaque
gmultiset_elements
gmultiset_size
gmultiset_empty
.
Typeclasses
Opaque
gmultiset_singleton
gmultiset_union
gmultiset_difference
.
(** These instances are declared using [Hint Extern] to avoid too
eager type class search. *)
Hint
Extern
1
(
ElemOf
_
(
gmultiset
_))
=>
...
...
@@ -94,10 +98,10 @@ Proof.
destruct
(
X
!!
_),
(
Y
!!
_);
simplify_option_eq
;
omega
.
Qed
.
(* Collection *)
Lemma
elem_of_multiplicity
x
X
:
x
∈
X
↔
0
<
multiplicity
x
X
.
Proof
.
done
.
Qed
.
(* Algebraic laws *)
Global
Instance
gmultiset_simple_collection
:
SimpleCollection
A
(
gmultiset
A
)
.
Proof
.
split
.
...
...
@@ -108,7 +112,10 @@ Proof.
by
split
;
auto
with
lia
.
-
intros
X
Y
x
.
rewrite
!
elem_of_multiplicity
,
multiplicity_union
.
omega
.
Qed
.
Global
Instance
gmultiset_elem_of_dec
x
X
:
Decision
(
x
∈
X
)
.
Proof
.
unfold
elem_of
,
gmultiset_elem_of
.
apply
_
.
Defined
.
(* Algebraic laws *)
Global
Instance
gmultiset_comm
:
Comm
(
@
eq
(
gmultiset
A
))
(
∪
)
.
Proof
.
intros
X
Y
.
apply
gmultiset_eq
;
intros
x
.
rewrite
!
multiplicity_union
;
omega
.
...
...
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