Repository navigation
[Merged by Bors] - feat: better name guessing for to_additive - #779
Closed
fpvandoorn wants to merge 6 commits into
Closed
fpvandoorn wants to merge 6 commits into
fpvandoorn wants to merge 6 commits into
Conversation
kim-em
reviewed
Nov 29, 2022
kim-em
reviewed
Nov 29, 2022
Contributor
|
bors merge |
bors Bot
pushed a commit
that referenced
this pull request
Nov 29, 2022
* `@[to_additive]` will now correctly guess names with `CoeTC`, `CoeT` and `CoeHTCT` in it * rewrite function `targetName`. - It will now warn the user if it gives a composite name that can be auto-generated (before `to_additive` would never warn if a composite name was given). - the logic when `allowAutoName = true` now corresponds to the docstring - Fix a bug where declarations were silently allowed to translate to itself (maybe because the `return` statements returned a value for the whole function?) - Add some more tracing - The behavior of namespaces when giving a composite name has been changed. It will always generate a name with the same number of components. Example: ```lean namespace MeasureTheory.MulMeasure @[to_additive AddMeasure.myOperation] def myOperation := ... -- before: generates `AddMeasure.myOperation` (and never gives a warning) -- after: generates `MeasureTheory.AddMeasure.myOperation` (and probably warns that the name can be auto-generated) end MeasureTheory.MulMeasure ``` * This should fix all problems in #659 other than #660 Minor changes: * When applying `@[to_additive]` to a structure, add a trace message if no translation is inserted for a field. * Define `Name.fromComponents` and `Name.splitAt` * Reduce transitive imports of `Tactic/toAdditive` * Move some auxiliary declarations from `Tactic/Simps` to more appropriate places - swap arguments of `String.isPrefixOf?` - improve `Name.getString` Co-authored-by: Scott Morrison <[email protected]>
commented
Nov 29, 2022
|
Build failed: |
commented
Nov 29, 2022
Contributor
|
bors merge |
commented
Nov 29, 2022
|
Build failed: |
commented
Nov 29, 2022
Contributor
|
bors merge |
commented
Nov 29, 2022
|
Pull request successfully merged into master. Build succeeded: |
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.
@[to_additive]will now correctly guess names withCoeTC,CoeTandCoeHTCTin ittargetName.to_additivewould never warn if a composite name was given).allowAutoName = truenow corresponds to the docstringreturnstatements returned a value for the whole function?)to_additiveunable to translatetoOneHomClass#660Minor changes:
@[to_additive]to a structure, add a trace message if no translation is inserted for a field.Name.fromComponentsandName.splitAtTactic/toAdditiveTactic/Simpsto more appropriate placesString.isPrefixOf?Name.getString