[Merged by Bors] - feat: beta reduce in the T% elaborator#30879
[Merged by Bors] - feat: beta reduce in the T% elaborator#30879grunweg wants to merge 14 commits intoleanprover-community:masterfrom
T% elaborator#30879Conversation
PR summary 13a1b47278Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
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
|
4154850 to
220e6a6
Compare
|
Thanks for the comments! I'm aware it's a bit hard to judge if these changes are useful. This question ("should T% beta-reduce") came up in direct conversation with Floris (fpvandoorn). An instance where I might have hit this is in #30357 in Running I tested this after this PR; I remember seeing these kind of error a lot of times when trying this without #30879. I can re-test (tomorrow perhaps) in SmoothSection on top of just #30413, to see if this PR actually makes a difference. |
|
The general theme is: I have a function |
|
Ah, okay, I think I see...does this mean we want to head-beta-reduce |
|
This PR/issue depends on: |
This improves test output (and highlights that I may also want eta-reduction). Add tests specifically for that.
220e6a6 to
e5035cc
Compare
|
I just tested with the current state of this PR: all the need for dsimp is gone; it seems head-beta reducing |
This reverts commit e8de60f.
T% elaboratorT% elaborator
|
Thanks for the careful review, yet again. I've revamped the PR title and PR description - this is ready for another look. |
|
Awesome! Looks ready to me! :) maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by thorimur. |
|
This PR currently makes the change that Changes needed:
|
The only change this PR actually makes to this example is a parsing change: I don't think it's been the case (yet!) that There could be a separate point here about enforcing parentheses—maybe we expect If you think this explanation is reasonable, I'd still recommend merging as-is, but I'll refrain from over-eagerly modifying labels here while still in conversation. 😁 |
|
I have reverted the precendence change from this PR: indeed, this should arguably be a separate PR. This PR is only about applying head-beta reduction. I have also updated the tests accordingly. I believe this addresses all your comments, Floris. |
|
Ok, this change seems fine by itself, so let's merge it. The reason I asked for head-beta reducing the whole application, is because that is how I interpret this sentence of the PR description:
But sure, let's do that in a later PR if desired. bors merge |
Whenever the `T%` elaborator succeeds, head beta reduce the resulting application. This enables applying it with anonymous functions or inside big operators without issue. (For instance, all changes to `SmoothSection` in #30357 are now possible without additional `dsimp` steps.) In the process, also extract the workhorse component of the elaborator into an independent function and improve its doc-string to mention the corresponding tracing option. Co-authored-by: thorimur <thomasmurrills@gmail.com> Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>
|
Pull request successfully merged into master. Build succeeded: |
T% elaboratorT% elaborator
Whenever the
T%elaborator succeeds, head beta reduce the resulting application.This enables applying it with anonymous functions or inside big operators without issue.
(For instance, all changes to
SmoothSectionin #30357 are now possible without additionaldsimpsteps.)In the process, also extract the workhorse component of the elaborator into an independent function
and improve its doc-string to mention the corresponding tracing option.