Skip to content
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

[sertop] Add sername program for serialization of terms #207

Merged
merged 14 commits into from
Jun 2, 2020

Conversation

palmskog
Copy link
Collaborator

@palmskog palmskog commented May 28, 2020

This targets the v8.10 branch and is intended for inclusion in the 0.7.1 release of SerAPI for Coq 8.10. The sername program is used by our Roosterize toolchain for suggesting Coq lemma names. The sername program will be forward-ported to the v8.11 branch after the Roosterize toolchain is released.

cc: @pengyunie

@palmskog
Copy link
Collaborator Author

palmskog commented May 28, 2020

Note that compilation of the v8.10 branch with sexplib 0.13.0 and dune 2.5.1 currently gives errors like the following:

File "serapi/serapi_protocol.mli", line 293, characters 23-32:
Error (warning 3): deprecated: Sexplib.Conv.sexp_list
[since 2019-03] use [@sexp.list] instead

... unless one compiles with dune build --profile=release. @ejgallego is this something you want to address before the 0.7.1 release or can we just go ahead and release after merging this PR?

@ejgallego ejgallego self-assigned this May 28, 2020
@ejgallego
Copy link
Collaborator

ejgallego commented May 28, 2020

@ejgallego is this something you want to address before the 0.7.1 release or can we just go ahead and release after merging this PR?

I'm aware of this problem, and some other problems that newer toolchains do introduce. Not sure what we should do here. I'd like to avoid an upper constraint if necessary.

@ejgallego
Copy link
Collaborator

@palmskog , how does this relate to #174

@palmskog
Copy link
Collaborator Author

palmskog commented May 28, 2020

@palmskog , how does this relate to #174

It's not directly related, but both fit into an overall plan on learning and suggesting code conventions for Coq. The work on lemma name suggestions (primary use of sername) doesn't use tactic or proof state serialization at all.

However, the extended abstract recently accepted at the Coq workshop looks at suggesting spacing, which does use tactic/proof data for learning, but does not use sername at all.

@ejgallego
Copy link
Collaborator

I see, thanks for the explanation, adjust #174 plans as you think then; I will prepare a release shortly [actually for both v8.11 and v8.10]

@palmskog
Copy link
Collaborator Author

I see, thanks for the explanation, adjust #174 plans as you think then; I will prepare a release shortly [actually for both v8.11 and v8.10]

Ah, so you think you can forward port to v8.11 easily? That would be great. Let me know if I can help in some way, e.g., writing release notes.

@ejgallego
Copy link
Collaborator

ejgallego commented May 28, 2020

Ah, so you think you can forward port to v8.11 easily? That would be great. Let me know if I can help in some way, e.g., writing release notes.

I can give the forward porting a go myself; I don't expect any particular trouble. I will do 8.10 first, then 8.11

sdoc
*)
let doc,sid = Stm.new_doc ndoc in
let sent = Printf.sprintf "Require %s." l in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you not adding this to require_libs above?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mention a problem in the commit, but with no further details given it is hard to say more.

Copy link
Collaborator

@ejgallego ejgallego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like the way this PR is going; the batch tools are meant to process files, we cannot affort to add a binary for every possible query system.

For this use case, there is little improvement of this solution vs using the standard query protocol from sertop.

I understand the current query system is not featureful enough as to support this use case, see #155 and #196 for example, but I'm working on fixing those right now.

This is thus a tool that in principle, I'm not willing to support in future releases [I'm very open to be convinced to do so tho] .

Instead, improved printing options will be added so sertop can do what sername does using the query language.

For the 0.7 branch; I'm OK merging this PR, as long as the tool documentation states that this tool won't be available in future releases and sertop must be used.

What do you think @palmskog ? Am I off in my point of view?

@ejgallego ejgallego added this to the 0.7.2 milestone May 29, 2020
1.4 is required for fmt 1.0
@ejgallego
Copy link
Collaborator

Pushed a fix for Travis and warning on newer sexplib, let's see how it goes.

This should fix Travis on newer sexplib, and still keep compat with
0.12.

We also fix Coq's Travis install [wrong version picked for this branch]
@palmskog
Copy link
Collaborator Author

For the 0.7 branch; I'm OK merging this PR, as long as the tool documentation states that this tool won't be available in future releases and sertop must be used.

This is fine by me. Do you want the statement about future releases in sername --help or in the release notes? You can let me know or just add it for yourself.

As for the require_libs code comment, if we don't keep sername in future versions, maybe we can just leave that code as is? There was a very specific use case that motivated that change which I may have to dig quite a lot to find.

@ejgallego
Copy link
Collaborator

ejgallego commented May 29, 2020

This is fine by me. Do you want the statement about future releases in sername --help or in the release notes? You can let me know or just add it for yourself.

Thanks @palmskog , I can add a small note myself.

As for the require_libs code comment, if we don't keep sername in future versions, maybe we can just leave that code as is? There was a very specific use case that motivated that change which I may have to dig quite a lot to find.

That's fine then.

Something it would be very useful to have tho is a small test case that covers all the things this tool does; this way we can be sure Query name does support the required functionality if we deprecated sername

@ejgallego
Copy link
Collaborator

Thinking a bit about it, I propose we mark sername deprecated in 8.11/8.12 once can be done with Query, but don't remove it, at least until it becomes a problem for maintenance.

@ejgallego
Copy link
Collaborator

This is also perfectly fine with me. However, unless I'm missing something, I think the main obstacle to turning sername into a simple query separate from Coq's API is the use of detyping here. Would this best be solved by adding another query function?

See ejgallego/coq-lsp#331 and #196 , they request precisely that.

@ejgallego ejgallego modified the milestones: 0.7.2, 0.7.1 Jun 2, 2020
@ejgallego
Copy link
Collaborator

ejgallego commented Jun 2, 2020

@palmskog this is ready IMO, can you have a look to the two latest commits?

Maybe I do push a few tweaks to ease forward-porting, but no code changes themselves.

@palmskog
Copy link
Collaborator Author

palmskog commented Jun 2, 2020

@ejgallego the last two commits look good to me.

@ejgallego ejgallego merged commit d424aef into v8.10 Jun 2, 2020
@ejgallego ejgallego deleted the v8.10+sername branch June 2, 2020 14:04
ejgallego added a commit to ejgallego/opam-repository that referenced this pull request Jun 2, 2020
CHANGES:

* [sertop ] Add `sername` program for batch serialization elaborated terms
             Note that this utility will be deprecated in future versions,
             to be subsumed by `Query`.
             (rocq-archive/coq-serapi#207, @palmskog, with help from @ejgallego)
 * [serlib ] Expose `QueryUtil.info_of_id` and `gen_pp_obj` in `serapi_protocol.mli` to enable
             using them in `sername` to retrieve serialized body-type pairs (@palmskog)
 * [general] Improved compat with Jane Street v0.13 toolchain
 * [serlib ] Only use `ssreflect` from Coq in tests (@ejgallego)
ejgallego added a commit to ejgallego/opam-repository that referenced this pull request Jun 2, 2020
CHANGES:

* [sertop ] Add `sername` program for batch serialization elaborated terms
             Note that this utility will be deprecated in future versions,
             to be subsumed by `Query`.
             (rocq-archive/coq-serapi#207, @palmskog, with help from @ejgallego)
 * [serlib ] Expose `QueryUtil.info_of_id` and `gen_pp_obj` in `serapi_protocol.mli` to enable
             using them in `sername` to retrieve serialized body-type pairs (@palmskog)
 * [general] Improved compat with Jane Street v0.13 toolchain
 * [serlib ] Only use `ssreflect` from Coq in tests (@ejgallego)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants