coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Abhishek Anand <abhishek.anand.iitg AT gmail.com>
- To: coq-club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Why no unfolding on left in match?
- Date: Wed, 8 Oct 2014 14:34:23 -0400
You can solve the readability problem by using abbreviations instead of definitions.
Notation foo := 1.
Definition bar (n:nat): nat := match n with foo => 1 | _ => 0 end.
-- Abhishek
http://www.cs.cornell.edu/~aa755/On Wed, Oct 8, 2014 at 2:05 PM, Kevin Sullivan <sullivan.kevinj AT gmail.com> wrote:
I'm wondering what's the technical reason that Coq doesn't unfold expressions in pattern position?(* THIS WORKS *)Definition bar (n:nat): nat := match n with 1 => 1 | _ => 0 end.(* THIS DOESN'T *)Definition foo: nat := 1.Definition bar (n:nat): nat := match n with foo => 1 | _ => 0 end.(*The only difference is the use of a symbol rather than a "manifest constant" in the second case.When using nats to represent objects of another kind, I'd prefer to match on symbolic names rather than on their concrete representations as nats -- for abstraction, information hiding, readability. Of course the question generalizes beyond nats.*)Kevin
- [Coq-Club] Why no unfolding on left in match?, Kevin Sullivan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Adam Chlipala, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Kevin Sullivan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Greg Morrisett, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Jonathan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Jonathan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Greg Morrisett, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Jonathan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Kevin Sullivan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Enrico Tassi, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Jonathan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Greg Morrisett, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Kevin Sullivan, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Abhishek Anand, 10/08/2014
- Re: [Coq-Club] Why no unfolding on left in match?, Adam Chlipala, 10/08/2014
Archive powered by MHonArc 2.6.18.