For many months, PG showed warnings that SearchAbout
is deprecated and one should use Search
instead. PG changed to accommodate this, only to immediately run into a new warning:
Warning: SSReflect's Search command has been moved to the ssrsearch module; please Require
that module if you still want to use SSReflect's Search command [ssr-search-moved,deprecated]
Looks like search commands are being deprecated faster than tools can keep up :joy: .
So what is the command one should use instead? What is "the best search command" in latest Coq right now? The error tells me how I can keep using the deprecated Search
, but it does not tell me what the non-deprecated alternative is...
This deprecation message was added so that users of SSR Search are not surprised by the change of behavior. It's not entirely satisfying. There is nothing you need to do, except probably disable that warning.
If this command is used through PG instead of SearchAbout
, then I think PG maintainers themselves should disable that warning.
So there are two Search
, one in ssreflect and one in main Coq? What is the difference between the two? Is there some way I can already opt to use the "new default" now so I can give feedback if it works well enough?
You are already (by default) using the new default. This warning is just to make you aware of this. If you were previously using SearchAbout
, it is a strict extension.
I suggest having a look at the documentation to learn more about the new features.
https://coq.inria.fr/refman/proof-engine/vernacular-commands.html#coq:cmd.search
Changelog entry: https://coq.inria.fr/refman/changes.html#search
And: https://coq.inria.fr/refman/changes.html#ssrsearch
thanks for the pointers!
Théo Zimmermann said:
If this command is used through PG instead of
SearchAbout
, then I think PG maintainers themselves should disable that warning.
Why would PG remove the warning? We don't want to use the deprecated SearchAbout, and if coq devs think the warning is useful I don't think we should hide it.
What is the new ssreflect search command? Is there a shortcut or menu for it in PG currently?
PG used to call SearchAbout
which was a deprecated variant of Search
. But SearchAbout
was useful because when users loaded SSR, SearchAbout
was the way to keep using the normal Search
command instead of SSR's Search
command.
There is no new ssreflect search command. On the contrary, we want to get rid of it. Starting in 8.12, it is deprecated and buried in a separate plugin that you have to load separately.
However, some developers thought it was important to warn SSR users using Search
that they were now using the default search unless they loaded the new ssrsearch
plugin. This is the reason of the warning.
If the Search
command is used as a replacement of SearchAbout
, then there is no reason to raise this warning.
But honestly, I think that introducing this warning was a mistake in the first place because it just brought a lot of confusion.
Théo Zimmermann said:
But honestly, I think that introducing this warning was a mistake in the first place because it just brought a lot of confusion.
I would disagree on that one. When I upgraded to 8.12, this warning probably saved me quite a bit of time/confusion, because I had been using the Ssreflect search command for a long time, frequently with the in
restriction (which is now inside
).
I find the new search command to be a definite improvement, even though I'm a bit annoyed that the new search doesn't automatically insert the necessary coercions to make the pattern a type when using headconcl:
. That is, one has to search for headconcl:(is_true (_ <= _))
rather than headconcl:(_ <= _)
to get the expected results.
@Christian Doczkal Thanks a lot for the feedback. That's the first positive feedback I get for the warning. Also, would you mind opening an issue about the automatic coercion insertion? This could be an oversight.
@Théo Zimmermann I opened a new issue
Théo Zimmermann said:
But honestly, I think that introducing this warning was a mistake in the first place because it just brought a lot of confusion.
I think the warning could have been worded more clearly, to explicitly say:
Search
before, behavior now changedSearchAbout
before, now Search
behaves the same as SearchAbout
did beforeFrom the warning it was not entirely clear to me if it was telling me behavior will change in the future or has changed recently.
but on top of that my problem here was that I did not even know which command PG was using for me
In 8.13 the warning will be removed. But we could improve the wording in 8.12.1 which is about to be released. WDYT?
Théo Zimmermann said:
In 8.13 the warning will be removed. But we could improve the wording in 8.12.1 which is about to be released. WDYT?
I'm happy to give feedback to a proposed wording, or propose a wording.
If you open the PR, it's the best way to ensure that it will happen! The text to change is in plugins/ssr/ssrvernac.mlg
. You may want to make the PR on the v8.12
branch only, since master
already has coq/coq#13231 that removes the warning.
that's way more effort as I need a setup to be able to build-test things... not sure when I'll be able to make time for that
unless you're fine with me just submitting a PR I didnt even try to build
+1, that’s what CI is for
this has been explicitly encouraged for documentation, and I think that applies to error messages.
Here's a strawman proposal: https://github.com/coq/coq/pull/13257
I didn't know what to do with these checkboxes ;) they do not apply here I think? I hope?^^
That's right, they only make sense for bigger changes. You can ignore them.
Ralf Jung said:
unless you're fine with me just submitting a PR I didnt even try to build
Yep, this is always fine!
Last updated: Dec 05 2023 at 11:01 UTC