feat: allow a general evalTac at evalSepTactics - #7702
Conversation
|
Mathlib CI status (docs):
|
|
changelog-language |
| -/ | ||
| partial def evalSepTactics : Tactic := goEven | ||
|
|
||
| The user can provide their own tactic evaluation function `evalTac`. |
There was a problem hiding this comment.
Could you please expand this comment with an example of why one might want to do this? Otherwise future maintainers will be absolutely puzzled.
There was a problem hiding this comment.
I would write something like this:
Assume a tactic developer writes a new general modified tactic execution,
for example calling automation each step, displaying the goal in a specific
way, modifying the behavior of some tactics...
def customEvalTactic : Tactic :=
Then it is possible to create a tactic scope in which this tactic is called
on each line of the scope, while preserving the incremental elaboration by
@[tactic my_scope, incremental]
def myScopeElab : Tactic := fun stx => do
withNarrowedArgTacticReuse 1 (
withNarrowedArgTacticReuse 0 (
withNarrowedArgTacticReuse 0 (
(evalSepTactics customEvalTactic)
)
)
) stx
|
|
||
| @[builtin_tactic seq1] def evalSeq1 : Tactic := fun stx => | ||
| evalSepTactics stx[0] | ||
| (evalSepTactics) stx[0] |
There was a problem hiding this comment.
Please just pass the argument explicitly, in which case we may as well remove the default value
|
This hasn't been touched in over a year, and has a merge conflict. I'm closing now; please re-open if you think appropriate. |
This PR generalizes
evalSepTactics, so that users can use incremental elaboration in their own proof environment.#lean4 > custom incremental elaboration
This was suggested by @mirefek