Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
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
Terraform modules
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
Pierre Roux
Iris
Commits
d6c38891
Commit
d6c38891
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Function to convert a multiset into a gset.
parent
49e3e00f
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
prelude/gmultiset.v
+12
-0
12 additions, 0 deletions
prelude/gmultiset.v
with
12 additions
and
0 deletions
prelude/gmultiset.v
+
12
−
0
View file @
d6c38891
...
@@ -39,11 +39,15 @@ Section definitions.
...
@@ -39,11 +39,15 @@ Section definitions.
let
(
X
)
:=
X
in
let
(
Y
)
:=
Y
in
let
(
X
)
:=
X
in
let
(
Y
)
:=
Y
in
GMultiSet
$
difference_with
(
λ
x
y
,
GMultiSet
$
difference_with
(
λ
x
y
,
let
z
:=
x
-
y
in
guard
(
0
<
z
);
Some
(
pred
z
))
X
Y
.
let
z
:=
x
-
y
in
guard
(
0
<
z
);
Some
(
pred
z
))
X
Y
.
Instance
gmultiset_dom
:
Dom
(
gmultiset
A
)
(
gset
A
)
:=
λ
X
,
let
(
X
)
:=
X
in
dom
_
X
.
End
definitions
.
End
definitions
.
Typeclasses
Opaque
gmultiset_elem_of
gmultiset_subseteq
.
Typeclasses
Opaque
gmultiset_elem_of
gmultiset_subseteq
.
Typeclasses
Opaque
gmultiset_elements
gmultiset_size
gmultiset_empty
.
Typeclasses
Opaque
gmultiset_elements
gmultiset_size
gmultiset_empty
.
Typeclasses
Opaque
gmultiset_singleton
gmultiset_union
gmultiset_difference
.
Typeclasses
Opaque
gmultiset_singleton
gmultiset_union
gmultiset_difference
.
Typeclasses
Opaque
gmultiset_dom
.
(** These instances are declared using [Hint Extern] to avoid too
(** These instances are declared using [Hint Extern] to avoid too
eager type class search. *)
eager type class search. *)
...
@@ -63,6 +67,8 @@ Hint Extern 1 (Elements _ (gmultiset _)) =>
...
@@ -63,6 +67,8 @@ Hint Extern 1 (Elements _ (gmultiset _)) =>
eapply
@
gmultiset_elements
:
typeclass_instances
.
eapply
@
gmultiset_elements
:
typeclass_instances
.
Hint
Extern
1
(
Size
(
gmultiset
_))
=>
Hint
Extern
1
(
Size
(
gmultiset
_))
=>
eapply
@
gmultiset_size
:
typeclass_instances
.
eapply
@
gmultiset_size
:
typeclass_instances
.
Hint
Extern
1
(
Dom
(
gmultiset
_)
_)
=>
eapply
@
gmultiset_dom
:
typeclass_instances
.
Section
lemmas
.
Section
lemmas
.
Context
`{
Countable
A
}
.
Context
`{
Countable
A
}
.
...
@@ -196,6 +202,12 @@ Proof.
...
@@ -196,6 +202,12 @@ Proof.
exists
(
x
,
n
);
split
;
[|
by
apply
elem_of_map_to_list
]
.
exists
(
x
,
n
);
split
;
[|
by
apply
elem_of_map_to_list
]
.
apply
elem_of_replicate
;
auto
with
omega
.
apply
elem_of_replicate
;
auto
with
omega
.
Qed
.
Qed
.
Lemma
gmultiset_elem_of_dom
x
X
:
x
∈
dom
(
gset
A
)
X
↔
x
∈
X
.
Proof
.
unfold
dom
,
gmultiset_dom
,
elem_of
at
2
,
gmultiset_elem_of
,
multiplicity
.
destruct
X
as
[
X
];
simpl
;
rewrite
elem_of_dom
,
<-
not_eq_None_Some
.
destruct
(
X
!!
x
);
naive_solver
omega
.
Qed
.
(* Properties of the size operation *)
(* Properties of the size operation *)
Lemma
gmultiset_size_empty
:
size
(
∅
:
gmultiset
A
)
=
0
.
Lemma
gmultiset_size_empty
:
size
(
∅
:
gmultiset
A
)
=
0
.
...
...
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