`try_for` tactic (timeouts in tactics)
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
The situation does not seem to have changed since #1364 , but there is no current issue tracking this so I thought I would open this so we don't forget. There is currently no equivalent of the try_for tactic from lean 3, which amounts to a metaprogramming API which allows you to abort a tactic call if a heartbeat limit is exceeded. CoreM has a heartbeat counter, and there is also a (unrelated?) heartbeat counter in the C++ code, but attempts to hook these up into a reliable timeout mechanism appear to have failed.
Desired behavior:
example : True := by
-- Note, this may not actually work as a test case
-- since `try_for` counts heartbeats and `sleep` counts ms.
-- Substitute any expensive tactic for a better test
fail_if_success try_for 100 (sleep 1000)
try_for 10000 (sleep 1000)
trivial
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the CoreM heartbeat counter and the separate C++ heartbeat counter, then review the history referenced by issue #1364 to understand why previous timeout attempts failed. Use the provided try_for example as the behavioral target, including aborting an over-limit tactic and allowing one within the limit.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100