coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Arnaud Spiwack <aspiwack AT lix.polytechnique.fr>
- To: Keiko Nakata <keiko AT kurims.kyoto-u.ac.jp>
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] Add Relation sequence bisimilar
- Date: Sat, 2 May 2009 12:41:47 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=c1kPWfEfq2f63JBBRV7GBkq+QoKx5LU0t45zHE4zLAzA2d4NNIaFYh+1TeXcNICl1j BmkG2mxX6L4ZWphl/jE2pQBJxLBHYl/yFHhzNzXzYNietz73eMdWC37q70x+4Da8fxtB sW816+hors4b0iYo2hyeH8mlJhDd0KflU2DsA=
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hello,
It's a bit difficult to say with precision what is "wrong" with coinductive types in Coq. It gets a tad philosophical I guess. They are somewhat too powerful to be correct, that's about clear. One theory, which I personnally advocate, is that the trouble is dependent pattern matching on coinductive type, which tells, in the case of streams "a stream necessarily starts with a 'cons' ". Which is not entirely true (not every streams are convertible to a stream starting with a cons, probably very few one would build actually), but because of dependent pattern matching, it is actually a provable fact (forall s:stream, exists a, exists s', s = cons a s'). A variant fact by the way is that which allows to cheat type preservation (if I remember correctly).
So generally speaking, and according to this point of view, dependent pattern matching is what one should avoid when using CoInductive types. Bisimilarity dependent doesn't require dependent pattern matching. I'd say you're safe using it.
It is by the way partly because of the above rational that the "record" syntax for coinductive was added to Coq v8.2 (though it also exists for inductive types). My suggestion would be as follows :
- Streams (and generally coinductive types) should be defined something along the lines of :
CoInductive Stream (A:Type) := { hd : A ; tl : Stream A }
- Do not use destruct or case or intros [ ] or whatever similar on a string object
And you will not run into the strange corner cases.
Arnaud Spiwack
2009/4/30 Keiko Nakata <keiko AT kurims.kyoto-u.ac.jp>
Hello,
Are there any potentially bad consequences of having
"Add Relation sequence bisimilar",
where sequence and bisimilar are defined coinductively,
i.e. infinite lists and the bisimilar relation on them?
I am aware of an issue concerning type preservation discussed:
http://logical.saclay.inria.fr/coq-puma/messages/b35593715e6cbad3#msg-b35593715e6cbad3
I also remember someone told me that he suspect that there might be
some bad interactions between Coq's criterion of guardedness and Setoids.
I was thinking if, with "Add Relation sequence bisimilar",
any predicate on sequences will not distinguish bisimilar lists;
this sounds interesting to me.
Best regards,
Keiko
--------------------------------------------------------
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
- Re: [Coq-Club] Add Relation sequence bisimilar, Arnaud Spiwack
- Re: [Coq-Club] Add Relation sequence bisimilar,
Keiko Nakata
- Re: [Coq-Club] Add Relation sequence bisimilar, Arnaud Spiwack
- Re: [Coq-Club] Add Relation sequence bisimilar, Eduardo Gimenez
- Re: [Coq-Club] Add Relation sequence bisimilar,
Eduardo Gimenez
- RE: [Coq-Club] Add Relation sequence bisimilar,
Georges Gonthier
- Re: [Coq-Club] Add Relation sequence bisimilar,
Keiko Nakata
- Re: [Coq-Club] Add Relation sequence bisimilar, Keiko Nakata
- Re: [Coq-Club] Add Relation sequence bisimilar,
Keiko Nakata
- RE: [Coq-Club] Add Relation sequence bisimilar,
Georges Gonthier
- Re: [Coq-Club] Add Relation sequence bisimilar,
Keiko Nakata
Archive powered by MhonArc 2.6.16.