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
Abhishek Anand
Iris
Commits
777e3509
Commit
777e3509
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
CMRA on nat.
parent
79df624d
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
algebra/cmra.v
+36
-1
36 additions, 1 deletion
algebra/cmra.v
with
36 additions
and
1 deletion
algebra/cmra.v
+
36
−
1
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
}
.
...
...
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