Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Model registry
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
Iris
stdpp
Commits
fb4b91fe
Verified
Commit
fb4b91fe
authored
2 years ago
by
Paolo G. Giarrusso
Browse files
Options
Downloads
Patches
Plain Diff
option.v: Add option_guard_decide and option_guard_bool_decide
Motivated by
https://mattermost.mpi-sws.org/iris/pl/cz6f4bxwsir78jkunk7nt3bawo
.
parent
3c6ebc4b
No related branches found
No related tags found
1 merge request
!433
option.v: Add option_guard_decide and option_guard_bool_decide
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stdpp/option.v
+6
-0
6 additions, 0 deletions
stdpp/option.v
with
6 additions
and
0 deletions
stdpp/option.v
+
6
−
0
View file @
fb4b91fe
...
@@ -362,6 +362,12 @@ Proof. intros. by case_option_guard. Qed.
...
@@ -362,6 +362,12 @@ Proof. intros. by case_option_guard. Qed.
Lemma
option_guard_iff
{
A
}
P
Q
`{
Decision
P
,
Decision
Q
}
(
mx
:
option
A
)
:
Lemma
option_guard_iff
{
A
}
P
Q
`{
Decision
P
,
Decision
Q
}
(
mx
:
option
A
)
:
(
P
↔
Q
)
→
(
guard
P
;
mx
)
=
guard
Q
;
mx
.
(
P
↔
Q
)
→
(
guard
P
;
mx
)
=
guard
Q
;
mx
.
Proof
.
intros
[??]
.
repeat
case_option_guard
;
intuition
.
Qed
.
Proof
.
intros
[??]
.
repeat
case_option_guard
;
intuition
.
Qed
.
Lemma
option_guard_decide
{
A
}
P
`{
Decision
P
}
(
mx
:
option
A
)
:
(
guard
P
;
mx
)
=
if
decide
P
then
mx
else
None
.
Proof
.
done
.
Qed
.
Lemma
option_guard_bool_decide
{
A
}
P
`{
Decision
P
}
(
mx
:
option
A
)
:
(
guard
P
;
mx
)
=
if
bool_decide
P
then
mx
else
None
.
Proof
.
by
rewrite
option_guard_decide
,
decide_bool_decide
.
Qed
.
Tactic
Notation
"simpl_option"
"by"
tactic3
(
tac
)
:=
Tactic
Notation
"simpl_option"
"by"
tactic3
(
tac
)
:=
let
assert_Some_None
A
mx
H
:=
first
let
assert_Some_None
A
mx
H
:=
first
...
...
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