Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Parametricity in Mutual Inductive Types

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Parametricity in Mutual Inductive Types


chronological Thread 
  • From: roconnor AT theorem.ca
  • To: AUGER C�dric <Cedric.Auger AT lri.fr>
  • Cc: Coq Club <coq-club AT pauillac.inria.fr>
  • Subject: Re: [Coq-Club] Parametricity in Mutual Inductive Types
  • Date: Fri, 16 Oct 2009 20:30:40 -0400 (EDT)
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

On Fri, 16 Oct 2009, AUGER Cédric wrote:

(*-- It is fundamental, but as you did below, we can have dependent types,
which accepts different parameters,
and dealing is not as easy as with non dependent types *)

It appears Agda can do it, so I don't understand why you say it is fundamental.

module SillyTree where
{- my first agda program -}
data bool : Set where
  true : bool
  false : bool

mutual
  data SillyTree : bool -> Set where
    leaf : SillyTree true
    node : (b : bool) -> SillyTreePair b -> SillyTree false

  data SillyTreePair (b : bool) : Set where
    stp : SillyTree b -> SillyTree b -> SillyTreePair b

sillyFunction : SillyTree false -> bool
sillyFunction (node true (stp leaf leaf)) = true
sillyFunction _ = false

(*-- And what about: *)
Inductive SillyTree : bool -> Type :=
| leaf : SillyTree true
| node : SillyTreePair -> SillyTree false
with SillyTreePair : Type :=
| stp : forall b, SillyTree b -> SillyTree b -> SillyTreePair.

This is nice, but not adequate for my purposes because I want to have SillyTreePair indexed by bool for the other uses of SillyTreePair I have in mind.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''


Archive powered by MhonArc 2.6.16.

Top of Page