Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
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
Simcha van Collem
Iris
Commits
de82a00c
Commit
de82a00c
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Frame preserving updates for option.
parent
45b28c12
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
modures/option.v
+20
-7
20 additions, 7 deletions
modures/option.v
with
20 additions
and
7 deletions
modures/option.v
+
20
−
7
View file @
de82a00c
...
...
@@ -61,7 +61,6 @@ 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
.
(* CMRA *)
Section
cmra
.
Context
{
A
:
cmraT
}
.
...
...
@@ -131,14 +130,28 @@ 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
.
Lemma
op_is_Some
mx
my
:
is_Some
(
mx
⋅
my
)
↔
is_Some
mx
∨
is_Some
my
.
Proof
.
destruct
mx
,
my
;
rewrite
/
op
/
option_op
/=
-!
not_eq_None_Some
;
naive_solver
.
Qed
.
Lemma
option_op_positive_dist_l
n
mx
my
:
mx
⋅
my
=
{
n
}
=
None
→
mx
=
{
n
}
=
None
.
Proof
.
by
destruct
mx
,
my
;
inversion_clear
1
.
Qed
.
Lemma
option_op_positive_dist_r
n
mx
my
:
mx
⋅
my
=
{
n
}
=
None
→
my
=
{
n
}
=
None
.
Proof
.
by
destruct
mx
,
my
;
inversion_clear
1
.
Qed
.
Lemma
option_updateP
(
P
:
A
→
Prop
)
(
Q
:
option
A
→
Prop
)
x
:
x
⇝:
P
→
(
∀
y
,
P
y
→
Q
(
Some
y
))
→
Some
x
⇝:
Q
.
Proof
.
intros
Hx
Hy
[
y
|]
n
?
.
{
destruct
(
Hx
y
n
)
as
(
y'
&
?
&
?);
auto
.
exists
(
Some
y'
);
auto
.
}
destruct
(
Hx
(
unit
x
)
n
)
as
(
y'
&
?
&
?);
rewrite
?cmra_unit_r
;
auto
.
by
exists
(
Some
y'
);
split
;
[
auto
|
apply
cmra_validN_op_l
with
(
unit
x
)]
.
Qed
.
Lemma
option_update
x
y
:
x
⇝
y
→
Some
x
⇝
Some
y
.
Proof
.
destruct
x
,
y
;
rewrite
/
op
/
option_op
/=
-!
not_eq_None_Some
;
naive_solver
.
intros
;
apply
cmra_update_updateP
,
(
option_updateP
(
y
=
));
[|
naive_solver
]
.
by
apply
cmra_update_updateP
.
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
.
Proof
.
by
destruct
x
,
y
;
inversion_clear
1
.
Qed
.
End
cmra
.
Arguments
optionRA
:
clear
implicits
.
...
...
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