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
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
Adam
stdpp
Commits
06531b45
Commit
06531b45
authored
4 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Fix documentation of `select` to state that it selects the "last" hypothesis.
parent
1f7d13f3
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
tests/tactics.v
+3
-0
3 additions, 0 deletions
tests/tactics.v
theories/tactics.v
+7
-8
7 additions, 8 deletions
theories/tactics.v
with
10 additions
and
8 deletions
tests/tactics.v
+
3
−
0
View file @
06531b45
...
@@ -51,3 +51,6 @@ Qed.
...
@@ -51,3 +51,6 @@ Qed.
Goal
∀
(
n
:
nat
),
∃
m
:
nat
,
True
.
Goal
∀
(
n
:
nat
),
∃
m
:
nat
,
True
.
Proof
.
intros
?
.
rename
select
nat
into
m
.
exists
m
.
done
.
Qed
.
Proof
.
intros
?
.
rename
select
nat
into
m
.
exists
m
.
done
.
Qed
.
Goal
∀
(
P
:
nat
→
Prop
),
P
3
→
P
4
→
P
4
.
Proof
.
intros
.
rename
select
(
P
_)
into
HP4
.
apply
HP4
.
Qed
.
This diff is collapsed.
Click to expand it.
theories/tactics.v
+
7
−
8
View file @
06531b45
...
@@ -508,14 +508,13 @@ Ltac block_goal := match goal with [ |- ?T ] => change (block T) end.
...
@@ -508,14 +508,13 @@ Ltac block_goal := match goal with [ |- ?T ] => change (block T) end.
Ltac
unblock_goal
:=
unfold
block
in
*.
Ltac
unblock_goal
:=
unfold
block
in
*.
(** [select] finds the first hypothesis matching [pat] and passes it
(** The tactic [select pat tac] finds the last (i.e., bottommost) hypothesis
to the continuation [tac]. Its main advantage over using [match goal
matching [pat] and passes it to the continuation [tac]. Its main advantage over
with ] directly is that it is shorter. If [pat] matches multiple
using [match goal with ] directly is that it is shorter. If [pat] matches
hypotheses, then [tac] will only be called on the first matching
multiple hypotheses and [tac] fails, then [select tac] will not backtrack on
hypothesis. If [tac] fails, [select] will not backtrack on subsequent
subsequent matching hypotheses.
matching hypotheses.
The tactic [select] is written in CPS and does not return the name of the
[select] is written in CPS and does not return the name of the
hypothesis due to limitations in the Ltac1 tactic runtime (see
hypothesis due to limitations in the Ltac1 tactic runtime (see
https://gitter.im/coq/coq?at=5e96c82f85b01628f04bbb89). *)
https://gitter.im/coq/coq?at=5e96c82f85b01628f04bbb89). *)
Tactic
Notation
"select"
open_constr
(
pat
)
tactic3
(
tac
)
:=
Tactic
Notation
"select"
open_constr
(
pat
)
tactic3
(
tac
)
:=
...
...
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