Wingman recursion performance bug #2011
Labels
component: wingman
performance
Issues about memory consumption, responsiveness, etc.
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Uh oh!
There was an error while loading. Please reload this page.
I'm new to haskell-language-server and wanted to stare at some code before trying to write some myself to get used to the patterns. While staring, I noticed that the current (operational) behavior of
peek
as defined here is a bit suspect.Notably, it seems like it would often use the continuation non-linearly.
My current understanding is that monadic binds for Tactic and Rule are basically substituting of subgoals and extracts respectively with new ProofStates . So if peek is used like
this uses substitution over subgoals and reduces roughly like
The important bit is that
f ((), j)
occurs twice so everything after peek will be executed twice. Nested peek continuations would be exponential, but onlyrecursion
currently uses it.The direct solution is to use
Axiom
as cut:Though this means changes to monadic state in peek are forgotten, which is probably fine. Alternatively something like this might be more intuitive? I'm not sure.
To validate manually this hack works for me:
I haven't figured out how the tests infrastructure works, yet, so I am not sure how to turn this into a sensible test case.
Also, Wingman is really cool!
The text was updated successfully, but these errors were encountered: