Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] "exists" Extraction

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] "exists" Extraction


Chronological Thread 
  • From: Helmut Brandl <helmut.brandl AT gmx.net>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] "exists" Extraction
  • Date: Wed, 10 Apr 2019 16:35:55 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=helmut.brandl AT gmx.net; spf=Pass smtp.mailfrom=helmut.brandl AT gmx.net; spf=None smtp.helo=postmaster AT mout.gmx.net
  • Ironport-phdr: 9a23:gsLGJxYsdBC4T6Rz2HBFWxT/LSx+4OfEezUN459isYplN5qZoMWzbnLW6fgltlLVR4KTs6sC17OP9fm/EjVeuN7B6ClELMUUEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUoHdgN6q2O+s5pbdfxtHhCanYbN1MR66sRjdutMZjId/N6o90AbFr3lHd+hLxG5kOE+YkxLg6sut5pJu/Dlct+47+8JcTan2erkzQKBFAjghL207/tDguwPZTQuI6HscU2EWnQRNDgPY8hz0XYr/vzXjuOZl1yaUIcP5TbYvWTS/9KhrUwPniD0GNzEi7m7ajNF7gb9BrxKgoxx/xJPUYJ2QOfFjcK7RYc8WSGxcVctXSidPAJ6zb5EXAuQBPuhXs4byqVUToxS8GwesCuThxyRSiXPq2K03yeQhHR3Y0AEmAtkAsG7UrNLwNKoKU+660q3IzTDeb/NKxDzw9ZLIfQonof6RWbJ7bM3cyUkxGAPBi1WQtJDlMymO2eQXqWeb6fdvVea0hm4orgFwrSKjxsEyhYnVn48YzE3P+yt+wIYwP9K4SUh7bMa4H5tQsyGaNpN2TdkmQ25yoio6zKMJuYK9cSMXy5on3wbSZ+Kaf4SW+B7vSvidLDViiH54eL+znQu+/Ey4xuHhVcS51ExGojdKn9TOrHwA0wHf5tKJR/Zy+EqqxCyB2BrJ6u5eJEA5jarbJIAlwr43jpcTtEPDHjLqmEnsg6+Wc0ol9vKu6+v5frXqvp6cN4lqhQHiKqkihNGzDfoiPgQQQWSW+/6w2KDj8EHjXblHiuU6kqzDv5DbIcQbqLS5AwhQ0os76xawETOm0NEFnXkbNl5KYwiHgJLvO17TJPD1Fvi/g1GjkTtxwfDJIKHhDo3XLnffiLfhYap960lExQUvytBf/otYBa0FIPLuQUD8r8fYDx88Mwys2enrEtR91oUEWWKOGKCVKq3SsUXbrt4oduKLfcoevCv3A/kj/f/ny3EjynEHeqz8/ZYTbW2kVt58KkOVZTK4gtoFFHoW+AAkRermjHWNVC4VYXuuCfFvrgonAZ6rWN+QDrumh6aMiX/iQ89mI1teA1XJKk/GMoWJX/BVNHCXJdJ91DMBRf6nRpNzjUjy5j+/8KJuK6/vwgNdrYjqhYp64v2Vkxwup2QtXpatllqVRmQxpVsmAjo/3aRxu0t4mwWM1Lg+hfFER4Ve

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!





Archive powered by MHonArc 2.6.18.

Top of Page