coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction
Chronological Thread
- From: Matthieu Sozeau <mattam AT mattam.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction
- Date: Thu, 06 Oct 2016 09:36:15 +0000
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f51.google.com
- Ironport-phdr: 9a23:+K0JxhYtJJqJPL3uC2bPOI7/LSx+4OfEezUN459isYplN5qZpc+6bnLW6fgltlLVR4KTs6sC0LuM9fu6EjRRqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ3p7xjLr5o8ybSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mosVHSODxe7kyZb1eFjUvdW4vt+PxshyWaAKT+nsdX3heqR1aDgHYpEX/V4vtuy7Ss+NhxCCfe8rsQuZnCnyZ8653RUqw2288PDkj/TSPhw==
If you want to be minimal in the typing you do and know where new universe constraints
should appear, you can also call Evd.set_(l)eq_sort to generate the appropriate constraints.
Cheers,
-- Matthieu
On Thu, Oct 6, 2016 at 11:33 AM Sylvain Boulmé <Sylvain.Boulme AT imag.fr> wrote:
Thanks a lot Guillaume,
Le 06/10/2016 à 09:22, Guillaume Melquiond a écrit :
> As far as I know, you are supposed to call Typing.type_of on your newly
> created term. That will return a new evarmap that should pass to
> tclEVARS rather than the old one (which does not contain enough universe
> constraints for checking that your new term is well-typed).
Yes, applying this solve my issue.
> 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.
>
This very smart trick seems also to work very well ;-)
Thanks again !
Sylvain.
- [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Sylvain Boulmé, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Guillaume Melquiond, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Jean-Francois Monin, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Sylvain Boulmé, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Sylvain Boulmé, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Matthieu Sozeau, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Jean-Francois Monin, 10/06/2016
- Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction, Guillaume Melquiond, 10/06/2016
Archive powered by MHonArc 2.6.18.