Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
stdpp
Commits
28af1927
Commit
28af1927
authored
May 30, 2022
by
Robbert Krebbers
Browse files
DK → SK.
parent
58458a53
Pipeline
#66694
passed with stage
in 4 minutes and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
theories/fin_maps.v
View file @
28af1927
...
...
@@ -169,13 +169,13 @@ Global Instance map_lookup_total `{!Lookup K A (M A), !Inhabited A} :
Typeclasses
Opaque
map_lookup_total
.
(** Given a finite map [m] with keys [K] and values [A], the preimage
[map_preimage m] gives a finite map with keys [A] and values
set
[
A
].
The type
of [map_preimage] is very generic to support different map and set
implementations. A possible instance is [MKA:=gmap K A], [MA
D
K:=gmap A (gset K)],
and [
D
K:=gset K]. *)
Definition
map_preimage
`
{
FinMapToList
K
A
MKA
,
Empty
MA
D
K
,
PartialAlter
A
D
K
MA
D
K
,
Empty
D
K
,
Singleton
K
D
K
,
Union
D
K
}
(
m
:
MKA
)
:
MA
D
K
:
=
[map_preimage m] gives a finite map with keys [A] and values
being sets of
[
K
].
The type
of [map_preimage] is very generic to support different map and set
implementations. A possible instance is [MKA:=gmap K A], [MA
S
K:=gmap A (gset K)],
and [
S
K:=gset K]. *)
Definition
map_preimage
`
{
FinMapToList
K
A
MKA
,
Empty
MA
S
K
,
PartialAlter
A
S
K
MA
S
K
,
Empty
S
K
,
Singleton
K
S
K
,
Union
S
K
}
(
m
:
MKA
)
:
MA
S
K
:
=
map_fold
(
λ
i
,
partial_alter
(
λ
mX
,
Some
$
{[
i
]}
∪
default
∅
mX
))
∅
m
.
Typeclasses
Opaque
map_preimage
.
...
...
@@ -3280,9 +3280,9 @@ Section preimage.
sufficient for [gset], but not for [boolset] or [propset]. The result of the
pre-image is a map of sets. To support general sets, we would need setoid
equality on sets, and thus setoid equality on maps. *)
Context
`
{
FinMap
K
MK
,
FinMap
A
MA
,
FinSet
K
D
K
,
!
LeibnizEquiv
D
K
}.
Context
`
{
FinMap
K
MK
,
FinMap
A
MA
,
FinSet
K
S
K
,
!
LeibnizEquiv
S
K
}.
Local
Notation
map_preimage
:
=
(
map_preimage
(
K
:
=
K
)
(
A
:
=
A
)
(
MKA
:
=
MK
A
)
(
MA
D
K
:
=
MA
D
K
)
(
D
K
:
=
D
K
)).
(
map_preimage
(
K
:
=
K
)
(
A
:
=
A
)
(
MKA
:
=
MK
A
)
(
MA
S
K
:
=
MA
S
K
)
(
S
K
:
=
S
K
)).
Implicit
Types
m
:
MK
A
.
Lemma
map_preimage_empty
:
map_preimage
∅
=
∅
.
...
...
Write
Preview
Supports
Markdown
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