Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Paolo G. Giarrusso
iris
Commits
7d16a1d8
Commit
7d16a1d8
authored
3 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Better setoid-rewriting for updates.
parent
e29ce6f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris/algebra/lib/gmap_view.v
+13
-17
13 additions, 17 deletions
iris/algebra/lib/gmap_view.v
iris/algebra/updates.v
+19
-1
19 additions, 1 deletion
iris/algebra/updates.v
with
32 additions
and
18 deletions
iris/algebra/lib/gmap_view.v
+
13
−
17
View file @
7d16a1d8
...
...
@@ -359,11 +359,9 @@ Section lemmas.
Proof
.
induction
m'
as
[|
k
v
m'
?
IH
]
using
map_ind
.
{
rewrite
right_id_L
big_opM_empty
right_id
//.
}
rewrite
big_opM_insert
//.
etrans
.
-
rewrite
[
gmap_view_frag
_
_
_
⋅
_]
comm
assoc
.
eapply
cmra_update_op
;
[
eapply
IH
|
reflexivity
]
.
-
etrans
;
first
by
eapply
gmap_view_delete
.
rewrite
-
delete_difference
.
done
.
rewrite
big_opM_insert
//.
rewrite
[
gmap_view_frag
_
_
_
⋅
_]
comm
assoc
IH
gmap_view_delete
.
rewrite
-
delete_difference
.
done
.
Qed
.
Lemma
gmap_view_update
m
k
v
v'
:
...
...
@@ -388,18 +386,16 @@ Section lemmas.
rewrite
dom_insert_L
in
Hdom
.
assert
(
k
∈
dom
(
gset
K
)
m1
)
as
Hindom
by
set_solver
.
apply
elem_of_dom
in
Hindom
as
[
v'
Hlookup
]
.
rewrite
big_opM_insert
//.
etrans
;
last
etrans
.
-
rewrite
[
gmap_view_frag
_
_
_
⋅
_]
comm
assoc
.
eapply
cmra_update_op
;
[
eapply
(
IH
(
delete
k
m1
))|
reflexivity
]
.
rewrite
dom_delete_L
Hdom
.
apply
not_elem_of_dom
in
Hnotdom
.
set_solver
-
Hdom
.
-
rewrite
-
assoc
[_
⋅
gmap_view_frag
_
_
_]
comm
assoc
.
eapply
cmra_update_op
;
last
reflexivity
.
eapply
(
gmap_view_update
_
_
v
v'
)
.
-
rewrite
(
big_opM_delete
_
m1
k
v'
)
//
-
assoc
.
eapply
cmra_update_op
;
last
done
.
rewrite
insert_union_r
;
last
by
rewrite
lookup_delete
.
rewrite
union_delete_insert
//.
rewrite
big_opM_insert
//.
rewrite
[
gmap_view_frag
_
_
_
⋅
_]
comm
assoc
.
rewrite
(
IH
(
delete
k
m1
));
last
first
.
{
rewrite
dom_delete_L
Hdom
.
apply
not_elem_of_dom
in
Hnotdom
.
set_solver
-
Hdom
.
}
rewrite
-
assoc
[_
⋅
gmap_view_frag
_
_
_]
comm
assoc
.
rewrite
(
gmap_view_update
_
_
_
v'
)
.
rewrite
(
big_opM_delete
_
m1
k
v'
)
//
-
assoc
.
rewrite
insert_union_r
;
last
by
rewrite
lookup_delete
.
rewrite
union_delete_insert
//.
Qed
.
Lemma
gmap_view_persist
k
dq
v
:
...
...
This diff is collapsed.
Click to expand it.
iris/algebra/updates.v
+
19
−
1
View file @
7d16a1d8
...
...
@@ -52,6 +52,8 @@ Lemma cmra_update_exclusive `{!Exclusive x} y:
Proof
.
move
=>??[
z
|]=>[
/
exclusiveN_l
[]|_]
.
by
apply
cmra_valid_validN
.
Qed
.
(** Updates form a preorder. *)
Global
Instance
cmra_update_rewrite_relation
:
RewriteRelation
(
@
cmra_update
A
)
:=
{}
.
Global
Instance
cmra_update_preorder
:
PreOrder
(
@
cmra_update
A
)
.
Proof
.
split
.
...
...
@@ -59,7 +61,16 @@ Proof.
-
intros
x
y
z
.
rewrite
!
cmra_update_updateP
.
eauto
using
cmra_updateP_compose
with
subst
.
Qed
.
Global
Instance
cmra_update_rewrite_relation
:
RewriteRelation
(
@
cmra_update
A
)
:=
{}
.
Global
Instance
cmra_update_proper_update
:
Proper
(
flip
cmra_update
==>
cmra_update
==>
impl
)
(
@
cmra_update
A
)
.
Proof
.
intros
x1
x2
Hx
y1
y2
Hy
?
.
etrans
;
[
apply
Hx
|]
.
by
etrans
;
[|
apply
Hy
]
.
Qed
.
Global
Instance
cmra_update_flip_proper_update
:
Proper
(
cmra_update
==>
flip
cmra_update
==>
flip
impl
)
(
@
cmra_update
A
)
.
Proof
.
intros
x1
x2
Hx
y1
y2
Hy
?
.
etrans
;
[
apply
Hx
|]
.
by
etrans
;
[|
apply
Hy
]
.
Qed
.
Lemma
cmra_updateP_op
(
P1
P2
Q
:
A
→
Prop
)
x1
x2
:
x1
~~>:
P1
→
x2
~~>:
P2
→
(
∀
y1
y2
,
P1
y1
→
P2
y2
→
Q
(
y1
⋅
y2
))
→
...
...
@@ -81,6 +92,13 @@ Proof.
rewrite
!
cmra_update_updateP
;
eauto
using
cmra_updateP_op
with
congruence
.
Qed
.
Global
Instance
cmra_update_op_proper
:
Proper
(
cmra_update
==>
cmra_update
==>
cmra_update
)
(
op
(
A
:=
A
))
.
Proof
.
intros
x1
x2
Hx
y1
y2
Hy
.
by
apply
cmra_update_op
.
Qed
.
Global
Instance
cmra_update_op_flip_proper
:
Proper
(
flip
cmra_update
==>
flip
cmra_update
==>
flip
cmra_update
)
(
op
(
A
:=
A
))
.
Proof
.
intros
x1
x2
Hx
y1
y2
Hy
.
by
apply
cmra_update_op
.
Qed
.
Lemma
cmra_update_op_l
x
y
:
x
⋅
y
~~>
x
.
Proof
.
intros
n
mz
.
rewrite
comm
cmra_op_opM_assoc
.
apply
cmra_validN_op_r
.
Qed
.
Lemma
cmra_update_op_r
x
y
:
x
⋅
y
~~>
y
.
...
...
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