coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Dirk Pattinson <dirk.pattinson AT anu.edu.au>
- To: <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Difference between sum and sumbool
- Date: Tue, 25 Aug 2015 21:46:54 +1000
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dirk.pattinson AT anu.edu.au; spf=Pass smtp.mailfrom=dirk.pattinson AT anu.edu.au; spf=None smtp.helo=postmaster AT APC01-SG2-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:wLdyOBAdqqJ1UC5/Q9gVUyQJP3N1i/DPJgcQr6AfoPdwSP7/osbcNUDSrc9gkEXOFd2CrakU0KyL4uu4BiQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTskb3jsMWMKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvCudKMhCLdcET4OMmYv5cStuwOVHiWV4X5JfmQMkVJwChTZ7RfhWZG55if7rOk7wCCGIczwVrcycT2k8uFmRAKugTpRZG1xy33elsEl1PETmxmmvREqm4M=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
I'm trying to understand the difference between Coq's sum and sumbool when
applied to propositions. In particular, what are the benefits of using sumbool
over the use of (plain and simple disjoint) sum?
- both carry computational information
sumbool does not carry information usable outside of Prop.
I agree but am struggling to understand when sum and sumbool are applied to arguments of type Prop. In this case, it appears that both carry one bit of computational information: left or right, and the computational information of sum P Q (where P Q: Prop) isn't usable outside Prop, either.
Extraction Language Haskell.
Extract Inductive sumbool =>
"Prelude.Bool" [ "Prelude.True" "Prelude.False" ].
Right, sumbool is isomorphic to Bool, and sum to Either. The Prop witnesses
from the sumbool are erased in the extraction.
The same is true for Prop witnesses of sum, but Extraction slots in a dependency on the unit type. This doesn't happen for sumbool.
Differently put: assuming I'm not interested in extraction, could I replace "sumbool" by "sum" throughout (assuming I would be prepared to also do this in the libraries)?
Dirk.
- [Coq-Club] Difference between sum and sumbool, Dirk Pattinson, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, John Wiegley, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, Dirk Pattinson, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, Guillaume Melquiond, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, John Wiegley, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, Dirk Pattinson, 08/25/2015
- Re: [Coq-Club] Difference between sum and sumbool, John Wiegley, 08/25/2015
Archive powered by MHonArc 2.6.18.