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: Jean-Francois Monin <jean-francois.monin AT imag.fr>
- To: coq-club AT inria.fr
- Cc: Sylvain Boulme <sylvain.boulme AT imag.fr>
- Subject: Re: [Coq-Club] API: How to generate a sort type for the parameter of an abstraction
- Date: Thu, 6 Oct 2016 11:18:39 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jean-francois.monin AT imag.fr; spf=Neutral smtp.mailfrom=jean-francois.monin AT imag.fr; spf=None smtp.helo=postmaster AT furon.ujf-grenoble.fr
- Ironport-phdr: 9a23:dF+dBRyhxagXrO/XCy+O+j09IxM/srCxBDY+r6Qd0eoRIJqq85mqBkHD//Il1AaPBtSBrakewLKH++C4ACpbvsbH6ChDOLV3FDY7yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Dq3PF4XTl8W60fyps92WOl0QxWn1XbQnJxKv6A7Vq8M+gI14K693xAGajGFPfrF0yGpuYHyJlhD34cartLtk9SVW86Yj+sdGFKvgdqIzSr1DSjEhNWEzzMzuvBaFQxHZtShUaXkfjhcdW1uN1xr9RJqk93Ki7uc=
Would things get naturally simpler using Set rather than Type in that case?
My understanding is that Set is much simpler than Type, so I stick to
Set for data structures as much as possible (though it is not trendy).
For instance, nat: Set.
Having list : Type -> Type is reasonable in order to have lists
of anything once for all, including lists of proofs, lists of Props, lists
of types, etc.
For the case of Sylvain, is Type really needed?
Jean-Francois
On Thu, Oct 06, 2016 at 09:22:17AM +0200, Guillaume Melquiond wrote:
> On 06/10/2016 09:13, Sylvain Boulmé wrote:
>
> > But, when using this tactic inside a Coq module "TestTactic", I get the
> > following error message:
> >
> > Error: Illegal application:
> > The term "Syntax.Var" of type
> > "forall var : Type, var -> Syntax.expr var"
> > cannot be applied to the terms
> > "v" : "Type"
> > "r4" : "v"
> > The 1st term has type "Type@{TestTactic.1}"
> > which should be coercible to "Type@{Syntax.1}".
> >
> >
> > How to correct my code above ?
>
> 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).
>
> 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.
>
> Best regards,
>
> Guillaume
- [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.