Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marianna Rapoport
iris-coq
Commits
2ed8bac2
Commit
2ed8bac2
authored
Feb 04, 2016
by
Robbert Krebbers
Browse files
CMRAIdentity instance for option.
parent
1fa70657
Changes
1
Hide whitespace changes
Inline
Side-by-side
algebra/option.v
View file @
2ed8bac2
...
@@ -63,6 +63,7 @@ Context {A : cmraT}.
...
@@ -63,6 +63,7 @@ Context {A : cmraT}.
Instance
option_validN
:
ValidN
(
option
A
)
:
=
λ
n
mx
,
Instance
option_validN
:
ValidN
(
option
A
)
:
=
λ
n
mx
,
match
mx
with
Some
x
=>
✓
{
n
}
x
|
None
=>
True
end
.
match
mx
with
Some
x
=>
✓
{
n
}
x
|
None
=>
True
end
.
Global
Instance
option_empty
:
Empty
(
option
A
)
:
=
None
.
Instance
option_unit
:
Unit
(
option
A
)
:
=
fmap
unit
.
Instance
option_unit
:
Unit
(
option
A
)
:
=
fmap
unit
.
Instance
option_op
:
Op
(
option
A
)
:
=
union_with
(
λ
x
y
,
Some
(
x
⋅
y
)).
Instance
option_op
:
Op
(
option
A
)
:
=
union_with
(
λ
x
y
,
Some
(
x
⋅
y
)).
Instance
option_minus
:
Minus
(
option
A
)
:
=
Instance
option_minus
:
Minus
(
option
A
)
:
=
...
@@ -125,6 +126,8 @@ Proof.
...
@@ -125,6 +126,8 @@ Proof.
Qed
.
Qed
.
Canonical
Structure
optionRA
:
=
Canonical
Structure
optionRA
:
=
CMRAT
option_cofe_mixin
option_cmra_mixin
option_cmra_extend_mixin
.
CMRAT
option_cofe_mixin
option_cmra_mixin
option_cmra_extend_mixin
.
Global
Instance
option_cmra_identity
:
CMRAIdentity
optionRA
.
Proof
.
split
.
done
.
by
intros
[].
by
inversion_clear
1
.
Qed
.
Lemma
op_is_Some
mx
my
:
is_Some
(
mx
⋅
my
)
↔
is_Some
mx
∨
is_Some
my
.
Lemma
op_is_Some
mx
my
:
is_Some
(
mx
⋅
my
)
↔
is_Some
mx
∨
is_Some
my
.
Proof
.
Proof
.
...
...
Write
Preview
Supports
Markdown
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