coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Roman Beslik <beroal AT ukr.net>
- To: Vladimir Voevodsky <vladimir AT ias.edu>
- Cc: Coq Club <coq-club AT pauillac.inria.fr>
- Subject: Re: [Coq-Club] another inductive types question
- Date: Sun, 11 Oct 2009 22:25:52 +0300
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hello, Vladimir.
It's easy to grasp the meaning of the error if you clearly understand the syntax of "Inductive". Consider
Inductive ST1:Type := nat : ST1 .
This declaration binds the name "ST1" to a newly generated inductive data type. Also it binds "nat" to the only *data constructor* of "ST1". (By the way, this "nat" has zero arguments.)
But "nat" was defined in the "Coq.Init.Datatypes" ("Coq.Init" files are included silently) earlier, you've *redefined* a quite standard name. So I guess that using "nat" here is a mistake. I see a similar problem in the second line
Inductive ST2:Type := ST1:ST2 .
where you bind "ST1" which is *already bound* in the first line. Why redefining of names from other files is allowed but from the current file is not... I don't think it's important.
Vladimir Voevodsky wrote:
I am just trying to understand how the "Inductive" works. I also tried the following:--
Inductive ST1:Type := nat : ST1 .
Inductive ST2:Type := ST1:ST2 .
and the first line compiles while both lines together do not, with the message "Error: ST1 already exists".
Is it right?
Best regards,
Roman Beslik.
- [Coq-Club] About extraction and mutual recursion, (continued)
- [Coq-Club] About extraction and mutual recursion, AUGER Cédric
- [Coq-Club] Typo on coq manual, AUGER
- Re: [Coq-Club] Typo on coq manual, Pierre Letouzey
- Re: [Coq-Club] another question (Prop as a subtype of Set), Matthieu Sozeau
- Re: [Coq-Club] an inductive types question, Vladimir Voevodsky
- Re: [Coq-Club] an inductive types question, AUGER Cédric
- Re: [Coq-Club] an inductive types question, André Hirschowitz
- Re: [Coq-Club] an inductive types question, AUGER Cédric
- [Coq-Club] another inductive types question, Vladimir Voevodsky
- Re: [Coq-Club] another inductive types question, AUGER Cédric
- Re: [Coq-Club] another inductive types question, Roman Beslik
- Re: [Coq-Club] another inductive types question, Vladimir Voevodsky
- Re: [Coq-Club] Type hierarchy, Randy Pollack
Archive powered by MhonArc 2.6.16.