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
a6f215a9
Commit
a6f215a9
authored
2 years ago
by
Michael Sammler
Browse files
Options
Downloads
Patches
Plain Diff
Add case_match eqn: tactic for naming hypotheses generated by case_match
parent
ba7cf37b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!388
Add case_match eqn: tactic for naming hypotheses generated by case_match
Pipeline
#69712
passed
2 years ago
Stage: build
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
tests/tactics.v
+16
-0
16 additions, 0 deletions
tests/tactics.v
theories/tactics.v
+6
-3
6 additions, 3 deletions
theories/tactics.v
with
24 additions
and
3 deletions
CHANGELOG.md
+
2
−
0
View file @
a6f215a9
...
@@ -24,6 +24,8 @@ Coq 8.11 is no longer supported.
...
@@ -24,6 +24,8 @@ Coq 8.11 is no longer supported.
-
Rename
`map_disjoint_subseteq`
→
`kmap_subseteq`
and
-
Rename
`map_disjoint_subseteq`
→
`kmap_subseteq`
and
`map_disjoint_subset`
→
`kmap_subset`
.
`map_disjoint_subset`
→
`kmap_subset`
.
-
Add
`map_Exists`
as an analogue to
`map_Forall`
. (by Michael Sammler)
-
Add
`map_Exists`
as an analogue to
`map_Forall`
. (by Michael Sammler)
-
Add
`case_match eqn:H`
that behaves like
`case_match`
but allows naming the
generated equality. (by Michael Sammler)
The following
`sed`
script should perform most of the renaming
The following
`sed`
script should perform most of the renaming
(on macOS, replace
`sed`
by
`gsed`
, installed via e.g.
`brew install gnu-sed`
).
(on macOS, replace
`sed`
by
`gsed`
, installed via e.g.
`brew install gnu-sed`
).
...
...
This diff is collapsed.
Click to expand it.
tests/tactics.v
+
16
−
0
View file @
a6f215a9
...
@@ -49,6 +49,22 @@ Proof.
...
@@ -49,6 +49,22 @@ Proof.
destruct_and
?
.
Fail
destruct_and
!.
assumption
.
destruct_and
?
.
Fail
destruct_and
!.
assumption
.
Qed
.
Qed
.
(** Tests for [case_match] *)
Goal
∀
n
:
nat
,
match
n
with
|
0
=>
n
=
0
|
S
n'
=>
n
=
S
n'
end
.
Proof
.
intros
.
by
case_match
.
Restart
.
intros
.
by
case_match
eqn
:
Heq
;
revert
Heq
.
(* [revert Heq] checks that [Heq] exists *)
Qed
.
Goal
∀
n
m
:
nat
,
match
n
with
|
0
=>
m
=
0
|
S
n'
=>
m
=
S
n'
end
→
n
=
m
.
Proof
.
intros
.
by
case_match
.
Restart
.
intros
.
by
case_match
eqn
:
Heq
;
revert
Heq
.
(* [revert Heq] checks that [Heq] exists *)
Qed
.
(** Tests for [select] tactics *)
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
.
...
...
This diff is collapsed.
Click to expand it.
theories/tactics.v
+
6
−
3
View file @
a6f215a9
...
@@ -163,11 +163,14 @@ Tactic Notation "destruct_or" "!" :=
...
@@ -163,11 +163,14 @@ Tactic Notation "destruct_or" "!" :=
(** The tactic [case_match] destructs an arbitrary match in the conclusion or
(** The tactic [case_match] destructs an arbitrary match in the conclusion or
assumptions, and generates a corresponding equality. This tactic is best used
assumptions, and generates a corresponding equality. This tactic is best used
together with the [repeat] tactical. *)
together with the [repeat] tactical. *)
Ltac
case_match
:=
Tactic
Notation
"case_match"
"eqn"
":"
ident
(
Hd
)
:=
match
goal
with
match
goal
with
|
H
:
context
[
match
?x
with
_
=>
_
end
]
|
-
_
=>
destruct
x
eqn
:
?
|
H
:
context
[
match
?x
with
_
=>
_
end
]
|
-
_
=>
destruct
x
eqn
:
Hd
|
|
-
context
[
match
?x
with
_
=>
_
end
]
=>
destruct
x
eqn
:
?
|
|
-
context
[
match
?x
with
_
=>
_
end
]
=>
destruct
x
eqn
:
Hd
end
.
end
.
Ltac
case_match
:=
let
H
:=
fresh
in
case_match
eqn
:
H
.
(** The tactic [unless T by tac_fail] succeeds if [T] is not provable by
(** The tactic [unless T by tac_fail] succeeds if [T] is not provable by
the tactic [tac_fail]. *)
the tactic [tac_fail]. *)
...
...
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