Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Monitor
Incidents
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
Rice Wine
Iris
Commits
4c1a0469
Commit
4c1a0469
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make exclusive stuff more consistent.
parent
4397cde3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
algebra/cmra.v
+19
-14
19 additions, 14 deletions
algebra/cmra.v
algebra/updates.v
+2
-2
2 additions, 2 deletions
algebra/updates.v
heap_lang/heap.v
+1
-1
1 addition, 1 deletion
heap_lang/heap.v
with
22 additions
and
17 deletions
algebra/cmra.v
+
19
−
14
View file @
4c1a0469
...
...
@@ -128,8 +128,8 @@ Class Persistent {A : cmraT} (x : A) := persistent : pcore x ≡ Some x.
Arguments
persistent
{_}
_
{_}
.
(** * Exclusive elements (i.e., elements that cannot have a frame). *)
Class
Exclusive
{
A
:
cmraT
}
(
x
:
A
)
:=
exclusive0_
r
:
∀
y
,
✓
{
0
}
(
x
⋅
y
)
→
False
.
Arguments
exclusive0_
r
{_}
_
{_}
_
_
.
Class
Exclusive
{
A
:
cmraT
}
(
x
:
A
)
:=
exclusive0_
l
y
:
✓
{
0
}
(
x
⋅
y
)
→
False
.
Arguments
exclusive0_
l
{_}
_
{_}
_
_
.
(** * CMRAs whose core is total *)
(** The function [core] may return a dummy when used on CMRAs without total
...
...
@@ -318,16 +318,14 @@ Lemma persistent_dup x `{!Persistent x} : x ≡ x ⋅ x.
Proof
.
by
apply
cmra_pcore_dup'
with
x
.
Qed
.
(** ** Exclusive elements *)
Lemma
exclusiveN_r
x
`{
!
Exclusive
x
}
:
∀
(
n
:
nat
)
(
y
:
A
),
✓
{
n
}
(
x
⋅
y
)
→
False
.
Proof
.
intros
???
%
cmra_validN_le
%
exclusive0_r
;
auto
with
arith
.
Qed
.
Lemma
exclusiveN_l
x
`{
!
Exclusive
x
}
:
∀
(
n
:
nat
)
(
y
:
A
),
✓
{
n
}
(
y
⋅
x
)
→
False
.
Proof
.
intros
??
.
rewrite
comm
.
by
apply
exclusiveN_r
.
Qed
.
Lemma
exclusive_r
x
`{
!
Exclusive
x
}
:
∀
(
y
:
A
),
✓
(
x
⋅
y
)
→
False
.
Proof
.
by
intros
?
?
%
cmra_valid_validN
%
(
exclusiveN_r
_
0
)
.
Qed
.
Lemma
exclusive_l
x
`{
!
Exclusive
x
}
:
∀
(
y
:
A
),
✓
(
y
⋅
x
)
→
False
.
Proof
.
by
intros
?
?
%
cmra_valid_validN
%
(
exclusiveN_l
_
0
)
.
Qed
.
Lemma
exclusiveN_l
n
x
`{
!
Exclusive
x
}
y
:
✓
{
n
}
(
x
⋅
y
)
→
False
.
Proof
.
intros
?
%
cmra_validN_le
%
exclusive0_l
;
auto
with
arith
.
Qed
.
Lemma
exclusiveN_r
n
x
`{
!
Exclusive
x
}
y
:
✓
{
n
}
(
y
⋅
x
)
→
False
.
Proof
.
rewrite
comm
.
by
apply
exclusiveN_l
.
Qed
.
Lemma
exclusive_l
x
`{
!
Exclusive
x
}
y
:
✓
(
x
⋅
y
)
→
False
.
Proof
.
by
move
/
cmra_valid_validN
/
(_
0
)
/
exclusive0_l
.
Qed
.
Lemma
exclusive_r
x
`{
!
Exclusive
x
}
y
:
✓
(
y
⋅
x
)
→
False
.
Proof
.
rewrite
comm
.
by
apply
exclusive_l
.
Qed
.
(** ** Order *)
Lemma
cmra_included_includedN
n
x
y
:
x
≼
y
→
x
≼
{
n
}
y
.
...
...
@@ -868,9 +866,9 @@ Section prod.
Proof
.
by
rewrite
/
Persistent
prod_pcore_Some'
.
Qed
.
Global
Instance
pair_exclusive_l
x
y
:
Exclusive
x
→
Exclusive
(
x
,
y
)
.
Proof
.
by
intros
?[][?
%
exclusive0_
r
]
.
Qed
.
Proof
.
by
intros
?[][?
%
exclusive0_
l
]
.
Qed
.
Global
Instance
pair_exclusive_r
x
y
:
Exclusive
y
→
Exclusive
(
x
,
y
)
.
Proof
.
by
intros
?[][??
%
exclusive0_
r
]
.
Qed
.
Proof
.
by
intros
?[][??
%
exclusive0_
l
]
.
Qed
.
End
prod
.
Arguments
prodR
:
clear
implicits
.
...
...
@@ -1045,6 +1043,13 @@ Section option.
Global
Instance
option_persistent
(
mx
:
option
A
)
:
(
∀
x
:
A
,
Persistent
x
)
→
Persistent
mx
.
Proof
.
intros
.
destruct
mx
;
apply
_
.
Qed
.
Lemma
exclusiveN_Some_l
n
x
`{
!
Exclusive
x
}
my
:
✓
{
n
}
(
Some
x
⋅
my
)
→
my
=
None
.
Proof
.
destruct
my
.
move
=>
/
(
exclusiveN_l
_
x
)
[]
.
done
.
Qed
.
Lemma
exclusiveN_Some_r
n
x
`{
!
Exclusive
x
}
my
:
✓
{
n
}
(
my
⋅
Some
x
)
→
my
=
None
.
Proof
.
rewrite
comm
.
by
apply
exclusiveN_Some_l
.
Qed
.
End
option
.
Arguments
optionR
:
clear
implicits
.
...
...
This diff is collapsed.
Click to expand it.
algebra/updates.v
+
2
−
2
View file @
4c1a0469
...
...
@@ -56,7 +56,7 @@ Proof. split; auto with typeclass_instances. Qed.
Global
Instance
exclusive_local_update
y
:
LocalUpdate
Exclusive
(
λ
_,
y
)
|
1000
.
Proof
.
split
.
apply
_
.
by
intros
?????
%
exclusiveN_
r
.
Qed
.
Proof
.
split
.
apply
_
.
by
intros
?????
%
exclusiveN_
l
.
Qed
.
(** ** Frame preserving updates *)
Lemma
cmra_update_updateP
x
y
:
x
~~>
y
↔
x
~~>:
(
y
=
)
.
...
...
@@ -83,7 +83,7 @@ Proof.
Qed
.
Lemma
cmra_update_exclusive
`{
!
Exclusive
x
}
y
:
✓
y
→
x
~~>
y
.
Proof
.
move
=>??[
z
|]=>[
/
exclusiveN_
r
[]|_]
.
by
apply
cmra_valid_validN
.
Qed
.
Proof
.
move
=>??[
z
|]=>[
/
exclusiveN_
l
[]|_]
.
by
apply
cmra_valid_validN
.
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
))
→
...
...
This diff is collapsed.
Click to expand it.
heap_lang/heap.v
+
1
−
1
View file @
4c1a0469
...
...
@@ -89,7 +89,7 @@ Section heap.
Proof
.
intros
Hv
l'
;
move
:
(
Hv
l'
)
.
destruct
(
decide
(
l'
=
l
))
as
[
->
|]
.
-
rewrite
!
lookup_op
!
lookup_singleton
.
by
case
:
(
h
!!
l
)=>
[
x
|]
//
/
Some_valid
/
exclusive_
r
.
by
case
:
(
h
!!
l
)=>
[
x
|]
//
/
Some_valid
/
exclusive_
l
.
-
by
rewrite
!
lookup_op
!
lookup_singleton_ne
.
Qed
.
Hint
Resolve
heap_store_valid
.
...
...
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