coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jason -Zhong Sheng- Hu <fdhzs2010 AT hotmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] "exists" Extraction
- Date: Wed, 10 Apr 2019 23:17:30 +0000
- Accept-language: en-CA, en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=fdhzs2010 AT hotmail.com; spf=Pass smtp.mailfrom=fdhzs2010 AT hotmail.com; spf=Pass smtp.helo=postmaster AT NAM02-BL2-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:jA/RYxVOAY89QZxnNWPq8dIUSfrV8LGtZVwlr6E/grcLSJyIuqrYbRyBt8tkgFKBZ4jH8fUM07OQ7/m5HzVQqs/b+DBaKdoQDkdD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2agMu4zf299IPOaAtUmjW9falyLBKrpgnNq8Uam4RvJrssxhfTv3dFeOtayX52KVmOmxrw+tq88IRs/ihNp/4t7dJMXbn/c68lUbFWETMqPnwv6sb2rxfDVwyP5nUdUmUSjBVFBhXO4Q/5UJnsrCb0r/Jx1yaGM8L4S7A0Qimi4LxwSBD0kicHNiU2/3/Rh8dtka9UuhOhpxh4w47JfIGYMed1c63Bcd8GQ2dKQ8FeWTFcAoOnd4sAEfYOPfpWoYn6olsBtxq+BQ+xD+/rxTJFgnr60Ksn2OojDA7GxhQtEdIQvnrJsNX7OqQcUe63w6bUwjrOdOlZ1Svh5IXSbhwtveyAULRtesTR00kvEAbFg02Up4P/JDOV0eINuHWC4+VjVeKvjGgnqw5sqTayxscjlI/Jho0MxlvZ9yt53Zs+KNq2SEFmYd6lEYBQuz+GO4drXs8vWGFouCEmyr0Do5G7fSwKxI47yB7YbvyKao6F6Q/tWuaWJDd3nnNleLSniha98Eig1u38VtSv31pQrypFlcHAuWwN1xzX68iHUuFy/kO71jqV0QDc9P1ELEYpnqTYM54s2rE9moYJvUnHACP6gkv7gLWLekk45+Sk8+rnbavlq5OAMoJ5jxzyPrggmsOjBOk1MhUCUmiZ9Om5z7Ls4UP0T6hPg/Erj6XUs5TXKMIGraCjGQBVyJws6xOnAjemztsYmX4HIUpddh+biIblJ0/CLOnlAPm5nVigiTBryOvYMbH7BZXNM2TDn6zmfbZg7U5T1RA/zchF55JTFrEOPu78WlPwtNzfCB81KQu0w/v7CNV50YMeXmGPDrWFP6PVtF+E/uMvI++Sa48JoDvwJOQp6+TqgHMng1MQc7Ol0YYLZHylBvhmJl+WYXvogtcPC2cKuQ8+QfTkiFKfUT5SZm2yU7wg6j0mFI6rFofDRoexgLyExii7H5lWanpaBVCLFHfkb5+EVOsUaCKOPs9hlSQJWqSmS484zB2hqAv6y6d8IefP4S0ZtZfj1MBv6OHJlBEy8yZ0D8WH3G2XQWF0hDBAezhjlqt4uAl2zkqJ+al+mf1RU9JJrbsdWQAjcJXY0uZSCtboWwuHcM3fG3i8RdDzIzgqSdR5hu0OZEByU+6igxbMmmKKHvdBmbCLFoduqvuE93j2O8N0ynKA364k2Qp1CvBTPHGr0/YsvzPYAJTExhnIzvv4ReEnxCfIsVy74y+OsUVfDFEid4zgBSpaTG+M6NPz6wXFUqOkDqkhPk1Z08meJ6BWa9rvy1JbWPPkP9eYaGW0yT7pWUS4g4iUZY+vQF0zmT3HARFfwQAU4XOPNAx4DSCk8TqHXW5eUGn3akapytFQ7XayT0s61QaPNhYz172p/xcUgbqXTPZBh78=
Hi Morgan,
are you sure ftree infinitely branches? your predicate is a fixpoint though.
it depends on where your existential quantification is coming from. If it's a part of the statement of your lemma, you can indeed simply replace it with `sig` and it has some chance to work.
if the quantification comes from your predicate, you are in a bigger trouble. to begin with, your predicate needs to be turned a Type, and potentially other pain comes. you want to first revise your definitions and theorems and see if you depend on some elimination
from other definitions in Prop. If that's the case, the change you need to make to turn your predicate into a Type is very hard to measure. judging from the size of your predicate, it might be difficult. more information is going to be helpful.
From: coq-club-request AT inria.fr <coq-club-request AT inria.fr> on behalf of Helmut Brandl <helmut.brandl AT gmx.net>
Sent: April 10, 2019 5:35 PM
To: coq-club AT inria.fr
Subject: Re: [Coq-Club] "exists" Extraction
Sent: April 10, 2019 5:35 PM
To: coq-club AT inria.fr
Subject: Re: [Coq-Club] "exists" Extraction
Just change ex to sig, see below.
On Apr 10, 2019, at 16:31, Morgan Sinclaire <morgansinclaire AT boisestate.edu> wrote:
I'm having trouble with extracting information from Prop, and specifically with the Prop/Type and ex/sig distinction which I wasn't aware of before. What I have is this definition:
Fixpoint valid (P : ftree) : Prop := ...
Where "ftree" is a certain infinitely-branching tree structure I've defined, and for this reason "valid" is undecidable in general.
Now I'm in the middle of a proof, where I have a hypothesis that looks like:
H : forall m : nat, exists t : ftree, valid t /\ [stuff about t]
And to complete my proof I need to produce a function of the form:
nat -> ftree
And by Curry-Howard, H should be such a function, but Coq doesn't believe so, because I can't extract computational information from "exists" (as discussed here, section 12.2).
Now, I know Coq does this because it wants to limit the amount of program extraction one can do, but in my case I want full Curry-Howard. So my first question is:
1) Can I "toggle" this feature in Coq so I can get full program extraction from "exists"?
If not, I don't know much about Sigma types, but I don't think I can just convert this "ex" into "sig" since the predicate "valid" is undecidable? I haven't worked with Type at all, so my other question:
You can use a sigma type. A sigma type contains a computable value and a proof that the value satisfies a predicate. In the extracted code only the value is visible, the proof is erased.
2) Is there an easy way to convert a Prop to a Type?
If so, I can change my definition of "valid" to be of type Type. Currently that definition is 63 lines and involves some Prop syntax such as "forall" and "/\", so any reference on how to do that in Type would be helpful so I can understand what I'm doing.
Thanks!
- [Coq-Club] "exists" Extraction, Morgan Sinclaire, 04/10/2019
- Re: [Coq-Club] "exists" Extraction, Helmut Brandl, 04/10/2019
- Re: [Coq-Club] "exists" Extraction, Jason -Zhong Sheng- Hu, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, mukesh tiwari, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Morgan Sinclaire, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Théo Zimmermann, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Morgan Sinclaire, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Gaëtan Gilbert, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Gaëtan Gilbert, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Sylvain Boulmé, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Gaëtan Gilbert, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Morgan Sinclaire, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Dominique Larchey-Wendling, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Dominique Larchey-Wendling, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Théo Zimmermann, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Morgan Sinclaire, 04/11/2019
- Re: [Coq-Club] "exists" Extraction, Helmut Brandl, 04/10/2019
Archive powered by MHonArc 2.6.18.