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
[Merged by Bors] - fix(frontends/lean/elaborator): don't block on metavariables that depend on an out_param
#657
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…end on an `out_param` We noticed in mathlib#11128 some cases where parameters weren't being inferred, even though they were `out_param`s to an instance: it turned out the instances themselves also weren't being inferred by the elaborator. This PR tweaks the logic in `elaborator::ready_to_synthesize` to match the `out_param` handling in `type_context_old::preprocess_class`. I created a new function that determines the list of parameters that are either an `out_param` themselves, or depend on an `out_param`. The code is a bit different since `preprocess_class` updates the expression during the check. I left the previous check of `preprocess_class` in an `assert` so we can be sure the results are the same. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Instance.20parameters.20depending.20on.20.60out_params.60
Closed
1 task
gebner
reviewed
Jan 3, 2022
gebner
reviewed
Jan 3, 2022
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Jan 4, 2022
…end on an `out_param` (#657) We noticed in [mathlib#11128](leanprover-community/mathlib#11128) some cases where parameters weren't being inferred, even though they were `out_param`s to an instance: it turned out the instances themselves also weren't being inferred by the elaborator. This PR tweaks the logic in `elaborator::ready_to_synthesize` to match the `out_param` handling in `type_context_old::preprocess_class`. I created a new function that determines the list of parameters that are either an `out_param` themselves, or depend on an `out_param`. The code is a bit different since `preprocess_class` updates the expression during the check. I left the previous check of `preprocess_class` in an `assert` so we can be sure the results are the same. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Instance.20parameters.20depending.20on.20.60out_params.60 Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
Pull request successfully merged into master. Build succeeded: |
bors
bot
changed the title
fix(frontends/lean/elaborator): don't block on metavariables that depend on an
[Merged by Bors] - fix(frontends/lean/elaborator): don't block on metavariables that depend on an Jan 4, 2022
out_param
out_param
Vierkantor
added a commit
that referenced
this pull request
Jan 4, 2022
Vierkantor
added a commit
that referenced
this pull request
Jan 5, 2022
This ensures non-`out_param`s are not accidentally filled through unification with the temporary metavariables. `out_param`s are still allowed to contain metavariables that will be unified (see also #657). I moved the `ready_to_synthesize` check from the elaborator to the type context in order to access it from the simplifier. Co-Authored-By: Gabriel Ebner <gebner@gebner.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We noticed in mathlib#11128 some cases where parameters weren't being inferred, even though they were
out_param
s to an instance: it turned out the instances themselves also weren't being inferred by the elaborator. This PR tweaks the logic inelaborator::ready_to_synthesize
to match theout_param
handling intype_context_old::preprocess_class
.I created a new function that determines the list of parameters that are either an
out_param
themselves, or depend on anout_param
. The code is a bit different sincepreprocess_class
updates the expression during the check. I left the previous check ofpreprocess_class
in anassert
so we can be sure the results are the same.Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Instance.20parameters.20depending.20on.20.60out_params.60