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
Merge requests
!171
Sketch docs for computation on [gmap], since they're a FAQ
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Sketch docs for computation on [gmap], since they're a FAQ
Blaisorblade/stdpp:doc-gmap-reduction
into
master
Overview
39
Commits
1
Pipelines
0
Changes
1
Merged
Paolo G. Giarrusso
requested to merge
Blaisorblade/stdpp:doc-gmap-reduction
into
master
4 years ago
Overview
32
Commits
1
Pipelines
0
Changes
1
Expand
TODO:
fix line breaks, when the rest is reviewed (it destructs diffs till then).
Edited
4 years ago
by
Paolo G. Giarrusso
0
0
Merge request reports
Compare
master
version 8
52b33b68
4 years ago
version 7
e97a1b43
4 years ago
version 6
312439ab
4 years ago
version 5
2c6d848c
4 years ago
version 4
3932aeec
4 years ago
version 3
94288cec
4 years ago
version 2
93359b14
4 years ago
version 1
b1262097
4 years ago
master (base)
and
latest version
latest version
8517b23b
1 commit,
4 years ago
version 8
52b33b68
8 commits,
4 years ago
version 7
e97a1b43
7 commits,
4 years ago
version 6
312439ab
6 commits,
4 years ago
version 5
2c6d848c
5 commits,
4 years ago
version 4
3932aeec
4 commits,
4 years ago
version 3
94288cec
3 commits,
4 years ago
version 2
93359b14
2 commits,
4 years ago
version 1
b1262097
1 commit,
4 years ago
1 file
+
17
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
theories/gmap.v
+
17
−
1
Options
(** This file implements finite maps and finite sets with keys of any countable
type. The implementation is based on [Pmap]s, radix-2 search trees. *)
type. The implementation is based on [Pmap]s, radix-2 search trees.
Computations on [gmap] or [gset], even concrete ones, are prevented from
reducing with [simpl] or [cbv] (by marking [gmap_empty] as [Opaque]), because
[simpl] reduces too eagerly.
To compute concrete results, you need to both:
- project in the end to some concrete data structure that, unlike
[gmap]/[gset], does not contain proofs, say via [map_to_list] or [!!]; and
- use [vm_compute] to run the computation, because it ignores opacity.
*)
From
stdpp
Require
Export
countable
infinite
fin_maps
fin_map_dom
.
From
stdpp
Require
Import
pmap
mapset
propset
.
(* Set Default Proof Using "Type". *)
@@ -31,6 +40,13 @@ Defined.
Instance
gmap_lookup
`{
Countable
K
}
{
A
}
:
Lookup
K
A
(
gmap
K
A
)
:=
λ
i
'
(
GMap
m
_),
m
!!
encode
i
.
Instance
gmap_empty
`{
Countable
K
}
{
A
}
:
Empty
(
gmap
K
A
)
:=
GMap
∅
I
.
(** Block reduction, even on concrete [gmap]s.
Marking [gmap_empty] as [simpl never] would not be enough, because of
https://github.com/coq/coq/issues/2972 and
https://github.com/coq/coq/issues/2986.
And marking [gmap] consumers as [simpl never] does not work either, see:
https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/171#note_53216
*)
Global
Opaque
gmap_empty
.
Lemma
gmap_partial_alter_wf
`{
Countable
K
}
{
A
}
(
f
:
option
A
→
option
A
)
m
i
:
gmap_wf
K
m
→
gmap_wf
K
(
partial_alter
f
(
encode
(
A
:=
K
)
i
)
m
)
.
Loading