Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
Janno
iris-coq
Commits
db02564e
Commit
db02564e
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Frame preserving updates for auth.
parent
cd20e951
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modures/auth.v
+38
-10
38 additions, 10 deletions
modures/auth.v
with
38 additions
and
10 deletions
modures/auth.v
+
38
−
10
View file @
db02564e
...
@@ -6,12 +6,14 @@ Add Printing Constructor auth.
...
@@ -6,12 +6,14 @@ Add Printing Constructor auth.
Arguments
Auth
{_}
_
_
.
Arguments
Auth
{_}
_
_
.
Arguments
authoritative
{_}
_
.
Arguments
authoritative
{_}
_
.
Arguments
own
{_}
_
.
Arguments
own
{_}
_
.
Notation
"◯
x
"
:=
(
Auth
ExclUnit
x
)
(
at
level
20
)
.
Notation
"◯
a
"
:=
(
Auth
ExclUnit
a
)
(
at
level
20
)
.
Notation
"●
x
"
:=
(
Auth
(
Excl
x
)
∅
)
(
at
level
20
)
.
Notation
"●
a
"
:=
(
Auth
(
Excl
a
)
∅
)
(
at
level
20
)
.
(* COFE *)
(* COFE *)
Section
cofe
.
Section
cofe
.
Context
{
A
:
cofeT
}
.
Context
{
A
:
cofeT
}
.
Implicit
Types
a
b
:
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
∧
own
x
≡
own
y
.
...
@@ -42,14 +44,14 @@ Proof.
...
@@ -42,14 +44,14 @@ Proof.
+
by
intros
?;
split
.
+
by
intros
?;
split
.
+
by
intros
??
[??];
split
;
symmetry
.
+
by
intros
??
[??];
split
;
symmetry
.
+
intros
???
[??]
[??];
split
;
etransitivity
;
eauto
.
+
intros
???
[??]
[??];
split
;
etransitivity
;
eauto
.
*
by
intros
n
[
x1
y1
]
[
x2
y2
]
[??];
split
;
apply
dist_S
.
*
by
intros
?
[
??]
[??
]
[??];
split
;
apply
dist_S
.
*
by
split
.
*
by
split
.
*
intros
c
n
;
split
.
apply
(
conv_compl
(
chain_map
authoritative
c
)
n
)
.
*
intros
c
n
;
split
.
apply
(
conv_compl
(
chain_map
authoritative
c
)
n
)
.
apply
(
conv_compl
(
chain_map
own
c
)
n
)
.
apply
(
conv_compl
(
chain_map
own
c
)
n
)
.
Qed
.
Qed
.
Canonical
Structure
authC
:=
CofeT
auth_cofe_mixin
.
Canonical
Structure
authC
:=
CofeT
auth_cofe_mixin
.
Instance
Auth_timeless
(
x
:
excl
A
)
(
y
:
A
)
:
Instance
Auth_timeless
(
ea
:
excl
A
)
(
b
:
A
)
:
Timeless
x
→
Timeless
y
→
Timeless
(
Auth
x
y
)
.
Timeless
ea
→
Timeless
b
→
Timeless
(
Auth
ea
b
)
.
Proof
.
by
intros
??
[??]
[??];
split
;
simpl
in
*
;
apply
(
timeless
_)
.
Qed
.
Proof
.
by
intros
??
[??]
[??];
split
;
simpl
in
*
;
apply
(
timeless
_)
.
Qed
.
Global
Instance
auth_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
(
auth
A
)
.
Global
Instance
auth_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
(
auth
A
)
.
Proof
.
by
intros
?
[??]
[??]
[??];
f_equal'
;
apply
leibniz_equiv
.
Qed
.
Proof
.
by
intros
?
[??]
[??]
[??];
f_equal'
;
apply
leibniz_equiv
.
Qed
.
...
@@ -60,6 +62,8 @@ Arguments authC : clear implicits.
...
@@ -60,6 +62,8 @@ Arguments authC : clear implicits.
(* CMRA *)
(* CMRA *)
Section
cmra
.
Section
cmra
.
Context
{
A
:
cmraT
}
.
Context
{
A
:
cmraT
}
.
Implicit
Types
a
b
:
A
.
Implicit
Types
x
y
:
auth
A
.
Global
Instance
auth_empty
`{
Empty
A
}
:
Empty
(
auth
A
)
:=
Auth
∅
∅.
Global
Instance
auth_empty
`{
Empty
A
}
:
Empty
(
auth
A
)
:=
Auth
∅
∅.
Instance
auth_validN
:
ValidN
(
auth
A
)
:=
λ
n
x
,
Instance
auth_validN
:
ValidN
(
auth
A
)
:=
λ
n
x
,
...
@@ -120,22 +124,46 @@ Definition auth_cmra_extend_mixin : CMRAExtendMixin (auth A).
...
@@ -120,22 +124,46 @@ Definition auth_cmra_extend_mixin : CMRAExtendMixin (auth A).
Proof
.
Proof
.
intros
n
x
y1
y2
?
[??];
simpl
in
*.
intros
n
x
y1
y2
?
[??];
simpl
in
*.
destruct
(
cmra_extend_op
n
(
authoritative
x
)
(
authoritative
y1
)
destruct
(
cmra_extend_op
n
(
authoritative
x
)
(
authoritative
y1
)
(
authoritative
y2
))
as
(
z1
&
?
&
?
&
?);
auto
using
authoritative_validN
.
(
authoritative
y2
))
as
(
ea
&
?
&
?
&
?);
auto
using
authoritative_validN
.
destruct
(
cmra_extend_op
n
(
own
x
)
(
own
y1
)
(
own
y2
))
destruct
(
cmra_extend_op
n
(
own
x
)
(
own
y1
)
(
own
y2
))
as
(
z2
&
?
&
?
&
?);
auto
using
own_validN
.
as
(
b
&
?
&
?
&
?);
auto
using
own_validN
.
by
exists
(
Auth
(
z1
.
1
)
(
z2
.
1
),
Auth
(
z1
.
2
)
(
z2
.
2
))
.
by
exists
(
Auth
(
ea
.
1
)
(
b
.
1
),
Auth
(
ea
.
2
)
(
b
.
2
))
.
Qed
.
Qed
.
Canonical
Structure
authRA
:
cmraT
:=
Canonical
Structure
authRA
:
cmraT
:=
CMRAT
auth_cofe_mixin
auth_cmra_mixin
auth_cmra_extend_mixin
.
CMRAT
auth_cofe_mixin
auth_cmra_mixin
auth_cmra_extend_mixin
.
Instance
auth_cmra_identity
`{
Empty
A
}
:
CMRAIdentity
A
→
CMRAIdentity
authRA
.
(** The notations ◯ and ● only work for CMRAs with an empty element. So, in
what follows, we assume we have an empty element. *)
Context
`{
Empty
A
,
!
CMRAIdentity
A
}
.
Global
Instance
auth_cmra_identity
:
CMRAIdentity
authRA
.
Proof
.
Proof
.
split
;
simpl
.
split
;
simpl
.
*
by
apply
(
@
cmra_empty_valid
A
_)
.
*
by
apply
(
@
cmra_empty_valid
A
_)
.
*
by
intros
x
;
constructor
;
rewrite
/=
left_id
.
*
by
intros
x
;
constructor
;
rewrite
/=
left_id
.
*
apply
Auth_timeless
;
apply
_
.
*
apply
Auth_timeless
;
apply
_
.
Qed
.
Qed
.
Lemma
auth_frag_op
(
a
b
:
A
)
:
◯
(
a
⋅
b
)
≡
◯
a
⋅
◯
b
.
Lemma
auth_frag_op
a
b
:
◯
(
a
⋅
b
)
≡
◯
a
⋅
◯
b
.
Proof
.
done
.
Qed
.
Proof
.
done
.
Qed
.
Lemma
auth_update
a
a'
b
b'
:
(
∀
n
af
,
✓
{
n
}
a
→
a
=
{
n
}
=
a'
⋅
af
→
b
=
{
n
}
=
b'
⋅
af
∧
✓
{
n
}
b
)
→
●
a
⋅
◯
a'
⇝
●
b
⋅
◯
b'
.
Proof
.
move
=>
Hab
[[]
bf1
]
n
//
=>
-
[[
bf2
Ha
]
?];
do
2
red
;
simpl
in
*.
destruct
(
Hab
(
S
n
)
(
bf1
⋅
bf2
))
as
[
Ha'
?];
auto
.
{
by
rewrite
Ha
left_id
associative
.
}
split
;
[
by
rewrite
Ha'
left_id
associative
;
apply
cmra_includedN_l
|
done
]
.
Qed
.
Lemma
auth_update_op_l
a
a'
b
:
✓
(
b
⋅
a
)
→
●
a
⋅
◯
a'
⇝
●
(
b
⋅
a
)
⋅
◯
(
b
⋅
a'
)
.
Proof
.
intros
;
apply
auth_update
.
by
intros
n
af
?
Ha
;
split
;
[
by
rewrite
Ha
associative
|]
.
Qed
.
Lemma
auth_update_op_r
a
a'
b
:
✓
(
a
⋅
b
)
→
●
a
⋅
◯
a'
⇝
●
(
a
⋅
b
)
⋅
◯
(
a'
⋅
b
)
.
Proof
.
rewrite
-!
(
commutative
_
b
);
apply
auth_update_op_l
.
Qed
.
End
cmra
.
End
cmra
.
Arguments
authRA
:
clear
implicits
.
Arguments
authRA
:
clear
implicits
.
...
...
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