Zulip Chat Archive
Stream: metaprogramming / tactics
Topic: superfluous proof_1 items in docgen
Tony Beta Lambda (Oct 15 2024 at 09:20):
There are many "blah.proof_1" items in the mathlib doc, such as this one. I believe they are generated by to_additive
. I consider this a bug since apparently these come from conGen.proof_1
during the to_additive
translation process, but conGen.proof_1
itself is hidden in the docs. Can someone fix it?
Floris van Doorn (Oct 15 2024 at 10:00):
@Henrik Böving I think this would be fixed by using docs#Lean.Name.isBlackListed instead of DocGen4.Process.DocInfo.isBlackListed
.
Floris van Doorn (Oct 15 2024 at 10:06):
(or by running Lean.Name.isBlackListed
after a successful findDeclarationRanges?
if that's also something you need to test for)
Floris van Doorn (Oct 15 2024 at 10:26):
I could also independently avoid giving these auxiliary declarations declaration ranges, if you think that's better. Presumably that is how conGen.proof_1
is filtered out?
Henrik Böving (Oct 15 2024 at 11:11):
The implementations of those two functions look almost the same?
Henrik Böving (Oct 15 2024 at 11:11):
given that they were both copied from the LSP that is to be expected
Henrik Böving (Oct 15 2024 at 11:13):
Yeah I don't see how using that function would fix anything. Besides the fact that its in mathlib so it would have to be copied over yet again.
Tony Beta Lambda (Oct 16 2024 at 05:49):
Floris van Doorn said:
I could also independently avoid giving these auxiliary declarations declaration ranges, if you think that's better. Presumably that is how
conGen.proof_1
is filtered out?
Yes, I think that's how they are filtered out. It might make sense to set the declaration range of translated declarations to none
whenever the original declaration has none?
Floris van Doorn (Oct 16 2024 at 12:17):
Henrik Böving said:
The implementations of those two functions look almost the same?
Lean.Name.isBlackListed
uses docs#Lean.Name.isInternalDetail which precisely filters out the proofs we're talking about here. The latter is in core, so maybe you can just modify your version to include that check?
Floris van Doorn (Oct 16 2024 at 12:18):
Tony Beta Lambda said:
Yes, I think that's how they are filtered out. It might make sense to set the declaration range of translated declarations to
none
whenever the original declaration has none?
I have to double check whether declaration ranges are added before attribute application. If so, that should be easy to do.
Henrik Böving (Oct 16 2024 at 12:38):
Fixed
Last updated: May 02 2025 at 03:31 UTC