Skip to content

[Merged by Bors] - feat: improve ToAdditive.guessName to work with capitalisation - #579

Closed
joneugster wants to merge 21 commits into
masterfrom
eugster-to_additive
Closed

joneugster wants to merge 21 commits into
masterfrom
eugster-to_additive

Conversation

@joneugster

@joneugster joneugster commented Nov 12, 2022 •

Copy link
Copy Markdown
Member

This is a suggestion for to_additive to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

@joneugster joneugster changed the title feat(Tactic/ToAdditive): rewrite to_additive to new naming convention. feat(Tactic/ToAdditive): improve ToAdditive.guessName to guess capitalisation Nov 12, 2022
@joneugster joneugster changed the title feat(Tactic/ToAdditive): improve ToAdditive.guessName to guess capitalisation feat(Tactic/ToAdditive): improve ToAdditive.guessName to work with capitalisation Nov 12, 2022
@digama0 digama0 changed the title feat(Tactic/ToAdditive): improve ToAdditive.guessName to work with capitalisation feat: improve ToAdditive.guessName to work with capitalisation Nov 12, 2022
@digama0

digama0 commented Nov 12, 2022 •

Copy link
Copy Markdown
Member

Can you add test cases to the test file?

Regarding performance, I can't imagine there is anything you can do here which would have unacceptable performance. It is only run once per declaration and it's a tiny input so it shouldn't be a problem.

@kim-em kim-em added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. and removed awaiting-review labels Nov 14, 2022
@joneugster joneugster added awaiting-review and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Nov 14, 2022
@joneugster

Copy link
Copy Markdown
Member Author

Done that :)

Comment thread Mathlib/Algebra/Group/Defs.lean Resolved
Comment thread Mathlib/Tactic/ToAdditive.lean Resolved
@kim-em

kim-em commented Nov 17, 2022

Copy link
Copy Markdown
Contributor

I made a few further changes. If you happy, please go ahead and merge.

bors d+

@bors

bors Bot commented Nov 17, 2022

Copy link
Copy Markdown

✌️ joneugster can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@kim-em kim-em added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Nov 17, 2022
@joneugster

joneugster commented Nov 17, 2022 •

Copy link
Copy Markdown
Member Author

Thanks @semorrison ! I made a few more minor changes, all fixes to the test cases.
(edit: not sure if that means I can't bors r+ anymore or if it normal for bors to take 10min+ to respond...)

@joneugster

Copy link
Copy Markdown
Member Author

bors r+

@joneugster

Copy link
Copy Markdown
Member Author

bors ping

@bors

bors Bot commented Nov 17, 2022

Copy link
Copy Markdown

pong

@joneugster

Copy link
Copy Markdown
Member Author

bors r+

bors Bot pushed a commit that referenced this pull request Nov 17, 2022
This is a suggestion for `to_additive` to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

Co-authored-by: Jon Eugster <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Jon Eugster <[email protected]>
Comment thread test/toAdditive.lean Resolved
Co-authored-by: Mario Carneiro <[email protected]>
@bors

bors Bot commented Nov 17, 2022

Copy link
Copy Markdown

Canceled.

@joneugster

joneugster commented Nov 17, 2022 •

Copy link
Copy Markdown
Member Author

I hope it's okay if I merge now with your comments integrated @digama0 . Please cancel if not!

bors r+

bors Bot pushed a commit that referenced this pull request Nov 17, 2022
This is a suggestion for `to_additive` to parse names in the new naming conventions.

It does keep capitalised abbreviations like "LE" together but it would not split a single capitalised char off.
E.g. "OneCommMonoidLEHMul_one_lt_Conj₂Pow" becomes "ZeroAddCommMonoidLEHAdd_pos_Conj₂Nsmul"

Co-authored-by: Jon Eugster <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Jon Eugster <[email protected]>
@bors

bors Bot commented Nov 17, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title feat: improve ToAdditive.guessName to work with capitalisation [Merged by Bors] - feat: improve ToAdditive.guessName to work with capitalisation Nov 17, 2022
@bors bors Bot closed this Nov 17, 2022
@bors
bors Bot deleted the eugster-to_additive branch November 17, 2022 14:54
bors Bot pushed a commit that referenced this pull request Nov 28, 2022
- [x] depends on: #579 

Mathlib SHA: 17a9f8f7a4ef32ee65d418103367cf30e84e631d

Done with the reviews. This should hopefully now be ready to merge.

Co-authored-by: Jon <[email protected]>
Co-authored-by: Jon Eugster <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants