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
Tej Chajed
iris
Commits
59ed49fb
Commit
59ed49fb
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Rename auth.own into auth_own.
This is to avoid confusion with ghost_ownership.own.
parent
89f354f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algebra/auth.v
+24
-24
24 additions, 24 deletions
algebra/auth.v
with
24 additions
and
24 deletions
algebra/auth.v
+
24
−
24
View file @
59ed49fb
...
@@ -3,11 +3,11 @@ From iris.algebra Require Import upred.
...
@@ -3,11 +3,11 @@ From iris.algebra Require Import upred.
Local
Arguments
valid
_
_
!
_
/.
Local
Arguments
valid
_
_
!
_
/.
Local
Arguments
validN
_
_
_
!
_
/.
Local
Arguments
validN
_
_
_
!
_
/.
Record
auth
(
A
:
Type
)
:=
Auth
{
authoritative
:
option
(
excl
A
);
own
:
A
}
.
Record
auth
(
A
:
Type
)
:=
Auth
{
authoritative
:
option
(
excl
A
);
auth_
own
:
A
}
.
Add
Printing
Constructor
auth
.
Add
Printing
Constructor
auth
.
Arguments
Auth
{_}
_
_
.
Arguments
Auth
{_}
_
_
.
Arguments
authoritative
{_}
_
.
Arguments
authoritative
{_}
_
.
Arguments
own
{_}
_
.
Arguments
auth_
own
{_}
_
.
Notation
"◯ a"
:=
(
Auth
None
a
)
(
at
level
20
)
.
Notation
"◯ a"
:=
(
Auth
None
a
)
(
at
level
20
)
.
Notation
"● a"
:=
(
Auth
(
Excl'
a
)
∅
)
(
at
level
20
)
.
Notation
"● a"
:=
(
Auth
(
Excl'
a
)
∅
)
(
at
level
20
)
.
...
@@ -19,9 +19,9 @@ Implicit Types b : A.
...
@@ -19,9 +19,9 @@ Implicit Types b : A.
Implicit
Types
x
y
:
auth
A
.
Implicit
Types
x
y
:
auth
A
.
Instance
auth_equiv
:
Equiv
(
auth
A
)
:=
λ
x
y
,
Instance
auth_equiv
:
Equiv
(
auth
A
)
:=
λ
x
y
,
authoritative
x
≡
authoritative
y
∧
own
x
≡
own
y
.
authoritative
x
≡
authoritative
y
∧
auth_
own
x
≡
auth_
own
y
.
Instance
auth_dist
:
Dist
(
auth
A
)
:=
λ
n
x
y
,
Instance
auth_dist
:
Dist
(
auth
A
)
:=
λ
n
x
y
,
authoritative
x
≡
{
n
}
≡
authoritative
y
∧
own
x
≡
{
n
}
≡
own
y
.
authoritative
x
≡
{
n
}
≡
authoritative
y
∧
auth_
own
x
≡
{
n
}
≡
auth_
own
y
.
Global
Instance
Auth_ne
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
Auth
A
)
.
Global
Instance
Auth_ne
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
Auth
A
)
.
Proof
.
by
split
.
Qed
.
Proof
.
by
split
.
Qed
.
...
@@ -31,13 +31,13 @@ Global Instance authoritative_ne: Proper (dist n ==> dist n) (@authoritative A).
...
@@ -31,13 +31,13 @@ Global Instance authoritative_ne: Proper (dist n ==> dist n) (@authoritative A).
Proof
.
by
destruct
1
.
Qed
.
Proof
.
by
destruct
1
.
Qed
.
Global
Instance
authoritative_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
authoritative
A
)
.
Global
Instance
authoritative_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
authoritative
A
)
.
Proof
.
by
destruct
1
.
Qed
.
Proof
.
by
destruct
1
.
Qed
.
Global
Instance
own_ne
:
Proper
(
dist
n
==>
dist
n
)
(
@
own
A
)
.
Global
Instance
own_ne
:
Proper
(
dist
n
==>
dist
n
)
(
@
auth_
own
A
)
.
Proof
.
by
destruct
1
.
Qed
.
Proof
.
by
destruct
1
.
Qed
.
Global
Instance
own_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
own
A
)
.
Global
Instance
own_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
auth_
own
A
)
.
Proof
.
by
destruct
1
.
Qed
.
Proof
.
by
destruct
1
.
Qed
.
Instance
auth_compl
:
Compl
(
auth
A
)
:=
λ
c
,
Instance
auth_compl
:
Compl
(
auth
A
)
:=
λ
c
,
Auth
(
compl
(
chain_map
authoritative
c
))
(
compl
(
chain_map
own
c
))
.
Auth
(
compl
(
chain_map
authoritative
c
))
(
compl
(
chain_map
auth_
own
c
))
.
Definition
auth_cofe_mixin
:
CofeMixin
(
auth
A
)
.
Definition
auth_cofe_mixin
:
CofeMixin
(
auth
A
)
.
Proof
.
Proof
.
split
.
split
.
...
@@ -49,7 +49,7 @@ Proof.
...
@@ -49,7 +49,7 @@ Proof.
+
intros
???
[??]
[??];
split
;
etrans
;
eauto
.
+
intros
???
[??]
[??];
split
;
etrans
;
eauto
.
-
by
intros
?
[??]
[??]
[??];
split
;
apply
dist_S
.
-
by
intros
?
[??]
[??]
[??];
split
;
apply
dist_S
.
-
intros
n
c
;
split
.
apply
(
conv_compl
n
(
chain_map
authoritative
c
))
.
-
intros
n
c
;
split
.
apply
(
conv_compl
n
(
chain_map
authoritative
c
))
.
apply
(
conv_compl
n
(
chain_map
own
c
))
.
apply
(
conv_compl
n
(
chain_map
auth_
own
c
))
.
Qed
.
Qed
.
Canonical
Structure
authC
:=
CofeT
(
auth
A
)
auth_cofe_mixin
.
Canonical
Structure
authC
:=
CofeT
(
auth
A
)
auth_cofe_mixin
.
...
@@ -72,38 +72,38 @@ Implicit Types x y : auth A.
...
@@ -72,38 +72,38 @@ Implicit Types x y : auth A.
Instance
auth_valid
:
Valid
(
auth
A
)
:=
λ
x
,
Instance
auth_valid
:
Valid
(
auth
A
)
:=
λ
x
,
match
authoritative
x
with
match
authoritative
x
with
|
Excl'
a
=>
(
∀
n
,
own
x
≼
{
n
}
a
)
∧
✓
a
|
Excl'
a
=>
(
∀
n
,
auth_
own
x
≼
{
n
}
a
)
∧
✓
a
|
None
=>
✓
own
x
|
None
=>
✓
auth_
own
x
|
ExclBot'
=>
False
|
ExclBot'
=>
False
end
.
end
.
Global
Arguments
auth_valid
!
_
/.
Global
Arguments
auth_valid
!
_
/.
Instance
auth_validN
:
ValidN
(
auth
A
)
:=
λ
n
x
,
Instance
auth_validN
:
ValidN
(
auth
A
)
:=
λ
n
x
,
match
authoritative
x
with
match
authoritative
x
with
|
Excl'
a
=>
own
x
≼
{
n
}
a
∧
✓
{
n
}
a
|
Excl'
a
=>
auth_
own
x
≼
{
n
}
a
∧
✓
{
n
}
a
|
None
=>
✓
{
n
}
own
x
|
None
=>
✓
{
n
}
auth_
own
x
|
ExclBot'
=>
False
|
ExclBot'
=>
False
end
.
end
.
Global
Arguments
auth_validN
_
!
_
/.
Global
Arguments
auth_validN
_
!
_
/.
Instance
auth_pcore
:
PCore
(
auth
A
)
:=
λ
x
,
Instance
auth_pcore
:
PCore
(
auth
A
)
:=
λ
x
,
Some
(
Auth
(
core
(
authoritative
x
))
(
core
(
own
x
)))
.
Some
(
Auth
(
core
(
authoritative
x
))
(
core
(
auth_
own
x
)))
.
Instance
auth_op
:
Op
(
auth
A
)
:=
λ
x
y
,
Instance
auth_op
:
Op
(
auth
A
)
:=
λ
x
y
,
Auth
(
authoritative
x
⋅
authoritative
y
)
(
own
x
⋅
own
y
)
.
Auth
(
authoritative
x
⋅
authoritative
y
)
(
auth_
own
x
⋅
auth_
own
y
)
.
Lemma
auth_included
(
x
y
:
auth
A
)
:
Lemma
auth_included
(
x
y
:
auth
A
)
:
x
≼
y
↔
authoritative
x
≼
authoritative
y
∧
own
x
≼
own
y
.
x
≼
y
↔
authoritative
x
≼
authoritative
y
∧
auth_
own
x
≼
auth_
own
y
.
Proof
.
Proof
.
split
;
[
intros
[[
z1
z2
]
Hz
];
split
;
[
exists
z1
|
exists
z2
];
apply
Hz
|]
.
split
;
[
intros
[[
z1
z2
]
Hz
];
split
;
[
exists
z1
|
exists
z2
];
apply
Hz
|]
.
intros
[[
z1
Hz1
]
[
z2
Hz2
]];
exists
(
Auth
z1
z2
);
split
;
auto
.
intros
[[
z1
Hz1
]
[
z2
Hz2
]];
exists
(
Auth
z1
z2
);
split
;
auto
.
Qed
.
Qed
.
Lemma
authoritative_validN
n
(
x
:
auth
A
)
:
✓
{
n
}
x
→
✓
{
n
}
authoritative
x
.
Lemma
authoritative_validN
n
(
x
:
auth
A
)
:
✓
{
n
}
x
→
✓
{
n
}
authoritative
x
.
Proof
.
by
destruct
x
as
[[[]|]]
.
Qed
.
Proof
.
by
destruct
x
as
[[[]|]]
.
Qed
.
Lemma
own_validN
n
(
x
:
auth
A
)
:
✓
{
n
}
x
→
✓
{
n
}
own
x
.
Lemma
auth_
own_validN
n
(
x
:
auth
A
)
:
✓
{
n
}
x
→
✓
{
n
}
auth_
own
x
.
Proof
.
destruct
x
as
[[[]|]];
naive_solver
eauto
using
cmra_validN_includedN
.
Qed
.
Proof
.
destruct
x
as
[[[]|]];
naive_solver
eauto
using
cmra_validN_includedN
.
Qed
.
Lemma
auth_valid_discrete
`{
CMRADiscrete
A
}
x
:
Lemma
auth_valid_discrete
`{
CMRADiscrete
A
}
x
:
✓
x
↔
match
authoritative
x
with
✓
x
↔
match
authoritative
x
with
|
Excl'
a
=>
own
x
≼
a
∧
✓
a
|
Excl'
a
=>
auth_
own
x
≼
a
∧
✓
a
|
None
=>
✓
own
x
|
None
=>
✓
auth_
own
x
|
ExclBot'
=>
False
|
ExclBot'
=>
False
end
.
end
.
Proof
.
Proof
.
...
@@ -135,8 +135,8 @@ Proof.
...
@@ -135,8 +135,8 @@ Proof.
-
intros
n
x
y1
y2
?
[??];
simpl
in
*.
-
intros
n
x
y1
y2
?
[??];
simpl
in
*.
destruct
(
cmra_extend
n
(
authoritative
x
)
(
authoritative
y1
)
destruct
(
cmra_extend
n
(
authoritative
x
)
(
authoritative
y1
)
(
authoritative
y2
))
as
(
ea
&
?
&
?
&
?);
auto
using
authoritative_validN
.
(
authoritative
y2
))
as
(
ea
&
?
&
?
&
?);
auto
using
authoritative_validN
.
destruct
(
cmra_extend
n
(
own
x
)
(
own
y1
)
(
own
y2
))
destruct
(
cmra_extend
n
(
auth_
own
x
)
(
auth_
own
y1
)
(
auth_
own
y2
))
as
(
b
&
?
&
?
&
?);
auto
using
own_validN
.
as
(
b
&
?
&
?
&
?);
auto
using
auth_
own_validN
.
by
exists
(
Auth
(
ea
.
1
)
(
b
.
1
),
Auth
(
ea
.
2
)
(
b
.
2
))
.
by
exists
(
Auth
(
ea
.
1
)
(
b
.
1
),
Auth
(
ea
.
2
)
(
b
.
2
))
.
Qed
.
Qed
.
Canonical
Structure
authR
:=
CMRAT
(
auth
A
)
auth_cofe_mixin
auth_cmra_mixin
.
Canonical
Structure
authR
:=
CMRAT
(
auth
A
)
auth_cofe_mixin
auth_cmra_mixin
.
...
@@ -164,12 +164,12 @@ Canonical Structure authUR :=
...
@@ -164,12 +164,12 @@ Canonical Structure authUR :=
(** Internalized properties *)
(** Internalized properties *)
Lemma
auth_equivI
{
M
}
(
x
y
:
auth
A
)
:
Lemma
auth_equivI
{
M
}
(
x
y
:
auth
A
)
:
x
≡
y
⊣⊢
(
authoritative
x
≡
authoritative
y
∧
own
x
≡
own
y
:
uPred
M
)
.
x
≡
y
⊣⊢
(
authoritative
x
≡
authoritative
y
∧
auth_
own
x
≡
auth_
own
y
:
uPred
M
)
.
Proof
.
by
uPred
.
unseal
.
Qed
.
Proof
.
by
uPred
.
unseal
.
Qed
.
Lemma
auth_validI
{
M
}
(
x
:
auth
A
)
:
Lemma
auth_validI
{
M
}
(
x
:
auth
A
)
:
✓
x
⊣⊢
(
match
authoritative
x
with
✓
x
⊣⊢
(
match
authoritative
x
with
|
Excl'
a
=>
(
∃
b
,
a
≡
own
x
⋅
b
)
∧
✓
a
|
Excl'
a
=>
(
∃
b
,
a
≡
auth_
own
x
⋅
b
)
∧
✓
a
|
None
=>
✓
own
x
|
None
=>
✓
auth_
own
x
|
ExclBot'
=>
False
|
ExclBot'
=>
False
end
:
uPred
M
)
.
end
:
uPred
M
)
.
Proof
.
uPred
.
unseal
.
by
destruct
x
as
[[[]|]]
.
Qed
.
Proof
.
uPred
.
unseal
.
by
destruct
x
as
[[[]|]]
.
Qed
.
...
@@ -196,7 +196,7 @@ Arguments authUR : clear implicits.
...
@@ -196,7 +196,7 @@ Arguments authUR : clear implicits.
(* Functor *)
(* Functor *)
Definition
auth_map
{
A
B
}
(
f
:
A
→
B
)
(
x
:
auth
A
)
:
auth
B
:=
Definition
auth_map
{
A
B
}
(
f
:
A
→
B
)
(
x
:
auth
A
)
:
auth
B
:=
Auth
(
excl_map
f
<$>
authoritative
x
)
(
f
(
own
x
))
.
Auth
(
excl_map
f
<$>
authoritative
x
)
(
f
(
auth_
own
x
))
.
Lemma
auth_map_id
{
A
}
(
x
:
auth
A
)
:
auth_map
id
x
=
x
.
Lemma
auth_map_id
{
A
}
(
x
:
auth
A
)
:
auth_map
id
x
=
x
.
Proof
.
by
destruct
x
as
[[[]|]]
.
Qed
.
Proof
.
by
destruct
x
as
[[[]|]]
.
Qed
.
Lemma
auth_map_compose
{
A
B
C
}
(
f
:
A
→
B
)
(
g
:
B
→
C
)
(
x
:
auth
A
)
:
Lemma
auth_map_compose
{
A
B
C
}
(
f
:
A
→
B
)
(
g
:
B
→
C
)
(
x
:
auth
A
)
:
...
...
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