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
789bb0e1
Commit
789bb0e1
authored
2 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make `Pmap_empty` opaque, similar to `gmap_empty`.
parent
570272d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!461
More canonical maps
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stdpp/pmap.v
+15
-6
15 additions, 6 deletions
stdpp/pmap.v
with
15 additions
and
6 deletions
stdpp/pmap.v
+
15
−
6
View file @
789bb0e1
...
...
@@ -92,6 +92,14 @@ Local Arguments lookup _ _ _ _ _ !_ / : simpl nomatch, assert.
Global
Instance
Pmap_empty
{
A
}
:
Empty
(
Pmap
A
)
:=
PEmpty
.
(** Block reduction, even on concrete [Pmap]s.
Marking [Pmap_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 [Pmap] consumers as [simpl never] does not work either, see:
https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/171#note_53216 *)
Global
Opaque
Pmap_empty
.
Local
Fixpoint
Pmap_ne_singleton
{
A
}
(
i
:
positive
)
(
x
:
A
)
:
Pmap_ne
A
:=
match
i
with
|
1
=>
PNode010
x
...
...
@@ -178,7 +186,7 @@ Global Instance Pmap_fold {A} : MapFold positive A (Pmap A) := λ {B} f,
Local
Definition
PNode_valid
{
A
}
(
ml
:
Pmap
A
)
(
mx
:
option
A
)
(
mr
:
Pmap
A
)
:=
match
ml
,
mx
,
mr
with
PEmpty
,
None
,
PEmpty
=>
False
|
_,
_,
_
=>
True
end
.
Local
Lemma
Pmap_ind
{
A
}
(
P
:
Pmap
A
→
Prop
)
:
P
∅
→
P
PEmpty
→
(
∀
ml
mx
mr
,
PNode_valid
ml
mx
mr
→
P
ml
→
P
mr
→
P
(
PNode
ml
mx
mr
))
→
∀
mt
,
P
mt
.
Proof
.
...
...
@@ -325,7 +333,7 @@ Section Pmap_fold.
Proof
.
by
destruct
ml
,
mx
,
mr
.
Qed
.
Local
Lemma
Pmap_fold_ind
(
P
:
B
→
Pmap
A
→
Prop
)
(
b
:
B
)
j
:
P
b
∅
→
P
b
PEmpty
→
(
∀
i
x
mt
r
,
mt
!!
i
=
None
→
P
r
mt
→
P
(
f
(
Pos
.
reverse_go
i
j
)
x
r
)
(
<
[
i
:=
x
]
>
mt
))
→
∀
mt
,
P
(
Pmap_fold
f
j
b
mt
)
mt
.
...
...
@@ -335,13 +343,14 @@ Section Pmap_fold.
intros
P
b
j
Hemp
Hinsert
;
[
done
|]
.
rewrite
Pmap_fold_PNode
by
done
.
apply
(
IHr
(
λ
y
mt
,
P
y
(
PNode
ml
mx
mt
)))
.
{
apply
(
IHl
(
λ
y
mt
,
P
y
(
PNode
mt
mx
∅
)))
.
{
apply
(
IHl
(
λ
y
mt
,
P
y
(
PNode
mt
mx
PEmpty
)))
.
{
destruct
mx
as
[
x
|];
[|
done
]
.
replace
(
PNode
∅
(
Some
x
)
∅
)
with
(
<
[
1
:=
x
]
>
∅
:
Pmap
A
)
by
done
.
replace
(
PNode
PEmpty
(
Some
x
)
PEmpty
)
with
(
<
[
1
:=
x
]
>
PEmpty
:
Pmap
A
)
by
done
.
by
apply
Hinsert
.
}
intros
i
x
mt
r
??
.
replace
(
PNode
(
<
[
i
:=
x
]
>
mt
)
mx
∅
)
with
(
<
[
i
~
0
:=
x
]
>
(
PNode
mt
mx
∅
))
by
(
by
destruct
mt
,
mx
)
.
replace
(
PNode
(
<
[
i
:=
x
]
>
mt
)
mx
PEmpty
)
with
(
<
[
i
~
0
:=
x
]
>
(
PNode
mt
mx
PEmpty
))
by
(
by
destruct
mt
,
mx
)
.
apply
Hinsert
;
by
rewrite
?Pmap_lookup_PNode
.
}
intros
i
x
mt
r
??
.
replace
(
PNode
ml
mx
(
<
[
i
:=
x
]
>
mt
))
...
...
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