Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iris-coq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua Yanovski
iris-coq
Commits
c2c84732
Commit
c2c84732
authored
Mar 08, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename CMRA unit -> core
parent
361c9fbf
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
147 additions
and
147 deletions
+147
-147
algebra/agree.v
algebra/agree.v
+1
-1
algebra/auth.v
algebra/auth.v
+5
-5
algebra/cmra.v
algebra/cmra.v
+47
-47
algebra/dec_agree.v
algebra/dec_agree.v
+2
-2
algebra/dra.v
algebra/dra.v
+16
-16
algebra/excl.v
algebra/excl.v
+1
-1
algebra/fin_maps.v
algebra/fin_maps.v
+12
-12
algebra/frac.v
algebra/frac.v
+2
-2
algebra/iprod.v
algebra/iprod.v
+10
-10
algebra/option.v
algebra/option.v
+6
-6
algebra/sts.v
algebra/sts.v
+3
-3
algebra/upred.v
algebra/upred.v
+20
-20
program_logic/adequacy.v
program_logic/adequacy.v
+1
-1
program_logic/ghost_ownership.v
program_logic/ghost_ownership.v
+6
-6
program_logic/global_functor.v
program_logic/global_functor.v
+2
-2
program_logic/ownership.v
program_logic/ownership.v
+7
-7
program_logic/resources.v
program_logic/resources.v
+6
-6
No files found.
algebra/agree.v
View file @
c2c84732
...
@@ -60,7 +60,7 @@ Program Instance agree_op : Op (agree A) := λ x y,
...
@@ -60,7 +60,7 @@ Program Instance agree_op : Op (agree A) := λ x y,
{|
agree_car
:=
x
;
{|
agree_car
:=
x
;
agree_is_valid
n
:=
agree_is_valid
x
n
∧
agree_is_valid
y
n
∧
x
≡
{
n
}
≡
y
|}
.
agree_is_valid
n
:=
agree_is_valid
x
n
∧
agree_is_valid
y
n
∧
x
≡
{
n
}
≡
y
|}
.
Next
Obligation
.
naive_solver
eauto
using
agree_valid_S
,
dist_S
.
Qed
.
Next
Obligation
.
naive_solver
eauto
using
agree_valid_S
,
dist_S
.
Qed
.
Instance
agree_
unit
:
Unit
(
agree
A
)
:=
id
.
Instance
agree_
core
:
Core
(
agree
A
)
:=
id
.
Instance
agree_div
:
Div
(
agree
A
)
:=
λ
x
y
,
x
.
Instance
agree_div
:
Div
(
agree
A
)
:=
λ
x
y
,
x
.
Instance:
Comm
(
≡
)
(
@
op
(
agree
A
)
_
).
Instance:
Comm
(
≡
)
(
@
op
(
agree
A
)
_
).
...
...
algebra/auth.v
View file @
c2c84732
...
@@ -85,8 +85,8 @@ Instance auth_validN : ValidN (auth A) := λ n x,
...
@@ -85,8 +85,8 @@ Instance auth_validN : ValidN (auth A) := λ n x,
|
ExclBot
=>
False
|
ExclBot
=>
False
end
.
end
.
Global
Arguments
auth_validN
_
!
_
/
.
Global
Arguments
auth_validN
_
!
_
/
.
Instance
auth_
unit
:
Unit
(
auth
A
)
:=
λ
x
,
Instance
auth_
core
:
Core
(
auth
A
)
:=
λ
x
,
Auth
(
unit
(
authoritative
x
))
(
unit
(
own
x
)).
Auth
(
core
(
authoritative
x
))
(
core
(
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
)
(
own
x
⋅
own
y
).
Instance
auth_div
:
Div
(
auth
A
)
:=
λ
x
y
,
Instance
auth_div
:
Div
(
auth
A
)
:=
λ
x
y
,
...
@@ -117,10 +117,10 @@ Proof.
...
@@ -117,10 +117,10 @@ Proof.
-
intros
n
[[]
?
]
?
;
naive_solver
eauto
using
cmra_includedN_S
,
cmra_validN_S
.
-
intros
n
[[]
?
]
?
;
naive_solver
eauto
using
cmra_includedN_S
,
cmra_validN_S
.
-
by
split
;
simpl
;
rewrite
assoc
.
-
by
split
;
simpl
;
rewrite
assoc
.
-
by
split
;
simpl
;
rewrite
comm
.
-
by
split
;
simpl
;
rewrite
comm
.
-
by
split
;
simpl
;
rewrite
?
cmra_
unit
_l
.
-
by
split
;
simpl
;
rewrite
?
cmra_
core
_l
.
-
by
split
;
simpl
;
rewrite
?
cmra_
unit
_idemp
.
-
by
split
;
simpl
;
rewrite
?
cmra_
core
_idemp
.
-
intros
??
;
rewrite
!
auth_included
;
intros
[
??
].
-
intros
??
;
rewrite
!
auth_included
;
intros
[
??
].
by
split
;
simpl
;
apply
cmra_
unit
_preserving
.
by
split
;
simpl
;
apply
cmra_
core
_preserving
.
-
assert
(
∀
n
(
a
b1
b2
:
A
),
b1
⋅
b2
≼
{
n
}
a
→
b1
≼
{
n
}
a
).
-
assert
(
∀
n
(
a
b1
b2
:
A
),
b1
⋅
b2
≼
{
n
}
a
→
b1
≼
{
n
}
a
).
{
intros
n
a
b1
b2
<-
;
apply
cmra_includedN_l
.
}
{
intros
n
a
b1
b2
<-
;
apply
cmra_includedN_l
.
}
intros
n
[[
a1
|
|
]
b1
]
[[
a2
|
|
]
b2
];
intros
n
[[
a1
|
|
]
b1
]
[[
a2
|
|
]
b2
];
...
...
algebra/cmra.v
View file @
c2c84732
From
algebra
Require
Export
cofe
.
From
algebra
Require
Export
cofe
.
Class
Unit
(
A
:
Type
)
:=
unit
:
A
→
A
.
Class
Core
(
A
:
Type
)
:=
core
:
A
→
A
.
Instance:
Params
(
@
unit
)
2.
Instance:
Params
(
@
core
)
2.
Class
Op
(
A
:
Type
)
:=
op
:
A
→
A
→
A
.
Class
Op
(
A
:
Type
)
:=
op
:
A
→
A
→
A
.
Instance:
Params
(
@
op
)
2.
Instance:
Params
(
@
op
)
2.
...
@@ -34,10 +34,10 @@ Instance: Params (@includedN) 4.
...
@@ -34,10 +34,10 @@ Instance: Params (@includedN) 4.
Hint
Extern
0
(
_
≼
{
_
}
_
)
=>
reflexivity
.
Hint
Extern
0
(
_
≼
{
_
}
_
)
=>
reflexivity
.
Record
CMRAMixin
A
Record
CMRAMixin
A
`
{
Dist
A
,
Equiv
A
,
Unit
A
,
Op
A
,
Valid
A
,
ValidN
A
,
Div
A
}
:=
{
`
{
Dist
A
,
Equiv
A
,
Core
A
,
Op
A
,
Valid
A
,
ValidN
A
,
Div
A
}
:=
{
(
*
setoids
*
)
(
*
setoids
*
)
mixin_cmra_op_ne
n
(
x
:
A
)
:
Proper
(
dist
n
==>
dist
n
)
(
op
x
);
mixin_cmra_op_ne
n
(
x
:
A
)
:
Proper
(
dist
n
==>
dist
n
)
(
op
x
);
mixin_cmra_
unit_ne
n
:
Proper
(
dist
n
==>
dist
n
)
unit
;
mixin_cmra_
core_ne
n
:
Proper
(
dist
n
==>
dist
n
)
core
;
mixin_cmra_validN_ne
n
:
Proper
(
dist
n
==>
impl
)
(
validN
n
);
mixin_cmra_validN_ne
n
:
Proper
(
dist
n
==>
impl
)
(
validN
n
);
mixin_cmra_div_ne
n
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
div
;
mixin_cmra_div_ne
n
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
div
;
(
*
valid
*
)
(
*
valid
*
)
...
@@ -46,9 +46,9 @@ Record CMRAMixin A
...
@@ -46,9 +46,9 @@ Record CMRAMixin A
(
*
monoid
*
)
(
*
monoid
*
)
mixin_cmra_assoc
:
Assoc
(
≡
)
(
⋅
);
mixin_cmra_assoc
:
Assoc
(
≡
)
(
⋅
);
mixin_cmra_comm
:
Comm
(
≡
)
(
⋅
);
mixin_cmra_comm
:
Comm
(
≡
)
(
⋅
);
mixin_cmra_
unit_l
x
:
unit
x
⋅
x
≡
x
;
mixin_cmra_
core_l
x
:
core
x
⋅
x
≡
x
;
mixin_cmra_
unit_idemp
x
:
unit
(
unit
x
)
≡
unit
x
;
mixin_cmra_
core_idemp
x
:
core
(
core
x
)
≡
core
x
;
mixin_cmra_
unit_preserving
x
y
:
x
≼
y
→
unit
x
≼
unit
y
;
mixin_cmra_
core_preserving
x
y
:
x
≼
y
→
core
x
≼
core
y
;
mixin_cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
;
mixin_cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
;
mixin_cmra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
;
mixin_cmra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
;
mixin_cmra_extend
n
x
y1
y2
:
mixin_cmra_extend
n
x
y1
y2
:
...
@@ -62,7 +62,7 @@ Structure cmraT := CMRAT {
...
@@ -62,7 +62,7 @@ Structure cmraT := CMRAT {
cmra_equiv
:
Equiv
cmra_car
;
cmra_equiv
:
Equiv
cmra_car
;
cmra_dist
:
Dist
cmra_car
;
cmra_dist
:
Dist
cmra_car
;
cmra_compl
:
Compl
cmra_car
;
cmra_compl
:
Compl
cmra_car
;
cmra_
unit
:
Unit
cmra_car
;
cmra_
core
:
Core
cmra_car
;
cmra_op
:
Op
cmra_car
;
cmra_op
:
Op
cmra_car
;
cmra_valid
:
Valid
cmra_car
;
cmra_valid
:
Valid
cmra_car
;
cmra_validN
:
ValidN
cmra_car
;
cmra_validN
:
ValidN
cmra_car
;
...
@@ -75,7 +75,7 @@ Arguments cmra_car : simpl never.
...
@@ -75,7 +75,7 @@ Arguments cmra_car : simpl never.
Arguments
cmra_equiv
:
simpl
never
.
Arguments
cmra_equiv
:
simpl
never
.
Arguments
cmra_dist
:
simpl
never
.
Arguments
cmra_dist
:
simpl
never
.
Arguments
cmra_compl
:
simpl
never
.
Arguments
cmra_compl
:
simpl
never
.
Arguments
cmra_
unit
:
simpl
never
.
Arguments
cmra_
core
:
simpl
never
.
Arguments
cmra_op
:
simpl
never
.
Arguments
cmra_op
:
simpl
never
.
Arguments
cmra_valid
:
simpl
never
.
Arguments
cmra_valid
:
simpl
never
.
Arguments
cmra_validN
:
simpl
never
.
Arguments
cmra_validN
:
simpl
never
.
...
@@ -83,7 +83,7 @@ Arguments cmra_div : simpl never.
...
@@ -83,7 +83,7 @@ Arguments cmra_div : simpl never.
Arguments
cmra_cofe_mixin
:
simpl
never
.
Arguments
cmra_cofe_mixin
:
simpl
never
.
Arguments
cmra_mixin
:
simpl
never
.
Arguments
cmra_mixin
:
simpl
never
.
Add
Printing
Constructor
cmraT
.
Add
Printing
Constructor
cmraT
.
Existing
Instances
cmra_
unit
cmra_op
cmra_valid
cmra_validN
cmra_div
.
Existing
Instances
cmra_
core
cmra_op
cmra_valid
cmra_validN
cmra_div
.
Coercion
cmra_cofeC
(
A
:
cmraT
)
:
cofeT
:=
CofeT
(
cmra_cofe_mixin
A
).
Coercion
cmra_cofeC
(
A
:
cmraT
)
:
cofeT
:=
CofeT
(
cmra_cofe_mixin
A
).
Canonical
Structure
cmra_cofeC
.
Canonical
Structure
cmra_cofeC
.
...
@@ -93,8 +93,8 @@ Section cmra_mixin.
...
@@ -93,8 +93,8 @@ Section cmra_mixin.
Implicit
Types
x
y
:
A
.
Implicit
Types
x
y
:
A
.
Global
Instance
cmra_op_ne
n
(
x
:
A
)
:
Proper
(
dist
n
==>
dist
n
)
(
op
x
).
Global
Instance
cmra_op_ne
n
(
x
:
A
)
:
Proper
(
dist
n
==>
dist
n
)
(
op
x
).
Proof
.
apply
(
mixin_cmra_op_ne
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_op_ne
_
(
cmra_mixin
A
)).
Qed
.
Global
Instance
cmra_
unit_ne
n
:
Proper
(
dist
n
==>
dist
n
)
(
@
unit
A
_
).
Global
Instance
cmra_
core_ne
n
:
Proper
(
dist
n
==>
dist
n
)
(
@
core
A
_
).
Proof
.
apply
(
mixin_cmra_
unit
_ne
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_
core
_ne
_
(
cmra_mixin
A
)).
Qed
.
Global
Instance
cmra_validN_ne
n
:
Proper
(
dist
n
==>
impl
)
(
@
validN
A
_
n
).
Global
Instance
cmra_validN_ne
n
:
Proper
(
dist
n
==>
impl
)
(
@
validN
A
_
n
).
Proof
.
apply
(
mixin_cmra_validN_ne
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_validN_ne
_
(
cmra_mixin
A
)).
Qed
.
Global
Instance
cmra_div_ne
n
:
Global
Instance
cmra_div_ne
n
:
...
@@ -108,12 +108,12 @@ Section cmra_mixin.
...
@@ -108,12 +108,12 @@ Section cmra_mixin.
Proof
.
apply
(
mixin_cmra_assoc
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_assoc
_
(
cmra_mixin
A
)).
Qed
.
Global
Instance
cmra_comm
:
Comm
(
≡
)
(
@
op
A
_
).
Global
Instance
cmra_comm
:
Comm
(
≡
)
(
@
op
A
_
).
Proof
.
apply
(
mixin_cmra_comm
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_comm
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_
unit_l
x
:
unit
x
⋅
x
≡
x
.
Lemma
cmra_
core_l
x
:
core
x
⋅
x
≡
x
.
Proof
.
apply
(
mixin_cmra_
unit
_l
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_
core
_l
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_
unit_idemp
x
:
unit
(
unit
x
)
≡
unit
x
.
Lemma
cmra_
core_idemp
x
:
core
(
core
x
)
≡
core
x
.
Proof
.
apply
(
mixin_cmra_
unit
_idemp
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_
core
_idemp
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_
unit_preserving
x
y
:
x
≼
y
→
unit
x
≼
unit
y
.
Lemma
cmra_
core_preserving
x
y
:
x
≼
y
→
core
x
≼
core
y
.
Proof
.
apply
(
mixin_cmra_
unit
_preserving
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_
core
_preserving
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
.
Lemma
cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
.
Proof
.
apply
(
mixin_cmra_validN_op_l
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_validN_op_l
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
.
Lemma
cmra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
.
...
@@ -175,7 +175,7 @@ Implicit Types x y z : A.
...
@@ -175,7 +175,7 @@ Implicit Types x y z : A.
Implicit
Types
xs
ys
zs
:
list
A
.
Implicit
Types
xs
ys
zs
:
list
A
.
(
**
**
Setoids
*
)
(
**
**
Setoids
*
)
Global
Instance
cmra_
unit_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
unit
A
_
).
Global
Instance
cmra_
core_proper
:
Proper
((
≡
)
==>
(
≡
))
(
@
core
A
_
).
Proof
.
apply
(
ne_proper
_
).
Qed
.
Proof
.
apply
(
ne_proper
_
).
Qed
.
Global
Instance
cmra_op_ne
'
n
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
op
A
_
).
Global
Instance
cmra_op_ne
'
n
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
op
A
_
).
Proof
.
Proof
.
...
@@ -236,15 +236,15 @@ Proof. rewrite (comm _ x); apply cmra_validN_op_l. Qed.
...
@@ -236,15 +236,15 @@ Proof. rewrite (comm _ x); apply cmra_validN_op_l. Qed.
Lemma
cmra_valid_op_r
x
y
:
✓
(
x
⋅
y
)
→
✓
y
.
Lemma
cmra_valid_op_r
x
y
:
✓
(
x
⋅
y
)
→
✓
y
.
Proof
.
rewrite
!
cmra_valid_validN
;
eauto
using
cmra_validN_op_r
.
Qed
.
Proof
.
rewrite
!
cmra_valid_validN
;
eauto
using
cmra_validN_op_r
.
Qed
.
(
**
**
Units
*
)
(
**
**
Core
*
)
Lemma
cmra_
unit_r
x
:
x
⋅
unit
x
≡
x
.
Lemma
cmra_
core_r
x
:
x
⋅
core
x
≡
x
.
Proof
.
by
rewrite
(
comm
_
x
)
cmra_
unit
_l
.
Qed
.
Proof
.
by
rewrite
(
comm
_
x
)
cmra_
core
_l
.
Qed
.
Lemma
cmra_
unit_unit
x
:
unit
x
⋅
unit
x
≡
unit
x
.
Lemma
cmra_
core_core
x
:
core
x
⋅
core
x
≡
core
x
.
Proof
.
by
rewrite
-{
2
}
(
cmra_
unit_idemp
x
)
cmra_unit
_r
.
Qed
.
Proof
.
by
rewrite
-{
2
}
(
cmra_
core_idemp
x
)
cmra_core
_r
.
Qed
.
Lemma
cmra_
unit_validN
n
x
:
✓
{
n
}
x
→
✓
{
n
}
unit
x
.
Lemma
cmra_
core_validN
n
x
:
✓
{
n
}
x
→
✓
{
n
}
core
x
.
Proof
.
rewrite
-{
1
}
(
cmra_
unit
_l
x
);
apply
cmra_validN_op_l
.
Qed
.
Proof
.
rewrite
-{
1
}
(
cmra_
core
_l
x
);
apply
cmra_validN_op_l
.
Qed
.
Lemma
cmra_
unit_valid
x
:
✓
x
→
✓
unit
x
.
Lemma
cmra_
core_valid
x
:
✓
x
→
✓
core
x
.
Proof
.
rewrite
-{
1
}
(
cmra_
unit
_l
x
);
apply
cmra_valid_op_l
.
Qed
.
Proof
.
rewrite
-{
1
}
(
cmra_
core
_l
x
);
apply
cmra_valid_op_l
.
Qed
.
(
**
**
Div
*
)
(
**
**
Div
*
)
Lemma
cmra_op_div
'
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
÷
x
≡
{
n
}
≡
y
.
Lemma
cmra_op_div
'
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
÷
x
≡
{
n
}
≡
y
.
...
@@ -260,7 +260,7 @@ Qed.
...
@@ -260,7 +260,7 @@ Qed.
Global
Instance
cmra_includedN_preorder
n
:
PreOrder
(
@
includedN
A
_
_
n
).
Global
Instance
cmra_includedN_preorder
n
:
PreOrder
(
@
includedN
A
_
_
n
).
Proof
.
Proof
.
split
.
split
.
-
by
intros
x
;
exists
(
unit
x
);
rewrite
cmra_unit
_r
.
-
by
intros
x
;
exists
(
core
x
);
rewrite
cmra_core
_r
.
-
intros
x
y
z
[
z1
Hy
]
[
z2
Hz
];
exists
(
z1
⋅
z2
).
-
intros
x
y
z
[
z1
Hy
]
[
z2
Hz
];
exists
(
z1
⋅
z2
).
by
rewrite
assoc
-
Hy
-
Hz
.
by
rewrite
assoc
-
Hy
-
Hz
.
Qed
.
Qed
.
...
@@ -288,13 +288,13 @@ Proof. rewrite (comm op); apply cmra_includedN_l. Qed.
...
@@ -288,13 +288,13 @@ Proof. rewrite (comm op); apply cmra_includedN_l. Qed.
Lemma
cmra_included_r
x
y
:
y
≼
x
⋅
y
.
Lemma
cmra_included_r
x
y
:
y
≼
x
⋅
y
.
Proof
.
rewrite
(
comm
op
);
apply
cmra_included_l
.
Qed
.
Proof
.
rewrite
(
comm
op
);
apply
cmra_included_l
.
Qed
.
Lemma
cmra_
unit_preservingN
n
x
y
:
x
≼
{
n
}
y
→
unit
x
≼
{
n
}
unit
y
.
Lemma
cmra_
core_preservingN
n
x
y
:
x
≼
{
n
}
y
→
core
x
≼
{
n
}
core
y
.
Proof
.
Proof
.
intros
[
z
->
].
intros
[
z
->
].
apply
cmra_included_includedN
,
cmra_
unit
_preserving
,
cmra_included_l
.
apply
cmra_included_includedN
,
cmra_
core
_preserving
,
cmra_included_l
.
Qed
.
Qed
.
Lemma
cmra_included_
unit
x
:
unit
x
≼
x
.
Lemma
cmra_included_
core
x
:
core
x
≼
x
.
Proof
.
by
exists
x
;
rewrite
cmra_
unit
_l
.
Qed
.
Proof
.
by
exists
x
;
rewrite
cmra_
core
_l
.
Qed
.
Lemma
cmra_preservingN_l
n
x
y
z
:
x
≼
{
n
}
y
→
z
⋅
x
≼
{
n
}
z
⋅
y
.
Lemma
cmra_preservingN_l
n
x
y
z
:
x
≼
{
n
}
y
→
z
⋅
x
≼
{
n
}
z
⋅
y
.
Proof
.
by
intros
[
z1
Hz1
];
exists
z1
;
rewrite
Hz1
(
assoc
op
).
Qed
.
Proof
.
by
intros
[
z1
Hz1
];
exists
z1
;
rewrite
Hz1
(
assoc
op
).
Qed
.
Lemma
cmra_preserving_l
x
y
z
:
x
≼
y
→
z
⋅
x
≼
z
⋅
y
.
Lemma
cmra_preserving_l
x
y
z
:
x
≼
y
→
z
⋅
x
≼
z
⋅
y
.
...
@@ -358,8 +358,8 @@ Section identity.
...
@@ -358,8 +358,8 @@ Section identity.
Proof
.
by
exists
x
;
rewrite
left_id
.
Qed
.
Proof
.
by
exists
x
;
rewrite
left_id
.
Qed
.
Global
Instance
cmra_empty_right_id
:
RightId
(
≡
)
∅
(
⋅
).
Global
Instance
cmra_empty_right_id
:
RightId
(
≡
)
∅
(
⋅
).
Proof
.
by
intros
x
;
rewrite
(
comm
op
)
left_id
.
Qed
.
Proof
.
by
intros
x
;
rewrite
(
comm
op
)
left_id
.
Qed
.
Lemma
cmra_
unit_empty
:
unit
∅
≡
∅
.
Lemma
cmra_
core_empty
:
core
∅
≡
∅
.
Proof
.
by
rewrite
-{
2
}
(
cmra_
unit
_l
∅
)
right_id
.
Qed
.
Proof
.
by
rewrite
-{
2
}
(
cmra_
core
_l
∅
)
right_id
.
Qed
.
End
identity
.
End
identity
.
(
**
**
Local
updates
*
)
(
**
**
Local
updates
*
)
...
@@ -468,7 +468,7 @@ Section cmra_transport.
...
@@ -468,7 +468,7 @@ Section cmra_transport.
Proof
.
by
intros
???
;
destruct
H
.
Qed
.
Proof
.
by
intros
???
;
destruct
H
.
Qed
.
Lemma
cmra_transport_op
x
y
:
T
(
x
⋅
y
)
=
T
x
⋅
T
y
.
Lemma
cmra_transport_op
x
y
:
T
(
x
⋅
y
)
=
T
x
⋅
T
y
.
Proof
.
by
destruct
H
.
Qed
.
Proof
.
by
destruct
H
.
Qed
.
Lemma
cmra_transport_
unit
x
:
T
(
unit
x
)
=
unit
(
T
x
).
Lemma
cmra_transport_
core
x
:
T
(
core
x
)
=
core
(
T
x
).
Proof
.
by
destruct
H
.
Qed
.
Proof
.
by
destruct
H
.
Qed
.
Lemma
cmra_transport_validN
n
x
:
✓
{
n
}
T
x
↔
✓
{
n
}
x
.
Lemma
cmra_transport_validN
n
x
:
✓
{
n
}
T
x
↔
✓
{
n
}
x
.
Proof
.
by
destruct
H
.
Qed
.
Proof
.
by
destruct
H
.
Qed
.
...
@@ -486,25 +486,25 @@ End cmra_transport.
...
@@ -486,25 +486,25 @@ End cmra_transport.
(
**
*
Instances
*
)
(
**
*
Instances
*
)
(
**
**
Discrete
CMRA
*
)
(
**
**
Discrete
CMRA
*
)
Class
RA
A
`
{
Equiv
A
,
Unit
A
,
Op
A
,
Valid
A
,
Div
A
}
:=
{
Class
RA
A
`
{
Equiv
A
,
Core
A
,
Op
A
,
Valid
A
,
Div
A
}
:=
{
(
*
setoids
*
)
(
*
setoids
*
)
ra_op_ne
(
x
:
A
)
:
Proper
((
≡
)
==>
(
≡
))
(
op
x
);
ra_op_ne
(
x
:
A
)
:
Proper
((
≡
)
==>
(
≡
))
(
op
x
);
ra_
unit_ne
:>
Proper
((
≡
)
==>
(
≡
))
unit
;
ra_
core_ne
:>
Proper
((
≡
)
==>
(
≡
))
core
;
ra_validN_ne
:>
Proper
((
≡
)
==>
impl
)
valid
;
ra_validN_ne
:>
Proper
((
≡
)
==>
impl
)
valid
;
ra_div_ne
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
div
;
ra_div_ne
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
div
;
(
*
monoid
*
)
(
*
monoid
*
)
ra_assoc
:>
Assoc
(
≡
)
(
⋅
);
ra_assoc
:>
Assoc
(
≡
)
(
⋅
);
ra_comm
:>
Comm
(
≡
)
(
⋅
);
ra_comm
:>
Comm
(
≡
)
(
⋅
);
ra_
unit_l
x
:
unit
x
⋅
x
≡
x
;
ra_
core_l
x
:
core
x
⋅
x
≡
x
;
ra_
unit_idemp
x
:
unit
(
unit
x
)
≡
unit
x
;
ra_
core_idemp
x
:
core
(
core
x
)
≡
core
x
;
ra_
unit_preserving
x
y
:
x
≼
y
→
unit
x
≼
unit
y
;
ra_
core_preserving
x
y
:
x
≼
y
→
core
x
≼
core
y
;
ra_valid_op_l
x
y
:
✓
(
x
⋅
y
)
→
✓
x
;
ra_valid_op_l
x
y
:
✓
(
x
⋅
y
)
→
✓
x
;
ra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
ra_op_div
x
y
:
x
≼
y
→
x
⋅
y
÷
x
≡
y
}
.
}
.
Section
discrete
.
Section
discrete
.
Context
{
A
:
cofeT
}
`
{
Discrete
A
}
.
Context
{
A
:
cofeT
}
`
{
Discrete
A
}
.
Context
`
{
Unit
A
,
Op
A
,
Valid
A
,
Div
A
}
(
ra
:
RA
A
).
Context
`
{
Core
A
,
Op
A
,
Valid
A
,
Div
A
}
(
ra
:
RA
A
).
Instance
discrete_validN
:
ValidN
A
:=
λ
n
x
,
✓
x
.
Instance
discrete_validN
:
ValidN
A
:=
λ
n
x
,
✓
x
.
Definition
discrete_cmra_mixin
:
CMRAMixin
A
.
Definition
discrete_cmra_mixin
:
CMRAMixin
A
.
...
@@ -523,7 +523,7 @@ End discrete.
...
@@ -523,7 +523,7 @@ End discrete.
(
**
**
CMRA
for
the
unit
type
*
)
(
**
**
CMRA
for
the
unit
type
*
)
Section
unit
.
Section
unit
.
Instance
unit_valid
:
Valid
()
:=
λ
x
,
True
.
Instance
unit_valid
:
Valid
()
:=
λ
x
,
True
.
Instance
unit_
unit
:
Unit
()
:=
λ
x
,
x
.
Instance
unit_
core
:
Core
()
:=
λ
x
,
x
.
Instance
unit_op
:
Op
()
:=
λ
x
y
,
().
Instance
unit_op
:
Op
()
:=
λ
x
y
,
().
Instance
unit_div
:
Div
()
:=
λ
x
y
,
().
Instance
unit_div
:
Div
()
:=
λ
x
y
,
().
Global
Instance
unit_empty
:
Empty
()
:=
().
Global
Instance
unit_empty
:
Empty
()
:=
().
...
@@ -541,7 +541,7 @@ Section prod.
...
@@ -541,7 +541,7 @@ Section prod.
Context
{
A
B
:
cmraT
}
.
Context
{
A
B
:
cmraT
}
.
Instance
prod_op
:
Op
(
A
*
B
)
:=
λ
x
y
,
(
x
.1
⋅
y
.1
,
x
.2
⋅
y
.2
).
Instance
prod_op
:
Op
(
A
*
B
)
:=
λ
x
y
,
(
x
.1
⋅
y
.1
,
x
.2
⋅
y
.2
).
Global
Instance
prod_empty
`
{
Empty
A
,
Empty
B
}
:
Empty
(
A
*
B
)
:=
(
∅
,
∅
).
Global
Instance
prod_empty
`
{
Empty
A
,
Empty
B
}
:
Empty
(
A
*
B
)
:=
(
∅
,
∅
).
Instance
prod_
unit
:
Unit
(
A
*
B
)
:=
λ
x
,
(
unit
(
x
.1
),
unit
(
x
.2
)).
Instance
prod_
core
:
Core
(
A
*
B
)
:=
λ
x
,
(
core
(
x
.1
),
core
(
x
.2
)).
Instance
prod_valid
:
Valid
(
A
*
B
)
:=
λ
x
,
✓
x
.1
∧
✓
x
.2
.
Instance
prod_valid
:
Valid
(
A
*
B
)
:=
λ
x
,
✓
x
.1
∧
✓
x
.2
.
Instance
prod_validN
:
ValidN
(
A
*
B
)
:=
λ
n
x
,
✓
{
n
}
x
.1
∧
✓
{
n
}
x
.2
.
Instance
prod_validN
:
ValidN
(
A
*
B
)
:=
λ
n
x
,
✓
{
n
}
x
.1
∧
✓
{
n
}
x
.2
.
Instance
prod_div
:
Div
(
A
*
B
)
:=
λ
x
y
,
(
x
.1
÷
y
.1
,
x
.2
÷
y
.2
).
Instance
prod_div
:
Div
(
A
*
B
)
:=
λ
x
y
,
(
x
.1
÷
y
.1
,
x
.2
÷
y
.2
).
...
@@ -569,10 +569,10 @@ Section prod.
...
@@ -569,10 +569,10 @@ Section prod.
-
by
intros
n
x
[
??
];
split
;
apply
cmra_validN_S
.
-
by
intros
n
x
[
??
];
split
;
apply
cmra_validN_S
.
-
by
split
;
rewrite
/=
assoc
.
-
by
split
;
rewrite
/=
assoc
.
-
by
split
;
rewrite
/=
comm
.
-
by
split
;
rewrite
/=
comm
.
-
by
split
;
rewrite
/=
cmra_
unit
_l
.
-
by
split
;
rewrite
/=
cmra_
core
_l
.
-
by
split
;
rewrite
/=
cmra_
unit
_idemp
.
-
by
split
;
rewrite
/=
cmra_
core
_idemp
.
-
intros
x
y
;
rewrite
!
prod_included
.
-
intros
x
y
;
rewrite
!
prod_included
.
by
intros
[
??
];
split
;
apply
cmra_
unit
_preserving
.
by
intros
[
??
];
split
;
apply
cmra_
core
_preserving
.
-
intros
n
x
y
[
??
];
split
;
simpl
in
*
;
eauto
using
cmra_validN_op_l
.
-
intros
n
x
y
[
??
];
split
;
simpl
in
*
;
eauto
using
cmra_validN_op_l
.
-
intros
x
y
;
rewrite
prod_included
;
intros
[
??
].
-
intros
x
y
;
rewrite
prod_included
;
intros
[
??
].
by
split
;
apply
cmra_op_div
.
by
split
;
apply
cmra_op_div
.
...
...
algebra/dec_agree.v
View file @
c2c84732
...
@@ -2,7 +2,7 @@ From algebra Require Export cmra.
...
@@ -2,7 +2,7 @@ From algebra Require Export cmra.
Local
Arguments
validN
_
_
_
!
_
/
.
Local
Arguments
validN
_
_
_
!
_
/
.
Local
Arguments
valid
_
_
!
_
/
.
Local
Arguments
valid
_
_
!
_
/
.
Local
Arguments
op
_
_
_
!
_
/
.
Local
Arguments
op
_
_
_
!
_
/
.
Local
Arguments
unit
_
_
!
_
/
.
Local
Arguments
core
_
_
!
_
/
.
(
*
This
is
isomorphic
to
option
,
but
has
a
very
different
RA
structure
.
*
)
(
*
This
is
isomorphic
to
option
,
but
has
a
very
different
RA
structure
.
*
)
Inductive
dec_agree
(
A
:
Type
)
:
Type
:=
Inductive
dec_agree
(
A
:
Type
)
:
Type
:=
...
@@ -26,7 +26,7 @@ Instance dec_agree_op : Op (dec_agree A) := λ x y,
...
@@ -26,7 +26,7 @@ Instance dec_agree_op : Op (dec_agree A) := λ x y,
|
DecAgree
a
,
DecAgree
b
=>
if
decide
(
a
=
b
)
then
DecAgree
a
else
DecAgreeBot
|
DecAgree
a
,
DecAgree
b
=>
if
decide
(
a
=
b
)
then
DecAgree
a
else
DecAgreeBot
|
_
,
_
=>
DecAgreeBot
|
_
,
_
=>
DecAgreeBot
end
.
end
.
Instance
dec_agree_
unit
:
Unit
(
dec_agree
A
)
:=
id
.
Instance
dec_agree_
core
:
Core
(
dec_agree
A
)
:=
id
.
Instance
dec_agree_div
:
Div
(
dec_agree
A
)
:=
λ
x
y
,
x
.
Instance
dec_agree_div
:
Div
(
dec_agree
A
)
:=
λ
x
y
,
x
.
Definition
dec_agree_ra
:
RA
(
dec_agree
A
).
Definition
dec_agree_ra
:
RA
(
dec_agree
A
).
...
...
algebra/dra.v
View file @
c2c84732
...
@@ -18,17 +18,17 @@ Definition dra_included `{Equiv A, Valid A, Disjoint A, Op A} := λ x y,
...
@@ -18,17 +18,17 @@ Definition dra_included `{Equiv A, Valid A, Disjoint A, Op A} := λ x y,
Instance:
Params
(
@
dra_included
)
4.
Instance:
Params
(
@
dra_included
)
4.
Local
Infix
"≼"
:=
dra_included
.
Local
Infix
"≼"
:=
dra_included
.
Class
DRA
A
`
{
Equiv
A
,
Valid
A
,
Unit
A
,
Disjoint
A
,
Op
A
,
Div
A
}
:=
{
Class
DRA
A
`
{
Equiv
A
,
Valid
A
,
Core
A
,
Disjoint
A
,
Op
A
,
Div
A
}
:=
{
(
*
setoids
*
)
(
*
setoids
*
)
dra_equivalence
:>
Equivalence
((
≡
)
:
relation
A
);
dra_equivalence
:>
Equivalence
((
≡
)
:
relation
A
);
dra_op_proper
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
⋅
);
dra_op_proper
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
⋅
);
dra_
unit_proper
:>
Proper
((
≡
)
==>
(
≡
))
unit
;
dra_
core_proper
:>
Proper
((
≡
)
==>
(
≡
))
core
;
dra_valid_proper
:>
Proper
((
≡
)
==>
impl
)
valid
;
dra_valid_proper
:>
Proper
((
≡
)
==>
impl
)
valid
;
dra_disjoint_proper
:>
∀
x
,
Proper
((
≡
)
==>
impl
)
(
disjoint
x
);
dra_disjoint_proper
:>
∀
x
,
Proper
((
≡
)
==>
impl
)
(
disjoint
x
);
dra_div_proper
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
div
;
dra_div_proper
:>
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
div
;
(
*
validity
*
)
(
*
validity
*
)
dra_op_valid
x
y
:
✓
x
→
✓
y
→
x
⊥
y
→
✓
(
x
⋅
y
);
dra_op_valid
x
y
:
✓
x
→
✓
y
→
x
⊥
y
→
✓
(
x
⋅
y
);
dra_
unit_valid
x
:
✓
x
→
✓
unit
x
;
dra_
core_valid
x
:
✓
x
→
✓
core
x
;
dra_div_valid
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
✓
(
y
÷
x
);
dra_div_valid
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
✓
(
y
÷
x
);
(
*
monoid
*
)
(
*
monoid
*
)
dra_assoc
:>
Assoc
(
≡
)
(
⋅
);
dra_assoc
:>
Assoc
(
≡
)
(
⋅
);
...
@@ -36,10 +36,10 @@ Class DRA A `{Equiv A, Valid A, Unit A, Disjoint A, Op A, Div A} := {
...
@@ -36,10 +36,10 @@ Class DRA A `{Equiv A, Valid A, Unit A, Disjoint A, Op A, Div A} := {
dra_disjoint_move_l
x
y
z
:
✓
x
→
✓
y
→
✓
z
→
x
⊥
y
→
x
⋅
y
⊥
z
→
x
⊥
y
⋅
z
;
dra_disjoint_move_l
x
y
z
:
✓
x
→
✓
y
→
✓
z
→
x
⊥
y
→
x
⋅
y
⊥
z
→
x
⊥
y
⋅
z
;
dra_symmetric
:>
Symmetric
(
@
disjoint
A
_
);
dra_symmetric
:>
Symmetric
(
@
disjoint
A
_
);
dra_comm
x
y
:
✓
x
→
✓
y
→
x
⊥
y
→
x
⋅
y
≡
y
⋅
x
;
dra_comm
x
y
:
✓
x
→
✓
y
→
x
⊥
y
→
x
⋅
y
≡
y
⋅
x
;
dra_
unit_disjoint_l
x
:
✓
x
→
unit
x
⊥
x
;
dra_
core_disjoint_l
x
:
✓
x
→
core
x
⊥
x
;
dra_
unit_l
x
:
✓
x
→
unit
x
⋅
x
≡
x
;
dra_
core_l
x
:
✓
x
→
core
x
⋅
x
≡
x
;
dra_
unit_idemp
x
:
✓
x
→
unit
(
unit
x
)
≡
unit
x
;
dra_
core_idemp
x
:
✓
x
→
core
(
core
x
)
≡
core
x
;
dra_
unit_preserving
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
unit
x
≼
unit
y
;
dra_
core_preserving
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
core
x
≼
core
y
;
dra_disjoint_div
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
x
⊥
y
÷
x
;
dra_disjoint_div
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
x
⊥
y
÷
x
;
dra_op_div
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
x
⋅
y
÷
x
≡
y
dra_op_div
x
y
:
✓
x
→
✓
y
→
x
≼
y
→
x
⋅
y
÷
x
≡
y
}
.
}
.
...
@@ -88,9 +88,9 @@ Hint Unfold dra_included.
...
@@ -88,9 +88,9 @@ Hint Unfold dra_included.
Lemma
validity_valid_car_valid
(
z
:
T
)
:
✓
z
→
✓
validity_car
z
.
Lemma
validity_valid_car_valid
(
z
:
T
)
:
✓
z
→
✓
validity_car
z
.
Proof
.
apply
validity_prf
.
Qed
.
Proof
.
apply
validity_prf
.
Qed
.
Hint
Resolve
validity_valid_car_valid
.
Hint
Resolve
validity_valid_car_valid
.
Program
Instance
validity_
unit
:
Unit
T
:=
λ
x
,
Program
Instance
validity_
core
:
Core
T
:=
λ
x
,
Validity
(
unit
(
validity_car
x
))
(
✓
x
)
_.
Validity
(
core
(
validity_car
x
))
(
✓
x
)
_.
Solve
Obligations
with
naive_solver
auto
using
dra_
unit
_valid
.
Solve
Obligations
with
naive_solver
auto
using
dra_
core
_valid
.
Program
Instance
validity_op
:
Op
T
:=
λ
x
y
,
Program
Instance
validity_op
:
Op
T
:=
λ
x
y
,
Validity
(
validity_car
x
⋅
validity_car
y
)
Validity
(
validity_car
x
⋅
validity_car
y
)
(
✓
x
∧
✓
y
∧
validity_car
x
⊥
validity_car
y
)
_.
(
✓
x
∧
✓
y
∧
validity_car
x
⊥
validity_car
y
)
_.
...
@@ -118,14 +118,14 @@ Proof.
...
@@ -118,14 +118,14 @@ Proof.
|
by
intros
;
rewrite
assoc
].
|
by
intros
;
rewrite
assoc
].
-
intros
[
x
px
?
]
[
y
py
?
];
split
;
naive_solver
eauto
using
dra_comm
.
-
intros
[
x
px
?
]
[
y
py
?
];
split
;
naive_solver
eauto
using
dra_comm
.
-
intros
[
x
px
?
];
split
;
-
intros
[
x
px
?
];
split
;
naive_solver
eauto
using
dra_
unit_l
,
dra_unit
_disjoint_l
.
naive_solver
eauto
using
dra_
core_l
,
dra_core
_disjoint_l
.
-
intros
[
x
px
?
];
split
;
naive_solver
eauto
using
dra_
unit
_idemp
.
-
intros
[
x
px
?
];
split
;
naive_solver
eauto
using
dra_
core
_idemp
.
-
intros
x
y
Hxy
;
exists
(
unit
y
÷
unit
x
).
-
intros
x
y
Hxy
;
exists
(
core
y
÷
core
x
).
destruct
x
as
[
x
px
?
],
y
as
[
y
py
?
],
Hxy
as
[[
z
pz
?
]
[
??
]];
simpl
in
*
.
destruct
x
as
[
x
px
?
],
y
as
[
y
py
?
],
Hxy
as
[[
z
pz
?
]
[
??
]];
simpl
in
*
.
assert
(
py
→
unit
x
≼
unit
y
)
assert
(
py
→
core
x
≼
core
y
)
by
intuition
eauto
10
using
dra_
unit
_preserving
.
by
intuition
eauto
10
using
dra_
core
_preserving
.
constructor
;
[
|
symmetry
];
simpl
in
*
;
constructor
;
[
|
symmetry
];
simpl
in
*
;
intuition
eauto
using
dra_op_div
,
dra_disjoint_div
,
dra_
unit
_valid
.
intuition
eauto
using
dra_op_div
,
dra_disjoint_div
,
dra_
core
_valid
.
-
by
intros
[
x
px
?
]
[
y
py
?
]
(
?&?&?
).
-
by
intros
[
x
px
?
]
[
y
py
?
]
(
?&?&?
).
-
intros
[
x
px
?
]
[
y
py
?
]
[[
z
pz
?
]
[
??
]];
split
;
simpl
in
*
;
-
intros
[
x
px
?
]
[
y
py
?
]
[[
z
pz
?
]
[
??
]];
split
;
simpl
in
*
;
intuition
eauto
10
using
dra_disjoint_div
,
dra_op_div
.
intuition
eauto
10
using
dra_disjoint_div
,
dra_op_div
.
...
...
algebra/excl.v
View file @
c2c84732
...
@@ -91,7 +91,7 @@ Instance excl_valid : Valid (excl A) := λ x,
...
@@ -91,7 +91,7 @@ Instance excl_valid : Valid (excl A) := λ x,
Instance
excl_validN
:
ValidN
(
excl
A
)
:=
λ
n
x
,
Instance
excl_validN
:
ValidN
(
excl
A
)
:=
λ
n
x
,
match
x
with
Excl
_
|
ExclUnit
=>
True
|
ExclBot
=>
False
end
.
match
x
with
Excl
_
|
ExclUnit
=>
True
|
ExclBot
=>
False
end
.
Global
Instance
excl_empty
:
Empty
(
excl
A
)
:=
ExclUnit
.
Global
Instance
excl_empty
:
Empty
(
excl
A
)
:=
ExclUnit
.
Instance
excl_
unit
:
Unit
(
excl
A
)
:=
λ
_
,
∅
.
Instance
excl_
core
:
Core
(
excl
A
)
:=
λ
_
,
∅
.
Instance
excl_op
:
Op
(
excl
A
)
:=
λ
x
y
,
Instance
excl_op
:
Op
(
excl
A
)
:=
λ
x
y
,
match
x
,
y
with
match
x
,
y
with
|
Excl
a
,
ExclUnit
|
ExclUnit
,
Excl
a
=>
Excl
a
|
Excl
a
,
ExclUnit
|
ExclUnit
,
Excl
a
=>
Excl
a
...
...
algebra/fin_maps.v
View file @
c2c84732
...
@@ -93,7 +93,7 @@ Context `{Countable K} {A : cmraT}.
...
@@ -93,7 +93,7 @@ Context `{Countable K} {A : cmraT}.
Implicit
Types
m
:
gmap
K
A
.
Implicit
Types
m
:
gmap
K
A
.
Instance
map_op
:
Op
(
gmap
K
A
)
:=
merge
op
.
Instance
map_op
:
Op
(
gmap
K
A
)
:=
merge
op
.
Instance
map_
unit
:
Unit
(
gmap
K
A
)
:=
fmap
unit
.
Instance
map_
core
:
Core
(
gmap
K
A
)
:=
fmap
core
.
Instance
map_valid
:
Valid
(
gmap
K
A
)
:=
λ
m
,
∀
i
,
✓
(
m
!!
i
).
Instance
map_valid
:
Valid
(
gmap
K
A
)
:=
λ
m
,
∀
i
,
✓
(
m
!!
i
).
Instance
map_validN
:
ValidN
(
gmap
K
A
)
:=
λ
n
m
,
∀
i
,
✓
{
n
}
(
m
!!
i
).
Instance
map_validN
:
ValidN
(
gmap
K
A
)
:=
λ
n
m
,
∀
i
,
✓
{
n
}
(
m
!!
i
).
Instance
map_div
:
Div
(
gmap
K
A
)
:=
merge
div
.
Instance
map_div
:
Div
(
gmap
K
A
)
:=
merge
div
.
...
@@ -102,7 +102,7 @@ Lemma lookup_op m1 m2 i : (m1 ⋅ m2) !! i = m1 !! i ⋅ m2 !! i.
...
@@ -102,7 +102,7 @@ Lemma lookup_op m1 m2 i : (m1 ⋅ m2) !! i = m1 !! i ⋅ m2 !! i.
Proof
.
by
apply
lookup_merge
.
Qed
.
Proof
.
by
apply
lookup_merge
.
Qed
.
Lemma
lookup_div
m1
m2
i
:
(
m1
÷
m2
)
!!
i
=
m1
!!
i
÷
m2
!!
i
.
Lemma
lookup_div
m1
m2
i
:
(
m1
÷
m2
)
!!
i
=
m1
!!
i
÷
m2
!!
i
.
Proof
.
by
apply
lookup_merge
.
Qed
.
Proof
.
by
apply
lookup_merge
.
Qed
.
Lemma
lookup_
unit
m
i
:
unit
m
!!
i
=
unit
(
m
!!
i
).
Lemma
lookup_
core
m
i
:
core
m
!!
i
=
core
(
m
!!
i
).
Proof
.
by
apply
lookup_fmap
.
Qed
.
Proof
.
by
apply
lookup_fmap
.
Qed
.
Lemma
map_included_spec
(
m1
m2
:
gmap
K
A
)
:
m1
≼
m2
↔
∀
i
,
m1
!!
i
≼
m2
!!
i
.
Lemma
map_included_spec
(
m1
m2
:
gmap
K
A
)
:
m1
≼
m2
↔
∀
i
,
m1
!!
i
≼
m2
!!
i
.
...
@@ -125,7 +125,7 @@ Definition map_cmra_mixin : CMRAMixin (gmap K A).
...
@@ -125,7 +125,7 @@ Definition map_cmra_mixin : CMRAMixin (gmap K A).
Proof
.
Proof
.
split
.
split
.
-
by
intros
n
m1
m2
m3
Hm
i
;
rewrite
!
lookup_op
(
Hm
i
).
-
by
intros
n
m1
m2
m3
Hm
i
;
rewrite
!
lookup_op
(
Hm
i
).
-
by
intros
n
m1
m2
Hm
i
;
rewrite
!
lookup_
unit
(
Hm
i
).
-
by
intros
n
m1
m2
Hm
i
;
rewrite
!
lookup_
core
(
Hm
i
).
-
by
intros
n
m1
m2
Hm
?
i
;
rewrite
-
(
Hm
i
).
-
by
intros
n
m1
m2
Hm
?
i
;
rewrite
-
(
Hm
i
).
-
by
intros
n
m1
m1
'
Hm1
m2
m2
'
Hm2
i
;
rewrite
!
lookup_div
(
Hm1
i
)
(
Hm2
i
).
-
by
intros
n
m1
m1
'
Hm1
m2
m2
'
Hm2
i
;
rewrite
!
lookup_div
(
Hm1
i
)
(
Hm2
i
).
-
intros
m
;
split
.
-
intros
m
;
split
.
...
@@ -134,10 +134,10 @@ Proof.
...
@@ -134,10 +134,10 @@ Proof.
-
intros
n
m
Hm
i
;
apply
cmra_validN_S
,
Hm
.
-
intros
n
m
Hm
i
;
apply
cmra_validN_S
,
Hm
.
-
by
intros
m1
m2
m3
i
;
rewrite
!
lookup_op
assoc
.
-
by
intros
m1
m2
m3
i
;
rewrite
!
lookup_op
assoc
.
-
by
intros
m1
m2
i
;
rewrite
!
lookup_op
comm
.
-
by
intros
m1
m2
i
;
rewrite
!
lookup_op
comm
.
-
by
intros
m
i
;
rewrite
lookup_op
!
lookup_
unit
cmra_unit
_l
.
-
by
intros
m
i
;
rewrite
lookup_op
!
lookup_
core
cmra_core
_l
.
-
by
intros
m
i
;
rewrite
!
lookup_
unit
cmra_unit
_idemp
.
-
by
intros
m
i
;
rewrite
!
lookup_
core
cmra_core
_idemp
.