coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type
Chronological Thread
- From: Altenkirch Thorsten <psztxa AT exmail.nottingham.ac.uk>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Cc: Dexter Kozen <kozen AT cs.cornell.edu>, Konstantinos Mamouras <mamouras AT cs.cornell.edu>
- Subject: Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type
- Date: Fri, 28 Mar 2014 10:48:53 +0000
- Accept-language: en-US, en-GB
- Acceptlanguage: en-US, en-GB
Reply-To: "coq-club AT inria.fr" <coq-club AT inria.fr>
Date: Thu, 27 Mar 2014 18:55:46 +0000
To: "coq-club AT inria.fr" <coq-club AT inria.fr>
Cc: Dexter Kozen <kozen AT cs.cornell.edu>, Konstantinos Mamouras <mamouras AT cs.cornell.edu>
Subject: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type
Hi,I am trying to define a type with both inductive constructors and coinductive constructors (really destructors).With the [Inductive] keyword, I can define a type with all constructors inductive, as in:Inductive list: Type:=| LNil : list| LCons : nat -> list -> list.and similarly with the [CoInductive] keyword, I can define a type with all constructors coinductive, as in:CoInductive stream : Type :=| SCons : nat -> stream -> stream.If I want some constructors to be inductive and others to be coinductive, an idea I had was to use two mutually recursive types, with a construct akin to:CoInductive even_list : Set :=| ENil : even_list| ECons : nat -> odd_list -> even_listwith odd_list : Set :=| OCons : nat -> even_list -> odd_list.But I can't seem to make odd_list just [Inductive], while keeping even_list [CoInductive]. Is there any way I could do this? Or any other way to mix Inductive and CoInductive constructors?(examples taken or inspired from http://adam.chlipala.net/cpdt/html/Coinductive.html and http://adam.chlipala.net/cpdt/html/InductiveTypes.html)Thank you,Jean-Baptiste
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
- [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Jean-Baptiste Jeannin, 03/27/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Kristopher Micinski, 03/27/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Andrew Hirsch, 03/27/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Altenkirch Thorsten, 03/28/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Dexter Kozen, 03/28/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Jean-Baptiste Jeannin, 03/28/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Andreas Abel, 03/30/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Andreas Abel, 03/30/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Andreas Abel, 03/30/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Jean-Baptiste Jeannin, 03/28/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Kristopher Micinski, 03/29/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Dexter Kozen, 03/28/2014
- Re: [Coq-Club] Mixing Inductive and CoInductive constructors/destructors in the same type, Kristopher Micinski, 03/27/2014
Archive powered by MHonArc 2.6.18.