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 09:23:59 +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 mga07.intel.com
- Ironport-phdr: 9a23:AQi+axc46TH9rlEj+RO5tYUclGMj4u6mDksu8pMizoh2WeGdxc6ybR7h7PlgxGXEQZ/co6odzbGH6ua+ACdZvN7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+0rZ0zr5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6j5lH/Sl7F7XwFF24SjxBgAg7f7Ri8UI27+n/xsfM40y2HN+X3S6o1UHKs9fE4ZgXvjXJNDDk0/33NjdQ0xIdaqxKoqhg1i9rRYYqVPfd6OLjacNwGX21ZdsdXSyFFRIi7at1cXKI6Ie9Eotyl9BM1phykCFz0CQ==
Dear Coq Users
I thought about this a bit more. Since the following term type checks:
match plus_n_O 1 in (_ = y) return (t bool y) with | eq_refl => cons bool false 0 (nil bool) end : t bool (1 + 0)
Coq knows that (t bool y) and the type of “cons bool false 0 (nil bool)” unify. Also it is obvious that the only possible value of this match is “cons bool false 0 (nil bool)”, the only question is what type it has. But since Coq knows that the type of the result term and the complete match unify (otherwise the match wouldn’t typecheck), I don’t think that one needs “proof irrelevance for equality” to justify that the above term is equal to:
cons bool false 0 (nil bool) : t bool 1
Can’t one add a rule which reduces matches in the following situation:
- the match has only one pattern - the result term does not depend on any pattern bindings - the type of the result term and the type of the match unify (should always be the case – otherwise the match wouldn’t type check)
Would such a rule be sound? I have the impression that this would solve some of the issues which lead to the statement I hear from time to time: “Yes, Coq is dependently typed – but don’t use it”. This kind of matches which just changes the type of a term, but not the term itself, are quite common when dealing with dependent types and lead to exploding term sizes. E.g. the standard library Vectors.rev function comes with the comment “Caution : There is a lot of rewrite garbage in this definition”, so I guess it is not trivial – if possible at all - to write a rev function for standard library vectors, which doesn’t lead to exploding term sizes when computing with concrete values.
I think being unable to give a reasonably well behaved implementation for something as trivial as a vector reversal is problematic. Well I am not sure if it is really not possible, but the comment in the standard library reduced my hopes to find a solution a bit.
Best regards,
Michael Intel Deutschland GmbH |
- [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/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.