New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More search options #8855
More search options #8855
Conversation
7d4d765
to
fac009a
Compare
fac009a
to
025d774
Compare
Looks very interesting. I don't have time to dive into the implementation, hence some doc would be helpful. |
The list notation is to indicate a disjunction. We could also adopt the convention that several |
I'm sorry but at least for Don't get me wrong, I think being able to query the type classes or coercions db via Search is a very good feature and can probably subsume stuff like |
A typical query would be But, of course, it all depends on what kind of arguments would be the most interesting to give to I implemented only a subset of |
If this eventually subsumes the features provided by SSR's Search and everyone is satisfied by the new search language, delete it (or at least deprecate it). Search should not be left in finished proof scripts so there is no problem with removing it. |
Are you saying that writing I'm fine for I really think I need to see some doc, otherwise the discussion is not going to converge. |
Yes, I'm saying that, the way it is currently implemented, this gives different results. I'm not saying that this is the optimal decision to take. It is indeed probably more interesting to have a way to query what is declared as an instance, and maybe even to discriminate between different kinds of instance.
If you're waiting for a final product, then, you should indeed wait. If you want to continue to contribute to the discussion, e.g. by listing attributes one would like to discriminate, you are most welcome. |
A possible idea to address this would be to register searching keys and to add to @gares: You expressed a strong interest in this extension of |
Searching by the Coercion/Instance decl kinds may be more confusing than it's worth considering it won't find Existing Instance, record projections declared as coercions, etc. |
@SkySkimmer: I fully agree. If ever we want to search on the keyword of the command, it should a minima be, say |
It would make a lot of sense if the language of kinds to search was the same as the one of kinds to import, yes. |
I have no time for that, sorry |
But you do think that it would be worth to be done, right? |
Absolutely. I think the idea emerging here of exposing more metadata via search is great, but of course it needs to be exposed in a "faithful" way, e.g. abstract over the syntax used to attach the metadata to an object. |
OK, thanks for positive feedback. So, let's pile this on the list of wishes. I'll decide by a couple of weeks if I split the PR to keep at least |
@herbelin any news on this front? |
This should possibly also be profiled on something? I know |
025d774
to
8ab858a
Compare
The main use case of SearchHead is now handled by headconcl: The secondary use case was redundant with SearchPattern.
I'm using the |
But I also need to tweak the examples in the documentation because the output for the |
I'm sorry I could not help much here. I'll try to get feedback from math-comp people as soon as 8.12 is released, so that we can see if we can finally get rid of ssrsearch. Even reading the discussion again I can't say if it 100% subsumes the old code, I guess the best is to try it and see. |
@proux01 I've added a |
181cb27
to
9d8cd37
Compare
9d8cd37
to
ca00028
Compare
Maybe, I don't have a strong opinion. The new material is mostly useful for numeral notations but is not expected to be useful directly for most users, so that sounds reasonnable. Sorry for the inconvenience! |
Overlay for dpdgraph seems to need to be fixed? |
@herbelin Can you look into it? I could also take care of it but I don't know when I will find a minute to do it. |
After reading the discussion carefully I'm concerned about the deprecation plan for ssr's search; if I understand things correctly ssr users will be silently switched to the new search without a warning, IMO this is very confusing; Coq should instead use the old semantics for one release but warn users to import the module. Removal in the next release is IMO not factible, one extra release is needed so users can provide adequate feedback. |
That should be pretty easy to do as warning [as we did for example when we removed Funind from the Prelude] , so this PR doesn't need to wait for that; can be done as a separate, 8.12-only PR. |
Done |
What I can do is to add a warning to the default |
Yup, we can do this, but IMHO only in 8.12 , WDYT? |
Yes, good idea. Then I'll open an 8.12-only PR after the branch has been created. |
Ok, will merge then and open an issue. |
This is an alternative to coq#12537 which is closer to behavior in previous versions and may be safer for 8.12 than changing the kernel semantics on module includes. The updated search in coq#8855 introduced a way to filter by "command kinds", but, as explained by Hugo Herbelin, these kinds do not always exist, so a `Not_found` exception was breaking `Search`. We now handle the exception properly, no kind-free queries should work as in 8.11. Fixes coq#12525 coq#12647
This is an alternative to coq#12537 which is closer to behavior in previous versions and may be safer for 8.12 than changing the kernel semantics on module includes. The updated search in coq#8855 introduced a way to filter by "command kinds", but, as explained by Hugo Herbelin, these kinds do not always exist, so a `Not_found` exception was breaking `Search`. We now handle the exception properly, no kind-free queries should work as in 8.11. Fixes coq#12525 coq#12647
Kind: feature
This is a proposal to extend the search mechanism with the following modifiers:
hyp:notation_string
,hyp:pattern
to restrict the search in the hypotheses of the statementconcl:notation_string
,concl:pattern
to restrict the search in the conclusion of the statement (this is a bit stronger thanSearchHead
as the pattern can occur in any position of the conclusion, not only in head position; so, this is like ssreflect "head" search)is:Instance
,is:Coercion
,is:Conjecture
,is:Example
,is:[Instance Coercion]
, etc. to restrict the search to object of the given kind (or kinds, if a list)Example:
This should address #8663 but this should eventually also pave the way towards more fine-tunable search drivable from Graphical User Interfaces.
Suggestions, new ideas welcome.
With respect to ssreflect's Search, I made only the minimal changes so that it compiles. What to do?
Polishing and documentation to be done after first feedback.
Overlays: