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
Tej Chajed
iris
Commits
1c8276cb
Commit
1c8276cb
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More option properties.
parent
752d27aa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modures/option.v
+14
-2
14 additions, 2 deletions
modures/option.v
prelude/option.v
+2
-0
2 additions, 0 deletions
prelude/option.v
with
16 additions
and
2 deletions
modures/option.v
+
14
−
2
View file @
1c8276cb
...
...
@@ -45,6 +45,10 @@ Qed.
Canonical
Structure
optionC
:=
CofeT
option_cofe_mixin
.
Global
Instance
Some_ne
:
Proper
(
dist
n
==>
dist
n
)
(
@
Some
A
)
.
Proof
.
by
constructor
.
Qed
.
Global
Instance
is_Some_ne
n
:
Proper
(
dist
(
S
n
)
==>
iff
)
(
@
is_Some
A
)
.
Proof
.
inversion_clear
1
;
split
;
eauto
.
Qed
.
Global
Instance
Some_dist_inj
:
Injective
(
dist
n
)
(
dist
n
)
(
@
Some
A
)
.
Proof
.
by
inversion_clear
1
.
Qed
.
Global
Instance
None_timeless
:
Timeless
(
@
None
A
)
.
Proof
.
inversion_clear
1
;
constructor
.
Qed
.
Global
Instance
Some_timeless
x
:
Timeless
x
→
Timeless
(
Some
x
)
.
...
...
@@ -56,8 +60,7 @@ Arguments optionC : clear implicits.
Instance
option_fmap_ne
{
A
B
:
cofeT
}
(
f
:
A
→
B
)
n
:
Proper
(
dist
n
==>
dist
n
)
f
→
Proper
(
dist
n
==>
dist
n
)
(
fmap
(
M
:=
option
)
f
)
.
Proof
.
by
intros
Hf
;
destruct
1
;
constructor
;
apply
Hf
.
Qed
.
Instance
is_Some_ne
`{
A
:
cofeT
}
:
Proper
(
dist
(
S
n
)
==>
iff
)
(
@
is_Some
A
)
.
Proof
.
intros
n
;
inversion_clear
1
;
split
;
eauto
.
Qed
.
(* CMRA *)
Section
cmra
.
...
...
@@ -95,6 +98,11 @@ Proof.
try
(
by
exists
my
;
destruct
my
;
constructor
)
.
by
exists
(
Some
z
);
constructor
.
Qed
.
Lemma
None_includedN
n
(
mx
:
option
A
)
:
None
≼
{
n
}
mx
.
Proof
.
rewrite
option_includedN
;
auto
.
Qed
.
Lemma
Some_Some_includedN
n
(
x
y
:
A
)
:
x
≼
{
n
}
y
→
Some
x
≼
{
n
}
Some
y
.
Proof
.
rewrite
option_includedN
;
eauto
10
.
Qed
.
Definition
option_cmra_mixin
:
CMRAMixin
(
option
A
)
.
Proof
.
split
.
...
...
@@ -138,6 +146,10 @@ Qed.
Canonical
Structure
optionRA
:=
CMRAT
option_cofe_mixin
option_cmra_mixin
option_cmra_extend_mixin
.
Lemma
op_is_Some
x
y
:
is_Some
(
x
⋅
y
)
↔
is_Some
x
∨
is_Some
y
.
Proof
.
destruct
x
,
y
;
rewrite
/
op
/
option_op
/=
-!
not_eq_None_Some
;
naive_solver
.
Qed
.
Lemma
option_op_positive_dist_l
n
x
y
:
x
⋅
y
=
{
n
}
=
None
→
x
=
{
n
}
=
None
.
Proof
.
by
destruct
x
,
y
;
inversion_clear
1
.
Qed
.
Lemma
option_op_positive_dist_r
n
x
y
:
x
⋅
y
=
{
n
}
=
None
→
y
=
{
n
}
=
None
.
...
...
This diff is collapsed.
Click to expand it.
prelude/option.v
+
2
−
0
View file @
1c8276cb
...
...
@@ -107,6 +107,8 @@ Section setoids.
Lemma
equiv_Some
(
mx
my
:
option
A
)
x
:
mx
≡
my
→
mx
=
Some
x
→
∃
y
,
my
=
Some
y
∧
x
≡
y
.
Proof
.
destruct
1
;
naive_solver
.
Qed
.
Global
Instance
is_Some_proper
:
Proper
((
≡
)
==>
iff
)
(
@
is_Some
A
)
.
Proof
.
inversion_clear
1
;
split
;
eauto
.
Qed
.
End
setoids
.
(** Equality on [option] is decidable. *)
...
...
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