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: Tue, 10 Apr 2018 10:30: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:6zZq7hxDd3PtExPXCy+O+j09IxM/srCxBDY+r6Qd2ukXIJqq85mqBkHD//Il1AaPAd2Araocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HdbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CWGRPQMhRWSxCDI2yYYQAAOgOMvpXoYTmu1sDrgGzCRWwCO7hyDJFgGL9060g0+QmFAHLxBEuHtIKsHTKttr1NaESXviowanP0DXDa/ZW3i3g44XPbx4gofWMXaxqfsrQz0kjDR7IjlKNqYzhOjOayP8As3Wd7+phS+KjkmEnqxtvrTipwccjkY3JiZwMxl/e8SV52Jg6JcaiRE51e96pCZ1dvDyUOYtxR8MtWWBouCAix70JuJ67YCgKyIk8yBLFd/OHdI2I7xT+X+iSOTd1nG9pdbKhixqo80WtyPfwWteo3FpWtCZIktvBumgQ2xDN7sWLUPhw80S71TuA2Q3f8PxILEM0mKfdNpUv2KQ/loAJvkTGBiL2mFv5jKuRdkg8++mo7v3rYrD6ppCGLoN0jRz+Mrg3lsChG+g4LxECX2eB9uim2r3j51X1QLRMjvIojqnUqI3WKMQFqqKjAQJY0Jwv5wijAzu6ytgVnXsKIEpAeB2djojpP1/OIOr/Dfe6m1mijTdqx/TYPrL7A5XNKGLPnarmfbZg705czRQ8wMtC55JSC7EBPuv/WkDrtNPGCB85NBe7w+L5B9lkzIweXXqPDbGCMK/Iv1+I/PojI/OQa48NpDb9N/8l6ubygn8+gF8RZLWm3Z8KaH+jBflmOEWYYX/0gtgbC2sKvww+TPbriFKYSzJTaWyyDOoA4WQwD5vjBoPeTKishqaA1WG1BNkeWmlCC1nEK3bueIieE6MQciOULcJ7ujcfE6eoUI8g0x6yswm8xrZ6eLn64Cod4Kny0MZ85uvkvxYv8Tn1R5CmwmWTRmBy2EkPWjsz0Yhip01jj1iZ3K5/ifhVUNVX//5SFAkgY82Ph9dmAsz/D1qSNuyCT0yrF5D/WWloH4ABhuQWakM4IO2MyxXK3i6kGbgQzeDZGZo17OfTxXX3IMx5xjPP0LEslB8oWJkWbDH0tutE7wHWQrXxvQCBja/wKfYB2i/TsWiZwGyJtkVVFQd0SajeG34FNBOP8IbJo3jaRrrrMowJdwtMzcnYcPlYb5jskVwDQ+r/fY6Yfie+kiG+H0TQyw==
Hello Talia,
I am not sure to fully understand your problem, but here is an hint: in a plugin, when you define a term introducing potentially new universe constraints, you have to refresh universe constraints. A simple way to do it in Coq 8.7 is to use the function "Typing.type_of" (you will only need the first component of its result).
See https://github.com/coq/coq/blob/v8.7/pretyping/typing.mli
As I understand it, this should correspond to your first alternative...
Hope this helps,
Sylvain.
Le 10/04/2018 à 03:06, Talia Ringer a écrit :
Hello,
I am writing a plugin, and as part of this plugin, I occasionally need to type-check terms. This is usually fine, but sometimes, I get errors like this:
The 2nd term has type "nat -> Type@{max(Foo, Bar)}"
which should be coercible to "nat -> Type@{Baz}".
I know what this means, but the thing is, these constraints are actually solvable; if I wrote the term outside of my plugin, it would type-check and go through. But inside of the plugin, the type-checking routine fails.
I'm looking for one of two things:
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.
Best,
Talia
- [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.