coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jason Gross <jasongross9 AT gmail.com>
- Cc: coq-club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Matching on specific Type argument values?
- Date: Sun, 16 Jun 2013 13:00:48 -0400
You can only do a syntactic match when you're building a proof in Ltac, not within a gallina function. Gallina (the non-Ltac Coq language) doesn't have any notion of syntactic equality, and you can't access the definitional equality. As a rule of thumb, gallina functions need to respect equality; if substituting (propositional) equals for equals changes the behavior of the function, then you can't do it in Gallina. You could try Mtac (I've never tried it), which, I think, does some tricks with delaying computation until you run the code. But I don't think you can prove much about Mtac code. Alternatively, you could reify the types you use so that you only consider a subset of Type with decidable equality.
-Jason
On Sun, Jun 16, 2013 at 8:02 AM, Michiel Helvensteijn <mhelvens AT gmail.com> wrote:
On Sun, Jun 16, 2013 at 3:22 AM, Jason Gross <jasongross9 AT gmail.com> wrote:That makes sense.
> Type does not have decidable equality, and you cannot productively
> destruct/match on a thing of type Type.
And that, I guess, is why I expected it to work anyway. ;-) A
> Additionally, the match you use is
> in Ltac; it matches on a syntactic level, unlike the non-ltac match.
syntactic match is exactly what I'm after (modulo delta/beta/zeta
reduction). I'm basically trying to create some syntactic sugar. And
isn't syntactic equality decidable?
Indeed. But I won't need that until I write the recursive definition
> You will probably want to reify your types so that you can distinguish
> function types from other types.
later, right? For the moment, I'm trying to solve one problem at a
time: that of matching the 'T' of 'primitive' to the 'T' of
'delta_op'.
No problem. Though if you can find some time later, I would appreciate
> Appologies if this is not enough information; I'm typing from my cellphone
> at the moment and thus being concise.
an example of how to do this properly. It seems like it should be
possible.
Thanks!
--
www.mhelvens.net
- [Coq-Club] Matching on specific Type argument values?, Michiel Helvensteijn, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Jason Gross, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Michiel Helvensteijn, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Jason Gross, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Michiel Helvensteijn, 06/18/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Jason Gross, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Michiel Helvensteijn, 06/16/2013
- Re: [Coq-Club] Matching on specific Type argument values?, Jason Gross, 06/16/2013
Archive powered by MHonArc 2.6.18.