Skip to content

feat: guard against synthetic sorry misuse #8230

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

Kha
Copy link
Member

@Kha Kha commented May 5, 2025

This PR fixes a potential metaprogramming issue where code that creates a synthetic sorry without logging an error prevents logging of any follow-up error.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 5, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented May 5, 2025

Mathlib CI status (docs):

  • ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-05-05 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-05-05 10:11:37)
  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2025-05-05 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-05-05 11:55:51)

@kim-em
Copy link
Collaborator

kim-em commented May 5, 2025

Fixes #8212.

@kim-em kim-em added the changelog-language Language features, tactics, and metaprograms label May 5, 2025
@Kha Kha marked this pull request as draft May 5, 2025 11:34
github-merge-queue bot pushed a commit that referenced this pull request May 5, 2025
This PR changes the behaviour of `apply?` so that the `sorry` it uses to
close the goal is non-synthetic. (Recall that correct use of synthetic
sorries requires that the tactic also generates an error message, which
we don't want to do in this situation.) Either this PR or #8230 are
sufficient to defend against the problem reported in #8212.
github-actions bot pushed a commit that referenced this pull request May 5, 2025
This PR changes the behaviour of `apply?` so that the `sorry` it uses to
close the goal is non-synthetic. (Recall that correct use of synthetic
sorries requires that the tactic also generates an error message, which
we don't want to do in this situation.) Either this PR or #8230 are
sufficient to defend against the problem reported in #8212.

(cherry picked from commit 77b9e51)
kim-em added a commit that referenced this pull request May 5, 2025
This PR changes the behaviour of `apply?` so that the `sorry` it uses to
close the goal is non-synthetic. (Recall that correct use of synthetic
sorries requires that the tactic also generates an error message, which
we don't want to do in this situation.) Either this PR or #8230 are
sufficient to defend against the problem reported in #8212.

(cherry picked from commit 77b9e51)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport releases/v4.20.0 changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants