[Merged by Bors] - fix: return early in library_search if initial solveByElim succeeds#2302
Closed
[Merged by Bors] - fix: return early in library_search if initial solveByElim succeeds#2302
Conversation
Member
We should probably filter out bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Feb 15, 2023
…2302) Fixes a bug introduced in #856. If `solveByElim` succeeds, then we should return early. Otherwise, we look through all lemmas in the environment and find something like `namedPattern` or `Eq.mp` and unnecessarily wrap the result in that. See #2276 for an example bad output caused by this bug. Another example is this test: https://github.com/leanprover-community/mathlib4/blob/4ed65899eca4909e9b8f23a113b52ff8cb3f5d41/test/librarySearch.lean#L15 On master, it emits `exact namedPattern p p rfl`, and after this PR it correctly emits `exact p`.
|
Pull request successfully merged into master. Build succeeded:
|
mo271
pushed a commit
that referenced
this pull request
Feb 18, 2023
…2302) Fixes a bug introduced in #856. If `solveByElim` succeeds, then we should return early. Otherwise, we look through all lemmas in the environment and find something like `namedPattern` or `Eq.mp` and unnecessarily wrap the result in that. See #2276 for an example bad output caused by this bug. Another example is this test: https://github.com/leanprover-community/mathlib4/blob/4ed65899eca4909e9b8f23a113b52ff8cb3f5d41/test/librarySearch.lean#L15 On master, it emits `exact namedPattern p p rfl`, and after this PR it correctly emits `exact p`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug introduced in #856.
If
solveByElimsucceeds, then we should return early. Otherwise, we look through all lemmas in the environment and find something likenamedPatternorEq.mpand unnecessarily wrap the result in that.See #2276 for an example bad output caused by this bug.
Another example is this test:
mathlib4/test/librarySearch.lean
Line 15 in 4ed6589
On master, it emits
exact namedPattern p p rfl, and after this PR it correctly emitsexact p.