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: Matthieu Sozeau <mattam AT mattam.org>
- 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, 07 Sep 2016 13:59:28 +0000
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f53.google.com
- Ironport-phdr: 9a23:CpM3BxQHojt6uvbWSCWA4GOWKdpsv+yvbD5Q0YIujvd0So/mwa64YxKN2/xhgRfzUJnB7Loc0qyN4vmmBzVLv8nJ8ChbNscdD1ld0YRetjdjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9fbytScbshsi6n9q/54fUK10RwmHsOPUsdV7o8k2R7pBQ2to6bP5pi1PgmThhQ6xu32RmJFaezV7Xx/yb29pdyRlWoO8r7MVaUK/3LOwSRL1cCyk6YShuvJW4/UqLcQzarHAbSyAdlgdCKwnD9hDzGJnr+GOuve1knSKeIMfeTLYuWD3k4b09GzHyjyJSEjcl7GHWh9E4t6VJrRu870h6ypLIaYS9MfNiYqrYO9QASjwSDY5qSyVdD9bkPMM0BO0bMLMAog==
Hi Michael,
what you propose is a version of the definitional version of UIP (also know as the K axiom), you
might want to read Adam Chlipala's chapter about it in CPDT. I believe
http://adam.chlipala.net/cpdt/html/Cpdt.Equality.html turns around this subject.
Best,
-- Matthieu
On Wed, Sep 7, 2016 at 3:39 PM Soegtrop, Michael <michael.soegtrop AT intel.com> wrote:
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
- RE: [Coq-Club] Getting "computing" proof terms with dependent types / reduction of matches with single pattern, (continued)
- 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, 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/08/2016
Archive powered by MHonArc 2.6.18.