Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodolphe Lepigre
Iris
Commits
dcc164e3
Commit
dcc164e3
authored
Feb 17, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also specialize big ops on CMRAs to gmap.
parent
5726049c
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
11 additions
and
13 deletions
+11
13
algebra/cmra_big_op.v
algebra/cmra_big_op.v
+11
13
No files found.
algebra/cmra_big_op.v
View file @
dcc164e3
From
algebra
Require
Export
cmra
.
From
algebra
Require
Export
cmra
.
From
prelude
Require
Import
fin_maps
.
From
prelude
Require
Import
gmap
.
Fixpoint
big_op
{
A
:
cmraT
}
`
{
Empty
A
}
(
xs
:
list
A
)
:
A
:
=
Fixpoint
big_op
{
A
:
cmraT
}
`
{
Empty
A
}
(
xs
:
list
A
)
:
A
:
=
match
xs
with
[]
=>
∅

x
::
xs
=>
x
⋅
big_op
xs
end
.
match
xs
with
[]
=>
∅

x
::
xs
=>
x
⋅
big_op
xs
end
.
Arguments
big_op
_
_
!
_
/.
Arguments
big_op
_
_
!
_
/.
Instance
:
Params
(@
big_op
)
2
.
Instance
:
Params
(@
big_op
)
2
.
Definition
big_opM
{
A
:
cmraT
}
`
{
FinMapToList
K
A
M
,
Empty
A
}
(
m
:
M
)
:
A
:
=
Definition
big_opM
`
{
Countable
K
}
{
A
:
cmraT
}
`
{
Empty
A
}
(
m
:
gmap
K
A
)
:
A
:
=
big_op
(
snd
<$>
map_to_list
m
).
big_op
(
snd
<$>
map_to_list
m
).
Instance
:
Params
(@
big_opM
)
5
.
Instance
:
Params
(@
big_opM
)
5
.
...
@@ 34,33 +34,31 @@ Proof.
...
@@ 34,33 +34,31 @@ Proof.
Qed
.
Qed
.
Lemma
big_op_contains
xs
ys
:
xs
`
contains
`
ys
→
big_op
xs
≼
big_op
ys
.
Lemma
big_op_contains
xs
ys
:
xs
`
contains
`
ys
→
big_op
xs
≼
big_op
ys
.
Proof
.
Proof
.
induction
1
as
[
x
xs
ys

x
y
xs

x
xs
ys

xs
ys
zs
]
;
rewrite
//=.
intros
[
xs'
>]%
contains_Permutation
.

by
apply
cmra_preserving_l
.
rewrite
big_op_app
;
apply
cmra_included_l
.

by
rewrite
!
assoc
(
comm
_
y
).

by
transitivity
(
big_op
ys
)
;
last
apply
cmra_included_r
.

by
transitivity
(
big_op
ys
).
Qed
.
Qed
.
Lemma
big_op_delete
xs
i
x
:
Lemma
big_op_delete
xs
i
x
:
xs
!!
i
=
Some
x
→
x
⋅
big_op
(
delete
i
xs
)
≡
big_op
xs
.
xs
!!
i
=
Some
x
→
x
⋅
big_op
(
delete
i
xs
)
≡
big_op
xs
.
Proof
.
by
intros
;
rewrite
{
2
}(
delete_Permutation
xs
i
x
).
Qed
.
Proof
.
by
intros
;
rewrite
{
2
}(
delete_Permutation
xs
i
x
).
Qed
.
Context
`
{
FinMap
K
M
}.
Context
`
{
Countable
K
}.
Lemma
big_opM_empty
:
big_opM
(
∅
:
M
A
)
≡
∅
.
Implicit
Types
m
:
gmap
K
A
.
Lemma
big_opM_empty
:
big_opM
(
∅
:
gmap
K
A
)
≡
∅
.
Proof
.
unfold
big_opM
.
by
rewrite
map_to_list_empty
.
Qed
.
Proof
.
unfold
big_opM
.
by
rewrite
map_to_list_empty
.
Qed
.
Lemma
big_opM_insert
(
m
:
M
A
)
i
x
:
Lemma
big_opM_insert
m
i
x
:
m
!!
i
=
None
→
big_opM
(<[
i
:
=
x
]>
m
)
≡
x
⋅
big_opM
m
.
m
!!
i
=
None
→
big_opM
(<[
i
:
=
x
]>
m
)
≡
x
⋅
big_opM
m
.
Proof
.
intros
?
;
by
rewrite
/
big_opM
map_to_list_insert
.
Qed
.
Proof
.
intros
?
;
by
rewrite
/
big_opM
map_to_list_insert
.
Qed
.
Lemma
big_opM_delete
(
m
:
M
A
)
i
x
:
Lemma
big_opM_delete
m
i
x
:
m
!!
i
=
Some
x
→
x
⋅
big_opM
(
delete
i
m
)
≡
big_opM
m
.
m
!!
i
=
Some
x
→
x
⋅
big_opM
(
delete
i
m
)
≡
big_opM
m
.
Proof
.
Proof
.
intros
.
by
rewrite
{
2
}(
insert_delete
m
i
x
)
//
big_opM_insert
?lookup_delete
.
intros
.
by
rewrite
{
2
}(
insert_delete
m
i
x
)
//
big_opM_insert
?lookup_delete
.
Qed
.
Qed
.
Lemma
big_opM_singleton
i
x
:
big_opM
({[
i
:
=
x
]}
:
M
A
)
≡
x
.
Lemma
big_opM_singleton
i
x
:
big_opM
({[
i
:
=
x
]}
:
gmap
K
A
)
≡
x
.
Proof
.
Proof
.
rewrite

insert_empty
big_opM_insert
/=
;
last
auto
using
lookup_empty
.
rewrite

insert_empty
big_opM_insert
/=
;
last
auto
using
lookup_empty
.
by
rewrite
big_opM_empty
right_id
.
by
rewrite
big_opM_empty
right_id
.
Qed
.
Qed
.
Global
Instance
big_opM_proper
:
Proper
((
≡
)
==>
(
≡
))
(
big_opM
:
M
A
→
_
).
Global
Instance
big_opM_proper
:
Proper
((
≡
)
==>
(
≡
))
(
big_opM
:
gmap
K
A
→
_
).
Proof
.
Proof
.
intros
m1
;
induction
m1
as
[
i
x
m1
?
IH
]
using
map_ind
.
intros
m1
;
induction
m1
as
[
i
x
m1
?
IH
]
using
map_ind
.
{
by
intros
m2
;
rewrite
(
symmetry_iff
(
≡
))
map_equiv_empty
;
intros
>.
}
{
by
intros
m2
;
rewrite
(
symmetry_iff
(
≡
))
map_equiv_empty
;
intros
>.
}
...
...
Write
Preview
Markdown
is supported
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