Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Record sort

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Record sort


Chronological Thread 
  • From: Jan-Oliver Kaiser <janno AT mpi-sws.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Record sort
  • Date: Sat, 28 Jan 2017 11:04:54 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=janno AT mpi-sws.org; spf=Pass smtp.mailfrom=janno AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:CHJ+9hChunParPseaYZRUyQJP3N1i/DPJgcQr6AfoPdwSP38pMbcNUDSrc9gkEXOFd2CrakV16yL4uu4BiRAuc/H6y9SNsQUFlcssoY/oU8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUt2as8Pi3OervpbXfg9ghTynYLo0Ig/lgx/Ws5w0iI0nDaIw1BbT6lhBev9b3ys8J1uVmRHU49+xuYV86GJXof13pJ0IarnzY6ltFe8QNz8hKW1gvMA=

I think Coq always tries to find the smallest type possible for records (and inductives?), mostly ignoring the annotation given by the user.

Related to this is the following example, which can be very annoying when doing meta programming:

Record R (P : Prop) : Type := { f : P -> P }.
Check R.
(* R : Prop -> Prop *)

The elim restriction does not apply to these types. The record can be used as if it had the annotated type. However, typeclasses and canonical structures defined for "Type"s won't trigger.

Best,
Jan-Oliver


On 01/28/2017 01:19 AM, Vadim Zaliva wrote:
I do not understand why when I define a Record in sort "Type" it ends up in
"Set"?

Welcome to Coq 8.6 (January 2017)

Coq < Record R (P: nat -> Prop) : Type := {f: nat -> nat}.
R is defined
f is defined

Coq < Check R.
R
: (nat -> Prop) -> Set

Vadim

--
CMU ECE PhD candidate
Mobile: +1(510)220-1060




Archive powered by MHonArc 2.6.18.

Top of Page