Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception.isMaxHeartbeat no longer works #5565

Closed
3 tasks done
eric-wieser opened this issue Oct 1, 2024 · 0 comments · Fixed by #5566
Closed
3 tasks done

Exception.isMaxHeartbeat no longer works #5565

eric-wieser opened this issue Oct 1, 2024 · 0 comments · Fixed by #5566
Labels
bug Something isn't working

Comments

@eric-wieser
Copy link
Contributor

eric-wieser commented Oct 1, 2024

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Exception.isMaxHeartbeats returns false on the exception thrown by Lean.Core.throwMaxHeartbeat

Context

This means that try/catch now catches heartbeat errors, which means many tactics now ignore the heartbeat counter.

Steps to Reproduce

  1. Run
import Lean

run_meta
  try
    Lean.Core.throwMaxHeartbeat `foo `bar 200
  catch e =>
    Lean.logWarning m!"{e.toMessageData}"
    unless e.isMaxHeartbeat do
      throwError "oh no"

Expected behavior: The exception should not be caught

Actual behavior: A heartbeat exception is thrown, but e.isMaxHeartbeat returns false.

Versions

  • 4.11.0
  • 4.12.0-nightly-2024-10-01

Additional Information

[Additional information, configuration or data that might be necessary to reproduce the issue]

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@eric-wieser eric-wieser added the bug Something isn't working label Oct 1, 2024
eric-wieser added a commit to eric-wieser/lean4 that referenced this issue Oct 1, 2024
eric-wieser added a commit to eric-wieser/lean4 that referenced this issue Oct 1, 2024
eric-wieser added a commit to eric-wieser/lean4 that referenced this issue Oct 1, 2024
eric-wieser added a commit to eric-wieser/lean4 that referenced this issue Oct 1, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 9, 2024
Fixes #5565, by using tags instead of trying to string match on a
`MessageData`. This ends up reverting some unwanted test output changes
from #4781 too.

This changes `isMaxRecDepth` for good measure too.

This was a regression in Lean 4.11.0, so may be worth backporting to
4.12.x, if not also 4.11.x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant