Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Using SerAPI in a plugin

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Using SerAPI in a plugin


Chronological Thread 
  • From: Talia Ringer <tringer AT cs.washington.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Using SerAPI in a plugin
  • Date: Wed, 8 Sep 2021 16:15:29 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=tringer AT cs.washington.edu; spf=Pass smtp.mailfrom=tringer AT cs.washington.edu; spf=None smtp.helo=postmaster AT mx7.cs.washington.edu
  • Ironport-hdrordr: A9a23:sZI+JKnW3iEPQfsAe4vGZJtUohvpDfL03DAbv31ZSRFFG/Fw9vre58jzsCWftN9/YgBFpTntAtjkfZqYz+8W3WBzB9eftWvdyQ2VxehZhOOIrlHd8m/Fh41gPMxbAtFD4bPLfCBHZAXBjzWQIpIPxNGG9eSPnufRz3BkSEVPZ7t75wl0Tia3e3cGIzWuyaBWKHNU3Kt6mwY=
  • Ironport-phdr: A9a23:WlhXuRKYg2o/Dc6+29mcuMVmWUAX0o4c3iYr45Yqw4hDbr6kt8y7ehCFvbM81RSUAs3y0LFts6LuqafuWGgNs96qkUspV9hybSIDktgchAc6AcSIWgXRJf/uaDEmTowZDAc2t360PlJIF8ngelbcvmO97SIIGhX4KAF5Ovn5FpTdgsipy+y+4ZnebxhHiDe9Y755MQm7oxjWusQKm4VpN7w/ygHOontGeuRWwX1nKFeOlBvi5cm+4YBu/T1It/0u68BPX6P6f78lTbNDFzQpL3o15MzwuhbdSwaE+2YRXX8XkhpMBAjF8Q36U5LsuSb0quZxxC+XNtDwQLspWzqt8r1rRQfnhycJNTE38G/ZhM9tgqxFvB2svAZwz5LObYyPKPZyYqHQcNUHTmRBRMZRUClBD5uiYYQVC+oBPPxXpJThqVsPqxu+ChejBPnywTJPmn/2x6w60+IuEQ7YxgwtBM4BsG/OoNT7LqgSSuC1zKjOzTXMc/NW3jH95JLWfR88vPGBRLR9etfexkczDQ3KlEmQqZD7MDOP0OQAq3WX4/ZgW+yhlmIqrw98riWuy8othITEiYwbxFDa+Ct2wYs4IcG1RVJ7bNO4H5ZeuT2XOohqTs4gTW9luyI3x7wAtJWmciYKz5EnyATea/yBa4WI7RPjVPqRITdln31pYq6whxG38UWm1+byVdG03U5XoidKjtXArG0B2hPN5sSdRPZx5Fqt1DmL2gzL9O1IPUQ5mbDYJpMh2LI8i5sevEXZEiPrm0j6kambfVg+9Oey8eToeLDmq4ecN4BqjgH+NbwjmsmwAOk6KAQBQ3Ob9f6y1bL55k35QLRKjvs5kqnFt5DaI94XqbCkDA9Iyooj6hC/ACm60NkAgHUKI05JdAiag4XmJV3COv71Ae2ij1mjlDpn3/XGMafgApXJIHjDirDhfbNl5k5A0gozzNZf551KBbEbO//8RlTxuMbWDxAjKAy0w+fnCNNy1oMCXmKPBLWVP73Pvl+V/u4vOfWDZJcJuDbhLPgo/+LhjXggmVMEYaap2YYXZ2ujE/R9I0SZZGLsjc0bHWcLuAo+Vu3qh0eYXT5dfXbhF547szo8EcetCZrJboGrmr2ImimhTbNMYWUTNlmIEH6gTYSCVPoWIHaOOM5nnTEefbO6DZAozhGvsgDmzLwhI+bJrH5L/an/3cR4srWA3So58iZ5Wpz1O4SlRHoygWoTRz4w07x4pwpwxkrRicCQYtRdBYMV7OgPTQ4hNZ/awPB9DZb/Vh+TJr9hp36tWZO5CCoxT9Q+39gIJUtxBof75i0=

Just for the record for the future I guess, I couldn't get Dune working with the original plugin (even without SerAPI) because the plugin has many subdirectories, and I can't figure out a way to get the .v theory that loads the plugin to begin with to link to all of them. I can sort of hack it by adding a lot of "declare ML module" lines in the top-level theory for every subdirectory, but if I do that, coqdep gives me a number of warnings like "declared ML module contexts has not been found!" and then the build does not progress any further. I tried messing with the paths in a few different ways but couldn't figure anything out that got rid of the warning.

My work-in-progress is here: https://github.com/uwplse/coq-plugin-lib/tree/dune . I hope I figure it out at some point since this is a serious blocker for integrating a machine learning model into an existing plugin. Probably I will try to corner Emilio and talk him into a synchronous call :). But if anyone has encountered this before, I'd love to hear how you resolved it.

Talia

On Wed, Sep 8, 2021 at 12:43 AM Talia Ringer <tringer AT cs.washington.edu> wrote:
Thanks, this path looks really promising and I'll try it as soon as I get the chance.

On Tue, Sep 7, 2021, 7:55 PM Lasse Blaauwbroek <lasse AT blaauwbroek.eu> wrote:

With dune, Coq's libraries are split into sub-libraries, such as 'coq.plugins.ltac'. When you need to use a particular API file, you check which library it is in (by opening the dune file in the directory of that file), and add that library as a dep. The repo I linked does this with 'coq.plugins.ltac'.

On 08/09/2021 02:50, Talia Ringer wrote:
Thanks, with Dune though I can't even get my Coq plugin without SerAPI to load Constr, Environ, and other necessary modules. I have no idea what I'm supposed to depend on to get those.

On Tue, Sep 7, 2021 at 7:47 PM Lasse Blaauwbroek <lasse AT blaauwbroek.eu> wrote:

I have an example plugin that does exactly this here: https://github.com/LasseBlaauwbroek/serapi-example

I think I built this again 8.11 at the time, but I'm not sure (I didn't try to recompile the plugin before this email). Word of warning: Using SerAPI in a Coq plugin can be rather difficult due to its dependencies.

Lasse

On 08/09/2021 02:30, Talia Ringer wrote:
Hi all,

Have any of you gotten plugins that call out to SerAPI working, especially on Coq 8.9 (I am bound to 8.9 because of a dependency)? If so, I'd really love to see some example plugins. This is a major blocker for me and a student on a project.

I'm open to any build system at this point, but I haven't managed to get Dune working even without SerAPI---it gives me a bunch of errors failing to find Constr, Environ, and so on. The Dune tutorial didn't seem to address those errors. I don't know where to find the list of Coq libraries I can try to depend on from within a Dune project.

Without using Dune, using the normal _CoqProject and so on, I can get it to build if I build from source, which is already hacky. But then it fails to load:

File "./theories/Plib.v", line 1, characters 0-25:
Error:
while loading /home/talia/coq-plugin-lib/src/plib.cmxs:
error loading shared library: /home/talia/coq-plugin-lib/src/plib.cmxs: undefined symbol: camlPlib__Serapi_goals__anon_fn$5bcoq$2dserapi$2fserapi$2fserapi_goals$2eml$3a66$2c31$2d$2d47$5d_175_closure

Help with either of these paths would be strongly appreciated. 

Talia 



Archive powered by MHonArc 2.6.19+.

Top of Page