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
ab64d367
Commit
ab64d367
authored
1 year ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add 'inv(ersion) select'
parent
a186464f
No related branches found
No related tags found
1 merge request
!546
Add `inv select` and `inversion select` tactics
Pipeline
#99415
passed
1 year ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
stdpp/tactics.v
+12
-0
12 additions, 0 deletions
stdpp/tactics.v
tests/tactics.v
+24
-2
24 additions, 2 deletions
tests/tactics.v
with
38 additions
and
2 deletions
CHANGELOG.md
+
2
−
0
View file @
ab64d367
...
...
@@ -30,6 +30,8 @@ Coq 8.19 is newly supported by this version of std++.
-
Add lemma
`join_app`
.
-
Allow patterns and type annotations in
`propset`
notation, e.g.,
`{[ (x, y) : nat * nat | x = y ]}`
. (by Thibaut Pérami)
-
Add
`inv select`
and
`inversion select`
tactics that allow selecting the
to-be-inverted hypothesis with a pattern.
The following
`sed`
script should perform most of the renaming
(on macOS, replace
`sed`
by
`gsed`
, installed via e.g.
`brew install gnu-sed`
).
...
...
This diff is collapsed.
Click to expand it.
stdpp/tactics.v
+
12
−
0
View file @
ab64d367
...
...
@@ -774,6 +774,9 @@ Tactic Notation "select" open_constr(pat) tactic3(tac) :=
so then shelved goals are produced for every such evar. *)
|
H
:
pat
|
-
_
=>
let
T
:=
(
type
of
H
)
in
unify
T
pat
;
tac
H
end
.
(** We provide [select] variants of some widely used tactics. *)
(** [select_revert] reverts the first hypothesis matching [pat]. *)
Tactic
Notation
"revert"
"select"
open_constr
(
pat
)
:=
select
pat
(
fun
H
=>
revert
H
)
.
...
...
@@ -785,6 +788,15 @@ Tactic Notation "destruct" "select" open_constr(pat) :=
Tactic
Notation
"destruct"
"select"
open_constr
(
pat
)
"as"
simple_intropattern
(
ipat
)
:=
select
pat
(
fun
H
=>
destruct
H
as
ipat
)
.
Tactic
Notation
"inversion"
"select"
open_constr
(
pat
)
:=
select
pat
(
fun
H
=>
inversion
H
)
.
Tactic
Notation
"inversion"
"select"
open_constr
(
pat
)
"as"
simple_intropattern
(
ipat
)
:=
select
pat
(
fun
H
=>
inversion
H
as
ipat
)
.
Tactic
Notation
"inv"
"select"
open_constr
(
pat
)
:=
select
pat
(
fun
H
=>
inv
H
)
.
Tactic
Notation
"inv"
"select"
open_constr
(
pat
)
"as"
simple_intropattern
(
ipat
)
:=
select
pat
(
fun
H
=>
inv
H
as
ipat
)
.
(** The tactic [is_closed_term t] succeeds if [t] is a closed term and fails otherwise.
By closed we mean that [t] does not depend on any variable bound in the context.
axioms are considered closed terms by this tactic (but Section
...
...
This diff is collapsed.
Click to expand it.
tests/tactics.v
+
24
−
2
View file @
ab64d367
...
...
@@ -79,13 +79,35 @@ Proof. intros P **. rename select (P _) into HP4. apply HP4. Qed.
Goal
∀
P
Q
:
Prop
,
True
∨
True
→
P
∨
Q
→
Q
∨
P
.
Proof
.
intros
P
Q
??
.
(* should select the last hypothesis *)
intros
P
Q
??
.
(* should select the last hypothesis *)
destruct
select
(_
∨
_);
by
constructor
.
Restart
.
intros
P
Q
??
.
(* should select the last hypothesis *)
intros
P
Q
??
.
(* should select the last hypothesis *)
destruct
select
(_
∨
_)
as
[
H1
|
H2
]
.
-
right
.
exact
H1
.
-
left
.
exact
H2
.
Restart
.
intros
P
Q
??
.
(* should select the last hypothesis *)
inv
select
(_
∨
_);
by
constructor
.
Restart
.
intros
P
Q
??
.
(* should select the last hypothesis *)
inv
select
(_
∨
_)
as
[
H1
|
H2
]
.
-
right
.
exact
H1
.
-
left
.
exact
H2
.
Restart
.
intros
P
Q
??
.
(* should select the last hypothesis *)
inversion
select
(_
∨
_);
by
constructor
.
Restart
.
intros
P
Q
??
.
(* should select the last hypothesis *)
inversion
select
(_
∨
_)
as
[
H1
|
H2
]
.
-
right
.
exact
H1
.
-
left
.
exact
H2
.
Qed
.
(** [mk_evar] works on things that coerce to types. *)
...
...
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