Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rice Wine
Iris
Commits
b05660a6
Commit
b05660a6
authored
Oct 22, 2017
by
Robbert Krebbers
Browse files
Rename `Discrete` → `OFEDiscrete` (OFEs whose elements are all discrete).
parent
d9417f9a
Changes
9
Hide whitespace changes
Inline
Side-by-side
theories/algebra/agree.v
View file @
b05660a6
...
...
@@ -149,7 +149,7 @@ Proof. rewrite /CMRATotal; eauto. Qed.
Global
Instance
agree_persistent
(
x
:
agree
A
)
:
Persistent
x
.
Proof
.
by
constructor
.
Qed
.
Global
Instance
agree_discrete
:
Discrete
A
→
CMRADiscrete
agreeR
.
Global
Instance
agree_
ofe_
discrete
:
OFE
Discrete
A
→
CMRADiscrete
agreeR
.
Proof
.
intros
HD
.
split
.
-
intros
x
y
[
H
H'
]
n
;
split
=>
a
;
setoid_rewrite
<-(
timeless_iff_0
_
_
)
;
auto
.
...
...
theories/algebra/auth.v
View file @
b05660a6
...
...
@@ -52,7 +52,7 @@ Qed.
Global
Instance
Auth_timeless
a
b
:
Timeless
a
→
Timeless
b
→
Timeless
(
Auth
a
b
).
Proof
.
by
intros
??
[??]
[??]
;
split
;
apply
:
timeless
.
Qed
.
Global
Instance
auth_discrete
:
Discrete
A
→
Discrete
authC
.
Global
Instance
auth_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
authC
.
Proof
.
intros
?
[??]
;
apply
_
.
Qed
.
Global
Instance
auth_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
(
auth
A
).
Proof
.
by
intros
?
[??]
[??]
[??]
;
f_equal
/=
;
apply
leibniz_equiv
.
Qed
.
...
...
theories/algebra/cmra.v
View file @
b05660a6
...
...
@@ -240,7 +240,7 @@ End ucmra_mixin.
(** * Discrete CMRAs *)
Class
CMRADiscrete
(
A
:
cmraT
)
:
=
{
cmra_discrete
:
>
Discrete
A
;
cmra_discrete
_ofe_discrete
:
>
OFE
Discrete
A
;
cmra_discrete_valid
(
x
:
A
)
:
✓
{
0
}
x
→
✓
x
}.
Hint
Mode
CMRADiscrete
!
:
typeclass_instances
.
...
...
@@ -554,7 +554,7 @@ Proof.
split
;
first
by
rewrite
cmra_valid_validN
.
eauto
using
cmra_discrete_valid
,
cmra_validN_le
with
lia
.
Qed
.
Lemma
cmra_discrete_included_iff
`
{
Discrete
A
}
n
x
y
:
x
≼
y
↔
x
≼
{
n
}
y
.
Lemma
cmra_discrete_included_iff
`
{
OFE
Discrete
A
}
n
x
y
:
x
≼
y
↔
x
≼
{
n
}
y
.
Proof
.
split
;
first
by
apply
cmra_included_includedN
.
intros
[
z
->%(
timeless_iff
_
_
)]
;
eauto
using
cmra_included_l
.
...
...
@@ -597,7 +597,9 @@ Lemma id_free_l x `{!IdFree x} y : ✓x → y ⋅ x ≡ x → False.
Proof
.
rewrite
comm
.
eauto
using
id_free_r
.
Qed
.
Lemma
discrete_id_free
x
`
{
CMRADiscrete
A
}
:
(
∀
y
,
✓
x
→
x
⋅
y
≡
x
→
False
)
→
IdFree
x
.
Proof
.
repeat
intro
.
eauto
using
cmra_discrete_valid
,
cmra_discrete
,
timeless
.
Qed
.
Proof
.
intros
Hx
y
??.
apply
(
Hx
y
),
(
timeless
_
)
;
eauto
using
cmra_discrete_valid
.
Qed
.
Global
Instance
id_free_op_r
x
y
:
IdFree
y
→
Cancelable
x
→
IdFree
(
x
⋅
y
).
Proof
.
intros
??
z
?
Hid
%
symmetry
.
revert
Hid
.
rewrite
-
assoc
=>/(
cancelableN
x
)
?.
...
...
theories/algebra/csum.v
View file @
b05660a6
...
...
@@ -96,7 +96,7 @@ Next Obligation.
+
rewrite
(
conv_compl
n
(
csum_chain_r
c
b'
))
/=.
destruct
(
c
n
)
;
naive_solver
.
Qed
.
Global
Instance
csum_discrete
:
Discrete
A
→
Discrete
B
→
Discrete
csumC
.
Global
Instance
csum_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
B
→
OFE
Discrete
csumC
.
Proof
.
by
inversion_clear
3
;
constructor
;
apply
(
timeless
_
).
Qed
.
Global
Instance
csum_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
B
→
LeibnizEquiv
(
csumC
A
B
).
...
...
theories/algebra/excl.v
View file @
b05660a6
...
...
@@ -59,7 +59,7 @@ Proof.
-
by
intros
[]
;
constructor
.
Qed
.
Global
Instance
excl_discrete
:
Discrete
A
→
Discrete
exclC
.
Global
Instance
excl_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
exclC
.
Proof
.
by
inversion_clear
2
;
constructor
;
apply
(
timeless
_
).
Qed
.
Global
Instance
excl_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
(
excl
A
).
Proof
.
by
destruct
2
;
f_equal
;
apply
leibniz_equiv
.
Qed
.
...
...
@@ -91,7 +91,7 @@ Proof.
Qed
.
Canonical
Structure
exclR
:
=
CMRAT
(
excl
A
)
excl_cmra_mixin
.
Global
Instance
excl_cmra_discrete
:
Discrete
A
→
CMRADiscrete
exclR
.
Global
Instance
excl_cmra_discrete
:
OFE
Discrete
A
→
CMRADiscrete
exclR
.
Proof
.
split
.
apply
_
.
by
intros
[].
Qed
.
(** Internalized properties *)
...
...
theories/algebra/gmap.v
View file @
b05660a6
...
...
@@ -37,7 +37,7 @@ Next Obligation.
by
rewrite
conv_compl
/=
;
apply
reflexive_eq
.
Qed
.
Global
Instance
gmap_discrete
:
Discrete
A
→
Discrete
gmapC
.
Global
Instance
gmap_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
gmapC
.
Proof
.
intros
?
m
m'
?
i
.
by
apply
(
timeless
_
).
Qed
.
(* why doesn't this go automatic? *)
Global
Instance
gmapC_leibniz
:
LeibnizEquiv
A
→
LeibnizEquiv
gmapC
.
...
...
theories/algebra/list.v
View file @
b05660a6
...
...
@@ -77,7 +77,7 @@ Next Obligation.
by
rewrite
Hcn
.
Qed
.
Global
Instance
list_discrete
:
Discrete
A
→
Discrete
listC
.
Global
Instance
list_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
listC
.
Proof
.
induction
2
;
constructor
;
try
apply
(
timeless
_
)
;
auto
.
Qed
.
Global
Instance
nil_timeless
:
Timeless
(@
nil
A
).
...
...
theories/algebra/ofe.v
View file @
b05660a6
...
...
@@ -107,8 +107,8 @@ Arguments timeless {_} _ {_} _ _.
Hint
Mode
Timeless
+
!
:
typeclass_instances
.
Instance
:
Params
(@
Timeless
)
1
.
Class
Discrete
(
A
:
ofeT
)
:
=
discrete_timeless
(
x
:
A
)
:
>
Timeless
x
.
Hint
Mode
Discrete
!
:
typeclass_instances
.
Class
OFE
Discrete
(
A
:
ofeT
)
:
=
ofe_
discrete_timeless
(
x
:
A
)
:
>
Timeless
x
.
Hint
Mode
OFE
Discrete
!
:
typeclass_instances
.
(** OFEs with a completion *)
Record
chain
(
A
:
ofeT
)
:
=
{
...
...
@@ -653,7 +653,7 @@ Section unit.
Global
Program
Instance
unit_cofe
:
Cofe
unitC
:
=
{
compl
x
:
=
()
}.
Next
Obligation
.
by
repeat
split
;
try
exists
0
.
Qed
.
Global
Instance
unit_discrete
_cofe
:
Discrete
unitC
.
Global
Instance
unit_
ofe_
discrete
:
OFE
Discrete
unitC
.
Proof
.
done
.
Qed
.
End
unit
.
...
...
@@ -686,7 +686,7 @@ Section product.
Global
Instance
prod_timeless
(
x
:
A
*
B
)
:
Timeless
(
x
.
1
)
→
Timeless
(
x
.
2
)
→
Timeless
x
.
Proof
.
by
intros
???[??]
;
split
;
apply
(
timeless
_
).
Qed
.
Global
Instance
prod_discrete
_cofe
:
Discrete
A
→
Discrete
B
→
Discrete
prodC
.
Global
Instance
prod_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
B
→
OFE
Discrete
prodC
.
Proof
.
intros
??
[??]
;
apply
_
.
Qed
.
End
product
.
...
...
@@ -868,7 +868,7 @@ Section sum.
Proof
.
inversion_clear
2
;
constructor
;
by
apply
(
timeless
_
).
Qed
.
Global
Instance
inr_timeless
(
y
:
B
)
:
Timeless
y
→
Timeless
(
inr
y
).
Proof
.
inversion_clear
2
;
constructor
;
by
apply
(
timeless
_
).
Qed
.
Global
Instance
sum_discrete
_ofe
:
Discrete
A
→
Discrete
B
→
Discrete
sumC
.
Global
Instance
sum_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
B
→
OFE
Discrete
sumC
.
Proof
.
intros
??
[?|?]
;
apply
_
.
Qed
.
End
sum
.
...
...
@@ -923,7 +923,7 @@ Section discrete_ofe.
-
done
.
Qed
.
Global
Instance
discrete_discrete
_ofe
:
Discrete
(
OfeT
A
discrete_ofe_mixin
).
Global
Instance
discrete_
ofe_
discrete
:
OFE
Discrete
(
OfeT
A
discrete_ofe_mixin
).
Proof
.
by
intros
x
y
.
Qed
.
Global
Program
Instance
discrete_cofe
:
Cofe
(
OfeT
A
discrete_ofe_mixin
)
:
=
...
...
@@ -992,7 +992,7 @@ Section option.
destruct
(
c
n
)
;
naive_solver
.
Qed
.
Global
Instance
option_discrete
:
Discrete
A
→
Discrete
optionC
.
Global
Instance
option_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
optionC
.
Proof
.
destruct
2
;
constructor
;
by
apply
(
timeless
_
).
Qed
.
Global
Instance
Some_ne
:
NonExpansive
(@
Some
A
).
...
...
@@ -1226,7 +1226,7 @@ Section sigma.
Global
Instance
sig_timeless
(
x
:
sig
P
)
:
Timeless
(
`
x
)
→
Timeless
x
.
Proof
.
intros
?
y
.
rewrite
sig_dist_alt
sig_equiv_alt
.
apply
(
timeless
_
).
Qed
.
Global
Instance
sig_discrete
_ofe
:
Discrete
A
→
Discrete
sigC
.
Global
Instance
sig_
ofe_
discrete
:
OFE
Discrete
A
→
OFE
Discrete
sigC
.
Proof
.
intros
??.
apply
_
.
Qed
.
End
sigma
.
...
...
theories/algebra/vector.v
View file @
b05660a6
...
...
@@ -29,7 +29,7 @@ Section ofe.
intros
??
v'
?.
inv_vec
v'
=>
x'
v'
.
inversion_clear
1
.
constructor
.
by
apply
timeless
.
change
(
v
≡
v'
).
by
apply
timeless
.
Qed
.
Global
Instance
vec_discrete
_cofe
m
:
Discrete
A
→
Discrete
(
vecC
m
).
Global
Instance
vec_
ofe_
discrete
m
:
OFE
Discrete
A
→
OFE
Discrete
(
vecC
m
).
Proof
.
intros
?
v
.
induction
v
;
apply
_
.
Qed
.
End
ofe
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment