[Merged by Bors] - feat: deprecate Expr.isConstantApplication#35267
[Merged by Bors] - feat: deprecate Expr.isConstantApplication#35267JovanGerb wants to merge 3 commits intoleanprover-community:masterfrom
Expr.isConstantApplication#35267Conversation
PR summary 37d2101b79Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diffNo declarations were harmed in the making of this PR! 🐙 You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
joneugster
left a comment
There was a problem hiding this comment.
LGTM, thanks!
How do we see that
[...] we don't treat
(fun x => α) (n + 1)as a type that depends onNat
?
Is there an test/example/anything which illustrates this is working as intended without the check?
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by joneugster. |
|
Can you fix the test failures, please? Thanks! |
|
(I've added some more details to the PR description. The function was working as intended for the most common cases, but as can be seen from this PR, the check is not necessary. I can't tell whether it was never necessary, or if some improvements have been made to Lean in the meantime that have made it unnecessary. I'll fix the test tomorrow) |
|
!bench |
|
Benchmark results for e08549f against 37d2101 are in! @JovanGerb
No significant changes detected. |
| -- make sure that we don't treat `(fun x => α) (n + 1)` as a type that depends on `Nat` | ||
| guard !x.isConstantApplication |
There was a problem hiding this comment.
I agree with @joneugster that it's not obvious why this check is no longer needed, and I'd like to see a test case.
|
What sort of test case would you like? I claim that this is simply not relevant, because it doesn't come up in practice. |
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
|
The relevant history is that this particular test was added at some point early in the port, in order to fix a basic use case. However, since CI is green on this PR, the check isn't necessary anymore. |
|
Okay, looking at the history in detail, commit bors r+ |
The function `Expr.isConstantApplication` does its de bruijn index managenent incorrectly, so this PR deprecates it. It was added in #1861. It should have used de bruijn index 0, but it actually used de bruijn index `n - 2`. This means that it would works correctly for the number of arguments being at most 2. This PR removes the call to `Expr.isConstantApplication` used by `to_additive`, which is not needed anymore. It turns out that the check is simply not necessary.
|
Pull request successfully merged into master. Build succeeded: |
Expr.isConstantApplicationExpr.isConstantApplication
) The function `Expr.isConstantApplication` does its de bruijn index managenent incorrectly, so this PR deprecates it. It was added in leanprover-community#1861. It should have used de bruijn index 0, but it actually used de bruijn index `n - 2`. This means that it would works correctly for the number of arguments being at most 2. This PR removes the call to `Expr.isConstantApplication` used by `to_additive`, which is not needed anymore. It turns out that the check is simply not necessary.
) The function `Expr.isConstantApplication` does its de bruijn index managenent incorrectly, so this PR deprecates it. It was added in leanprover-community#1861. It should have used de bruijn index 0, but it actually used de bruijn index `n - 2`. This means that it would works correctly for the number of arguments being at most 2. This PR removes the call to `Expr.isConstantApplication` used by `to_additive`, which is not needed anymore. It turns out that the check is simply not necessary.
The function
Expr.isConstantApplicationdoes its de bruijn index managenent incorrectly, so this PR deprecates it. It was added in #1861. It should have used de bruijn index 0, but it actually used de bruijn indexn - 2. This means that it would works correctly for the number of arguments being at most 2.This PR removes the call to
Expr.isConstantApplicationused byto_additive, which is not needed anymore. It turns out that the check is simply not necessary.