coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Vladimir Voevodsky <vladimir AT ias.edu>
- To: Roman Beslik <beroal AT ukr.net>
- Cc: Coq Club <coq-club AT pauillac.inria.fr>
- Subject: Re: [Coq-Club] another inductive types question
- Date: Sun, 11 Oct 2009 19:49:43 -0400
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Why redefining of names from other files is allowed but from the current file is not... I don't think it's important.
Yes, that's exactly what confused me. It would be very good if a command which causes a re-definition produced a warning.
V.
On Oct 11, 2009, at 3:25 PM, Roman Beslik wrote:
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.
--------------------------------------------------------
Bug reports: http://logical.saclay.inria.fr/coq-bugs
Archives: http://pauillac.inria.fr/pipermail/coq-club
http://pauillac.inria.fr/bin/wilma/coq-club
Info: http://pauillac.inria.fr/mailman/listinfo/coq-club
- [Coq-Club] Typo on coq manual, (continued)
- [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.