-
Notifications
You must be signed in to change notification settings - Fork 465
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
fix: add instantiateMVars
to replaceLocalDecl
#2712
fix: add instantiateMVars
to replaceLocalDecl
#2712
Conversation
09a2ff9
to
80017dd
Compare
!bench |
Here are the benchmark results for commit 80017dd. |
WIP |
4ddc3bb
to
c95cf65
Compare
|
c95cf65
to
e56563d
Compare
awaiting-review |
However, if it encounters a metavariable during this traversal, it simply continues traversing, | ||
even if this metavariable is assigned to an expression which contains an `FVarId` occurring after | ||
`fvarId`. This can lead to `replaceLocalDecl` inserting a local declaration with a type which | ||
depends on `FVarId`s which come after it in the local context, thus creating unknown `FVarId`s (the | ||
`FVarId`s of the local declarations after the insertion are modified). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify that this is describing the previous behaviour (which would have caused this test to fail)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, done in fbc8de6.
e56563d
to
fbc8de6
Compare
External Contribution Guidelines.
First half of fixing #2711. (Second half is #2728.) Makes
replaceLocalDecl
more robust by inserting aninstantiateMVars
. It should now be less possible to introduce an unknown free variable byreplaceLocalDecl
alone. This affects manyat
tactics.However, this might not safeguard against all errors—in particular, mvars can still be synthesized to later-occurring fvars after the fact. See issue #2727.
This was benched on mathlib against nightly testing here. There didn't seem to be significant changes.
To find the relevant mathlib4 branches on speedcenter manually, search "2712" and compare the branch
bench-nightly-testing-for-2712
(baseline) tolean-pr-testing-2712
.Note: it took a while to get mathlib and std synced up to the current lean changes; the mathlib build failures were unrelated to this PR. This PR doesn't require any changes to mathlib or std.