coq-club AT inria.fr
Subject: The Coq mailing list
List archive
RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern
Chronological Thread
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern
- Date: Wed, 7 Sep 2016 13:38:51 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga01.intel.com
- Ironport-phdr: 9a23:7tsv2xfEeBJfoYyId1tCg6xDlGMj4u6mDksu8pMizoh2WeGdxc6ybR7h7PlgxGXEQZ/co6odzbGH6ua+ACdevt7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+0rZ0vp5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6j5lH/Sl7F7XwFF24SjxBgAg7f7Ri8UI27+n/xsfM40y2HN+X3S6o1UHKs9fE4ZgXvjXJNDDk0/33NjdQ0xIdaqxKoqhg1i9rRYYqVPfd6OLjacNwGX21ZdsdXSyFFRIi7at1cXKI6Ie9Eotyl9BM1phykCFz0CQ==
Dear Guillaume,
thanks a lot, your example gives some interesting insight into how match
works. So if I have nat = bool, I can convince match to accept 1 as a bool:
Definition foo2 (H : nat = bool) : bool :=
match H in (_ = t) return t with
| eq_refl => 1
end.
But I wonder how this really works. I can see that an "in" clause is used to
bind a variable to a part of the match argument type and this is used in a
"return" clause. But how does Coq know that it should use the equality to
relate this to the actual return type? Is there a rule that if the match
argument is an equality of types, it can be used to unify the declared and
actual return type?
Coming back to my issues with computations with dependent types: how about
reducing such matches, in case the types are unifiable, as in the example I
have shown where the types are "t bool (0+1)" and "t bool 1". This should be
quite common in computations with concrete values of dependent types, e.g.
vectors of known length.
Best regards,
Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
- [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/06/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Matthieu Sozeau, 09/06/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/06/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/06/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/06/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/06/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/06/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Gaetan Gilbert, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/08/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/08/2016
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Soegtrop, Michael, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Guillaume Melquiond, 09/07/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Jonathan Leivent, 09/06/2016
- Re: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, Matthieu Sozeau, 09/06/2016
Archive powered by MHonArc 2.6.18.