-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: fixes for v4.14.0-rc1 #57
Conversation
When working on this, I ran into an issue where the tactics seem to be duplicated. For example:
I suspect this is related to leanprover/lean4#3106 , but I don't understand the code well enough to be sure. If you have pointers, I'm happy to try to fix it. |
Dug into this a bit more. Adding
(These are not, proof state 1 is repeated from proof state 0)
If we change this to:
the test passes (with the same adjustments in the expected output). |
I played around a bit and it seems applying this patch to Lean would be sufficient to restore the previous behavior: In
I'm not familiar enough with Lean's internals to know if the redundant proof states from |
The following patch should fix the underlying issue, could you test it? --- a/src/Lean/Elab/Frontend.lean
+++ b/src/Lean/Elab/Frontend.lean
@@ -102,7 +102,7 @@ partial def IO.processCommandsIncrementally (inputCtx : Parser.InputContext)
where
go initialSnap t commands :=
let snap := t.get
- let commands := commands.push snap.data.stx
+ let commands := commands.push snap.data
if let some next := snap.nextCmdSnap? then
go initialSnap next.task commands
else
@@ -111,13 +111,13 @@ where
let messages := toSnapshotTree initialSnap
|>.getAll.map (·.diagnostics.msgLog)
|>.foldl (· ++ ·) {}
- let trees := toSnapshotTree initialSnap
- |>.getAll.map (·.infoTree?) |>.filterMap id |>.toPArray'
+ let trees := commands.map (·.infoTree?) |>.filterMap id |>.toPArray'
return {
commandState := { snap.data.finishedSnap.get.cmdState with messages, infoState.trees := trees }
parserState := snap.data.parserState
cmdPos := snap.data.parserState.pos
- inputCtx, initialSnap, commands
+ commands := commands.map (·.stx)
+ inputCtx, initialSnap
} |
In all the examples I've looked at
|
I made some more changes to the REPL and have andrewmw94@52b0c28 which seems to mostly work except when two commands have the same start and end locations (as in the final command of the below):
Where we incorrectly deduplicate the second state for the |
My bad, could you try the above fix with this line instead?
|
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
…Trees Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Looks like that works (with a small change to the REPL). Thanks! |
Thanks for testing, addressed in leanprover/lean4#5763 |
I'll update this PR once leanprover/lean4#5763 is in nightly. I ran the tests locally with 4.12 + the patch above, and the only weird thing is |
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
Signed-off-by: Andrew Wells <andrewmw94@gmail.com>
I'm hoping to merge this on Monday once |
Bump toolchain to
4.12nightly-2024-10-21v4.14.0-rc1