coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Sylvain Boulmé <Sylvain.Boulme AT univ-grenoble-alpes.fr>
- To: coq-club AT inria.fr, Talia Ringer <tringer AT cs.washington.edu>
- Subject: Re: [Coq-Club] Plugins, type-checking, and universe constraints
- Date: Fri, 13 Apr 2018 07:09:28 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=Sylvain.Boulme AT univ-grenoble-alpes.fr; spf=Pass smtp.mailfrom=Sylvain.Boulme AT univ-grenoble-alpes.fr; spf=None smtp.helo=postmaster AT zm-mta-out-2.u-ga.fr
- Ironport-phdr: 9a23:/f3LxBfk3L8pAEnN/waLAbY6lGMj4u6mDksu8pMizoh2WeGdxcW7bR7h7PlgxGXEQZ/co6odzbaO6Oa4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahb75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTzFPDJ2yb4UPDOQPM+hXoIb/qFQSohWzHhWsCeD1xzNUmnP706833uI8Gg/GxgwgGNcOvWzJotT1MKcST/q6zKjOzTrbcv5W3ir96IzNchc7vPqBWq9+cMrVyUkxDQzFj1OQpZb4MjOSy+QNt22b4PR7WOKyjW4nqh9xriGgxsc2lIbJgIUVxUvA9Spn2Yo6P9m4SFZlbt6/CpdQuTuaOpJwT8g/TW9ovyM6xacHuZ69ZCUKyZInxwTea/OdaYSI7AjjWeCMKjl7nHJoYK+zihas/US6yODxVNO43EhWoiZZiNXBtnIA2wTN5sSdSPZx5EOs1DaV2w3S6uxJJ10/m7DBJJ472LEwk4IesUTdES/yn0X7lK6XdkA99uit9+ToeKzqppiBN49okw3yLL4imtGmDeQ3KAcCRWab+f6k2L3i+032XqlKg+UrnqTZrpzWP8YWq6yjDwNLzoov9wyzAjek3dgAmHkINlNFeBaJj4jzPFHOJej1A+q/glSojjdk3fHGPrv7DpjQKXjDjbPhfbNj5ENH1Qozy9Ff54xNBrEOOvL8REnxtNvDAR89LQO42vzoCNFl1owAQmKDGKGZMLnKvV+S+u0vO/WMZJMSuDvlN/cl4OfugWYlll8ZYKmmxoAaaGu4H/RjO0WWe2DggtYHEWcQvwoxVvbmiFOYUW0bW3HnVKUlozo/FYiODIHZR4nrjqbFlBuyGpxfLlpHDF+BCz+8a5+FXfgBcgqZOYl+mycEVL6uV4gnkxyiqVmp5aBgK7/v6ykGvJPl4/Jy+unWFFlmzi1wEc2c1SenSHxwm24gWjk3wuVwu0F7zV2H3O1xh+RVDppd/aUaAU8BKZfAwrkiWJjJUQXbc4LMEQ7+G4T0MXQKVts0huQ2TQN4EtSmgArE2nD2UaITlqLOC4Y59KXW23W0LsJlxm2A2rNz1gB6EPsKDnWvg+tEzyaWH5TAyRnLiqCra+ETxiPL822HwC+HuFlVS0h+S/edBC1NVg7ttd38o3j6YfquBLAgaFET28vHL7dDL9r0kRAcAuqmN92YbXjjw2o=
Hi Talia,
Le 13/04/2018 à 00:31, Talia Ringer a écrit :
Thanks all; calling type inference worked well. Is there any performance overhead to using this over the kernel? If so, do you have an idea of how significant it is?
This was answered to me by Guillaume Melquiond a few years ago in
https://sympa.inria.fr/sympa/arc/coq-club/2016-10/msg00007.html
I copy-paste his answer below:
<< Unfortunately, it means type-checking your term twice, which you
precisely wanted to avoid since you are calling exact_no_check. Another
solution is thus not too call Typing.type_of on your new term, but on a
smaller simpler dummy term. If your dummy term (whatever its type)
happens to produce the exact same universe constraints as your new term,
then you are good to go and you can use the produced evarmap instead. >>
I confirm that Guillaume's hack is simple and (still) works well for me...
Best Regards,
Sylvain.
Also, it would be useful I think to have documentation of best practices for plugin developers, beyond the new API which is a start. It can still be difficult as a plugin developer to know which of my many options are better for which situations. I can help by curating things I've been confused about in the past, so you know what questions a plugin developer might have.
Talia
On Wed, Apr 11, 2018, 8:18 AM Emilio Jesús Gallego Arias <e AT x80.org <mailto:e AT x80.org>> wrote:
Hello Talia,
Talia Ringer
<tringer AT cs.washington.edu
<mailto:tringer AT cs.washington.edu>>
writes:
> 1. A way to tell type-checking from within a plugin about the
universe
> constraints so that it knows to solve them correctly, or
>
> 2. a way to tell type-checking from within a plugin to just
assume all
> universe constraints go through, because this will always be true
for me,
> and if it isn't, then the plugin will just fail later anyways
>
> I'm assuming #1 is the proper way to call type-checking from within a
> plugin, but I'm not sure how to do it.
So indeed as others have pointed out, the kernel won't infer constraints
for you anymore so you'll have to manually infer them [very cumbersome]
or call the type inference mechanism.
Coq devs are aware the universe-handling API could certainly take some
usability improvements, please, as an API user don't hesitate to share
thoughts or suggestions about it.
I think that the preferred interface these is to open an issue on
GitHub, but of course mailing list discussion is welcome too [however it
has the downside that, contrary to GH issues, it tends to be harder to
translate to concrete actionable plans].
Best,
E.
- [Coq-Club] Plugins, type-checking, and universe constraints, Talia Ringer, 04/10/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Sylvain Boulmé, 04/10/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Matthieu Sozeau, 04/10/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Emilio Jesús Gallego Arias, 04/11/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Talia Ringer, 04/13/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Théo Zimmermann, 04/13/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Sylvain Boulmé, 04/13/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Emilio Jesús Gallego Arias, 04/13/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Talia Ringer, 04/13/2018
- Re: [Coq-Club] Plugins, type-checking, and universe constraints, Sylvain Boulmé, 04/10/2018
Archive powered by MHonArc 2.6.18.