I'm trying to accomplish the following with https://github.com/ejgallego/coq-serapi
For 1. I was thinking (Query () (Vernac "Print All."))
and for 2. I was thinking of checking if the output of Print All. starts with a *** [
.
Hi @Thomas Dziedzic , note that we have a dedicated SerAPI stream in case you want to move the discussion there [more people will see it]
@Emilio Jesús Gallego Arias I didn't know that, I will move the topic to that stream!
Actually the next version will provide native support for your use case 1. , for now you have to do that a bit more manually, that is to say, you need to grab all (Query ((sid $stm)) Ast)
and select the ones that are theorems. Current implementation of SerAPI uses the flag document model that Coq understands natively, but as I said, based on numerous feedback we are changing this to a more structured represeantion
For 2, once you got the name of the theorem, you have an Assumptions
query
so that should work for you fine!
I think the syntax is (Query ((sid $sid)) (Assumptions thm_name))
note that in Query
This topic was moved here from #Coq users > serapi usage: getting theorems in a project by Théo Zimmermann
the sid parameter means what "state" you want to query
the sid parameter means what state you want to run the query
so usually, for full completed documents you want to use the sentence pointing to the end of the document
Actually the next version will provide native support for your use case 1.
Do you know when the next version will come out? Will I have to wait a couple of days? Or will it be months?
also I just realized you're the creator of serapi, thanks for your hard work @Emilio Jesús Gallego Arias
Thomas Dziedzic said:
Actually the next version will provide native support for your use case 1.
Do you know when the next version will come out? Will I have to wait a couple of days? Or will it be months?
You are most welcome, thanks to you for your feedback; I think the next version should be out by end of Feb, in the most optimistic planning
I hope to have a couple of hacking sessions related to SerAPI in the 2022 Winter WG https://github.com/coq/coq/wiki/CoqWG-2022-02
@Thomas Dziedzic there is some functionality in the direction you want in the dpdgraph plugin: https://github.com/coq-community/coq-dpdgraph/
For example, it's very easy to get a list of lemmas in some module/file, and get their dependencies. No easy way to tell if something is an axiom though.
the difference from SerAPI is that as a plugin, dpdgraph adds some commands inside Coq, rather than allowing low-level communication with Coq. So it can be combined with SerAPI.
Actually doing that in OCaml is very easy so if you wanna cook a patch we could merge itn ow
it now
what I plan is something more comprehensive
The first prototype of coq-lsp already did that to provide the document outline
hmm, but did it [coq-lsp] really figure out axioms? How is that even done?
The axioms code is already on serapi
coq lsp parsed the document and generated the list of objects, including lemmas
then it checked the document using prefix-only incrementality
this is easy with the API we pushed to Coq these days
axioms you just use the API provide in Coq
Last updated: May 31 2023 at 04:01 UTC