feat: shorten auto-generated instance names#3089
Merged
kmill merged 12 commits intoleanprover:masterfrom Apr 13, 2024
Merged
Conversation
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 18, 2023
|
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 18, 2023
81dc5db to
e8d2d8d
Compare
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 20, 2023
1 task
4948bef to
627b0d5
Compare
Collaborator
|
I've rebased this onto |
9753d39 to
8db32f0
Compare
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 31, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 2, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 3, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 3, 2024
Collaborator
|
Master seems to be broken, I think due to test changes from this PR |
Collaborator
Author
|
Fascinating, it was triggered by the stage0 update. Fixing the tests... |
Kha
pushed a commit
that referenced
this pull request
Apr 17, 2024
#3089 caused the stage0 update to cause a number of tests to start failing because they were using the old instance names.
This file contains hidden or 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
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.
Implements a new method to generate instance names for anonymous instances that uses a heuristic that tends to produce shorter names. A design goal is to make them relatively unique within projects and definitely unique across projects, while also using accessible names so that they can be referred to as needed, both in Lean code and in discussions.
The new method also takes into account binders provided to the instance, and it adds project-based suffixes. Despite this, a median new name is 73% its original auto-generated length. (Compare: old generated names and new generated names.)
Some notes:
variable. It does not make use ofvariables since, when names are generated, it is not yet known which variables are used in the body of the instance.set_option trace.Elab.instance.mkInstanceName truecan be used to see what name the auto-generator would give, even if the instance already has an explicit name.There were a number of instances that were referred to explicitly in meta code, and these have been given explicit names.
Removes the unused
Lean.Elab.mkFreshInstanceNamealong with the Command state'snextInstIdx.Fixes #2343