Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
Iris
Commits
777e3509
Commit
777e3509
authored
Jun 14, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMRA on nat.
parent
79df624d
Pipeline
#1404
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
algebra/cmra.v
algebra/cmra.v
+36
-1
No files found.
algebra/cmra.v
View file @
777e3509
...
...
@@ -867,7 +867,7 @@ Section unit.
Instance
unit_pcore
:
PCore
()
:
=
λ
x
,
Some
x
.
Instance
unit_op
:
Op
()
:
=
λ
x
y
,
().
Lemma
unit_cmra_mixin
:
CMRAMixin
().
Proof
.
apply
cmra_total_mixin
;
try
done
.
eauto
.
by
exists
((),())
.
Qed
.
Proof
.
apply
discrete_cmra_mixin
,
ra_total_mixin
;
by
eauto
.
Qed
.
Canonical
Structure
unitR
:
cmraT
:
=
CMRAT
()
unit_cofe_mixin
unit_cmra_mixin
.
Instance
unit_empty
:
Empty
()
:
=
().
...
...
@@ -882,6 +882,41 @@ Section unit.
Proof
.
by
constructor
.
Qed
.
End
unit
.
(** ** Natural numbers *)
Section
nat
.
Instance
nat_valid
:
Valid
nat
:
=
λ
x
,
True
.
Instance
nat_validN
:
ValidN
nat
:
=
λ
n
x
,
True
.
Instance
nat_pcore
:
PCore
nat
:
=
λ
x
,
Some
0
.
Instance
nat_op
:
Op
nat
:
=
plus
.
Lemma
nat_included
(
x
y
:
nat
)
:
x
≼
y
↔
x
≤
y
.
Proof
.
split
.
-
intros
[
z
->]
;
unfold
op
,
nat_op
;
lia
.
-
exists
(
y
-
x
).
by
apply
le_plus_minus
.
Qed
.
Lemma
nat_cmra_mixin
:
CMRAMixin
nat
.
Proof
.
apply
discrete_cmra_mixin
,
ra_total_mixin
;
try
by
eauto
.
-
solve_proper
.
-
intros
x
y
z
.
apply
Nat
.
add_assoc
.
-
intros
x
y
.
apply
Nat
.
add_comm
.
-
by
exists
0
.
Qed
.
Canonical
Structure
natR
:
cmraT
:
=
CMRAT
nat
(@
discrete_cofe_mixin
_
equivL
_
)
nat_cmra_mixin
.
Instance
nat_empty
:
Empty
nat
:
=
0
.
Lemma
nat_ucmra_mixin
:
UCMRAMixin
nat
.
Proof
.
split
;
apply
_
||
done
.
Qed
.
Canonical
Structure
natUR
:
ucmraT
:
=
UCMRAT
nat
(@
discrete_cofe_mixin
_
equivL
_
)
nat_cmra_mixin
nat_ucmra_mixin
.
Global
Instance
nat_cmra_discrete
:
CMRADiscrete
natR
.
Proof
.
constructor
;
apply
_
||
done
.
Qed
.
Global
Instance
nat_persistent
(
x
:
())
:
Persistent
x
.
Proof
.
by
constructor
.
Qed
.
End
nat
.
(** ** Product *)
Section
prod
.
Context
{
A
B
:
cmraT
}.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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