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
Abhishek Anand
Iris
Commits
658e90f3
Commit
658e90f3
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the definition of Exclusive. Use it for gmap.
parent
b672285b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
algebra/cmra.v
+8
-6
8 additions, 6 deletions
algebra/cmra.v
algebra/csum.v
+2
-2
2 additions, 2 deletions
algebra/csum.v
algebra/frac.v
+1
-1
1 addition, 1 deletion
algebra/frac.v
algebra/gmap.v
+1
-1
1 addition, 1 deletion
algebra/gmap.v
with
12 additions
and
10 deletions
algebra/cmra.v
+
8
−
6
View file @
658e90f3
...
@@ -123,9 +123,8 @@ Class Persistent {A : cmraT} (x : A) := persistent : pcore x ≡ Some x.
...
@@ -123,9 +123,8 @@ Class Persistent {A : cmraT} (x : A) := persistent : pcore x ≡ Some x.
Arguments
persistent
{_}
_
{_}
.
Arguments
persistent
{_}
_
{_}
.
(** * Exclusive elements (i.e., elements that cannot have a frame). *)
(** * Exclusive elements (i.e., elements that cannot have a frame). *)
Class
Exclusive
{
A
:
cmraT
}
(
x
:
A
)
:=
Class
Exclusive
{
A
:
cmraT
}
(
x
:
A
)
:=
exclusive0_r
:
∀
y
,
✓
{
0
}
(
x
⋅
y
)
→
False
.
exclusiveN_r
:
∀
n
y
,
✓
{
n
}
(
x
⋅
y
)
→
False
.
Arguments
exclusive0_r
{_}
_
{_}
_
_
.
Arguments
exclusiveN_r
{_}
_
{_}
_
_
_
.
(** * CMRAs whose core is total *)
(** * CMRAs whose core is total *)
(** The function [core] may return a dummy when used on CMRAs without total
(** The function [core] may return a dummy when used on CMRAs without total
...
@@ -343,6 +342,9 @@ Lemma persistent_dup x `{!Persistent x} : x ≡ x ⋅ x.
...
@@ -343,6 +342,9 @@ Lemma persistent_dup x `{!Persistent x} : x ≡ x ⋅ x.
Proof
.
by
apply
cmra_pcore_dup'
with
x
.
Qed
.
Proof
.
by
apply
cmra_pcore_dup'
with
x
.
Qed
.
(** ** Exclusive elements *)
(** ** 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
}
:
Lemma
exclusiveN_l
x
`{
!
Exclusive
x
}
:
∀
(
n
:
nat
)
(
y
:
A
),
✓
{
n
}
(
y
⋅
x
)
→
False
.
∀
(
n
:
nat
)
(
y
:
A
),
✓
{
n
}
(
y
⋅
x
)
→
False
.
Proof
.
intros
??
.
rewrite
comm
.
by
apply
exclusiveN_r
.
Qed
.
Proof
.
intros
??
.
rewrite
comm
.
by
apply
exclusiveN_r
.
Qed
.
...
@@ -534,7 +536,7 @@ Proof. split; auto with typeclass_instances. Qed.
...
@@ -534,7 +536,7 @@ Proof. split; auto with typeclass_instances. Qed.
Global
Instance
exclusive_local_update
y
:
Global
Instance
exclusive_local_update
y
:
LocalUpdate
Exclusive
(
λ
_,
y
)
|
1000
.
LocalUpdate
Exclusive
(
λ
_,
y
)
|
1000
.
Proof
.
split
.
apply
_
.
by
intros
???
H
?
%
H
.
Qed
.
Proof
.
split
.
apply
_
.
by
intros
???
??
%
exclusiveN_r
.
Qed
.
(** ** Updates *)
(** ** Updates *)
Lemma
cmra_update_updateP
x
y
:
x
~~>
y
↔
x
~~>:
(
y
=
)
.
Lemma
cmra_update_updateP
x
y
:
x
~~>
y
↔
x
~~>:
(
y
=
)
.
...
@@ -964,10 +966,10 @@ Section prod.
...
@@ -964,10 +966,10 @@ Section prod.
Global
Instance
pair_exclusive_l
x
y
:
Global
Instance
pair_exclusive_l
x
y
:
Exclusive
x
→
Exclusive
(
x
,
y
)
.
Exclusive
x
→
Exclusive
(
x
,
y
)
.
Proof
.
by
intros
?
?[][?
%
exclusive
N
_r
]
.
Qed
.
Proof
.
by
intros
?[][?
%
exclusive
0
_r
]
.
Qed
.
Global
Instance
pair_exclusive_r
x
y
:
Global
Instance
pair_exclusive_r
x
y
:
Exclusive
y
→
Exclusive
(
x
,
y
)
.
Exclusive
y
→
Exclusive
(
x
,
y
)
.
Proof
.
by
intros
?
?[][??
%
exclusive
N
_r
]
.
Qed
.
Proof
.
by
intros
?[][??
%
exclusive
0
_r
]
.
Qed
.
Lemma
prod_updateP
P1
P2
(
Q
:
A
*
B
→
Prop
)
x
:
Lemma
prod_updateP
P1
P2
(
Q
:
A
*
B
→
Prop
)
x
:
x
.
1
~~>:
P1
→
x
.
2
~~>:
P2
→
(
∀
a
b
,
P1
a
→
P2
b
→
Q
(
a
,
b
))
→
x
~~>:
Q
.
x
.
1
~~>:
P1
→
x
.
2
~~>:
P2
→
(
∀
a
b
,
P1
a
→
P2
b
→
Q
(
a
,
b
))
→
x
~~>:
Q
.
...
...
This diff is collapsed.
Click to expand it.
algebra/csum.v
+
2
−
2
View file @
658e90f3
...
@@ -235,9 +235,9 @@ Global Instance Cinr_persistent b : Persistent b → Persistent (Cinr b).
...
@@ -235,9 +235,9 @@ Global Instance Cinr_persistent b : Persistent b → Persistent (Cinr b).
Proof
.
rewrite
/
Persistent
/=.
inversion_clear
1
;
by
repeat
constructor
.
Qed
.
Proof
.
rewrite
/
Persistent
/=.
inversion_clear
1
;
by
repeat
constructor
.
Qed
.
Global
Instance
Cinl_exclusive
a
:
Exclusive
a
→
Exclusive
(
Cinl
a
)
.
Global
Instance
Cinl_exclusive
a
:
Exclusive
a
→
Exclusive
(
Cinl
a
)
.
Proof
.
by
move
=>
H
n
[]?
=>[
/
H
||]
.
Qed
.
Proof
.
by
move
=>
H
[]?
=>[
/
H
||]
.
Qed
.
Global
Instance
Cinr_exclusive
b
:
Exclusive
b
→
Exclusive
(
Cinr
b
)
.
Global
Instance
Cinr_exclusive
b
:
Exclusive
b
→
Exclusive
(
Cinr
b
)
.
Proof
.
by
move
=>
H
n
[]?
=>[|
/
H
|]
.
Qed
.
Proof
.
by
move
=>
H
[]?
=>[|
/
H
|]
.
Qed
.
(** Internalized properties *)
(** Internalized properties *)
Lemma
csum_equivI
{
M
}
(
x
y
:
csum
A
B
)
:
Lemma
csum_equivI
{
M
}
(
x
y
:
csum
A
B
)
:
...
...
This diff is collapsed.
Click to expand it.
algebra/frac.v
+
1
−
1
View file @
658e90f3
...
@@ -154,7 +154,7 @@ Proof. by uPred.unseal. Qed.
...
@@ -154,7 +154,7 @@ Proof. by uPred.unseal. Qed.
(** Exclusive *)
(** Exclusive *)
Global
Instance
frac_full_exclusive
a
:
Exclusive
(
Frac
1
a
)
.
Global
Instance
frac_full_exclusive
a
:
Exclusive
(
Frac
1
a
)
.
Proof
.
Proof
.
move
=>
?
[[??]?][
/
Qcle_not_lt
[]];
simpl
in
*.
move
=>
[[??]?][
/
Qcle_not_lt
[]];
simpl
in
*.
by
rewrite
-
{
1
}(
Qcplus_0_r
1
)
-
Qcplus_lt_mono_l
.
by
rewrite
-
{
1
}(
Qcplus_0_r
1
)
-
Qcplus_lt_mono_l
.
Qed
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
algebra/gmap.v
+
1
−
1
View file @
658e90f3
...
@@ -336,7 +336,7 @@ End freshness.
...
@@ -336,7 +336,7 @@ End freshness.
(* Allocation is a local update: Just use composition with a singleton map. *)
(* Allocation is a local update: Just use composition with a singleton map. *)
Global
Instance
gmap_delete_update
:
Global
Instance
gmap_delete_update
:
LocalUpdate
(
λ
m
,
∃
x
,
m
!!
i
=
Some
x
∧
∀
y
,
¬
✓
{
0
}
(
x
⋅
y
)
)
(
delete
i
)
.
LocalUpdate
(
λ
m
,
∃
x
,
m
!!
i
=
Some
x
∧
Exclusive
x
)
(
delete
i
)
.
Proof
.
Proof
.
split
;
first
apply
_
.
split
;
first
apply
_
.
intros
n
m1
m2
(
x
&
Hix
&
Hv
)
Hm
j
;
destruct
(
decide
(
i
=
j
))
as
[
<-|
]
.
intros
n
m1
m2
(
x
&
Hix
&
Hv
)
Hm
j
;
destruct
(
decide
(
i
=
j
))
as
[
<-|
]
.
...
...
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