Extensions to the case
tactic #
Adds a variant of case
that looks for a goal with a particular type, rather than a goal
with a particular tag.
For consistency with case
, it takes a tag as well, but the tag can be a hole _
.
Also adds case'
extensions.
Clause for a case ... : ...
tactic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of a case ... | ...
tactic that's a tactic sequence (or hole).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of a case ... | ...
tactic that's an exact term.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of a case ... : ...
tactic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
case _ : t => tac
finds the first goal that unifies witht
and then solves it usingtac
or else fails. Likeshow
, it changes the type of the goal tot
. The_
can optionally be a case tag, in which case it only looks at goals whose tag would be considered bycase
(goals with an exact tag match, followed by goals with the tag as a suffix, followed by goals with the tag as a prefix).case _ n₁ ... nₘ : t => tac
additionally names them
most recent hypotheses with inaccessible names to the given names. The names are renamed before matching againstt
. The_
can optionally be a case tag.case _ : t := e
is short forcase _ : t => exact e
.case _ : t₁ | _ : t₂ | ... => tac
is equivalent to(case _ : t₁ => tac); (case _ : t₂ => tac); ...
but with all matching done on the original list of goals -- each goal is consumed as they are matched, so patterns may repeat or overlap.case _ : t
will make the matched goal be the first goal.case _ : t₁ | _ : t₂ | ...
makes the matched goals be the first goals in the given order.case _ : t := _
andcase _ : t := ?m
are the same ascase _ : t
but in the?m
case the goal tag is changed tom
. In particular, the goal becomes metavariable?m
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
case' _ : t => tac
is similar to the case _ : t => tac
tactic,
but it does not ensure the goal has been solved after applying tac
,
nor does it admit the goal if tac
failed.
Recall that case
closes the goal using sorry
when tac
fails,
and the tactic execution is not interrupted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Find the first goal among those matching tag
whose type unifies with patt
.
The renameI
array consists of names to use to rename inaccessibles.
The patt
term is elaborated in the context where the inaccessibles have been renamed.
Returns the found goal, goals caused by elaborating patt
, and the remaining goals.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a casePattBody
, either give a synthetic hole or a tactic sequence
(along with the syntax for the =>
).
Converts holes into synthetic holes since they are processed with elabTermWithHoles
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Implementation for case
and case'
.
Equations
- One or more equations did not get rendered due to their size.