-
Notifications
You must be signed in to change notification settings - Fork 441
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: stack overflow at mkBinding
if type occurs check fails
#6079
Conversation
mkBinding
if type occurs check fails.mkBinding
if type occurs check fails
Mathlib CI status (docs):
|
@JovanGerb could you confirm that #6105 has resolved this? |
@JovanGerb I am concerned about this PR. We want to avoid cyclic dependencies in the metavariable assignment. This PR goes in a different direction: let's tolerate cycles. For example, in #3150, we were adding an assignment without performing the occurs check. This PR would "mask" the real problem. |
That makes sense. In the PR that introduced the type occurs check, commit 72e5528 defines |
#6104 does that, but unfortunately it breaks a test. The test comes from a real repo:
I will discuss with the author whether the change is reasonable or not. |
Looking at that breaking test, I think this may be fixed with the change I suggested in the last comment on #6013. The particular cyclic metavariables occurrence is in the value of a let-expression where the bound variable doesn't appear in the body. So modifying lean4/src/Lean/MetavarContext.lean Lines 1074 to 1084 in 9f42368
so that it only creates the let if there is a bound variable may help. |
Closing, with an alternative solution at #6128. |
This PR fixes a stackoverflow bug in
mkBinding
caused by metavariables appearing in their own type.Closes #6013
Closes #3150 edit: this has been closed