Skip to content

feat: new alias command#200

Merged
digama0 merged 40 commits intoleanprover-community:mainfrom
fgdorais:alias
Aug 22, 2023
Merged

feat: new alias command#200
digama0 merged 40 commits intoleanprover-community:mainfrom
fgdorais:alias

Conversation

@fgdorais
Copy link
Copy Markdown
Collaborator

@fgdorais fgdorais commented Jul 25, 2023

Implementation of the revised alias command discussed on Zulip.

Supersedes #184

@fgdorais fgdorais marked this pull request as draft July 25, 2023 13:28
@fgdorais fgdorais mentioned this pull request Jul 25, 2023
1 task
@digama0
Copy link
Copy Markdown
Member

digama0 commented Jul 25, 2023

I think you should rebase this on top of #184's commits, so it is easier to review what changed and ensure that modifications from that PR are reflected here (which does seem to be the case)

@fgdorais fgdorais marked this pull request as ready for review July 26, 2023 11:08
@fgdorais
Copy link
Copy Markdown
Collaborator Author

The original Mathlib alias had a comment to add an alias attribute. I'm not sure what that attribute was intended to do other than "I'm an alias of". I think even that basic functionality makes some sense but is it needed?

@digama0
Copy link
Copy Markdown
Member

digama0 commented Jul 28, 2023

The attribute was intended to be usable so that third party code could programmatically determine that a declaration is an alias of another.

@fgdorais
Copy link
Copy Markdown
Collaborator Author

Should that be implemented as an attribute or as an environment extension? I'm thinking the latter since I don't see much need for @[alias ...].

@urkud
Copy link
Copy Markdown
Member

urkud commented Jul 31, 2023

Does it support protected?

@fgdorais
Copy link
Copy Markdown
Collaborator Author

Yes, it supports all modifiers and attributes the same way as def and theorem do!

@alexjbest
Copy link
Copy Markdown
Member

Should that be implemented as an attribute or as an environment extension? I'm thinking the latter since I don't see much need for @[alias ...].

At some point I wrote a linter for duplicate lemmas and the attribute was useful as a way of skipping intentional duplicates. The interaction with to_additive was a little subtle here and it was important for that application that to_additive could copy the alias attribute to an additive version of an existing alias.

@fgdorais
Copy link
Copy Markdown
Collaborator Author

fgdorais commented Aug 8, 2023

That makes sense. I think the aliasExt environment extension would work fine for that. I added a small convenience API.

@kim-em kim-em added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review This PR is ready for review; the author thinks it is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants