Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] strings.

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] strings.


Chronological Thread 
  • From: Daniel Schepler <dschepler AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] strings.
  • Date: Thu, 8 Nov 2018 10:40:38 -0800
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dschepler AT gmail.com; spf=Pass smtp.mailfrom=dschepler AT gmail.com; spf=None smtp.helo=postmaster AT mail-ot1-f43.google.com
  • Ironport-phdr: 9a23:0laimxxmvEPu4CTXCy+O+j09IxM/srCxBDY+r6Qd1OIfIJqq85mqBkHD//Il1AaPAd2Eraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HRbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CSmVBUMReWSxPDI2/coUBEfYOM+lDoonhvlsDtweyCRWwCO7tzDJDm3/43bc90+QkCQzI0hYvH9QPsHvKqNX+KbocXvy1zKbW1TXDa+1Z2S3g44XPbx8huu2DXbJufsrJzUkgCRnFg06fqYzgJTyV1+ANv3KH4OpnUOKikmgqoBx/rDiow8cjkIjJhoQNx1DL9CV53IY1JcCjR0JhfdGkF55QuieHPIV1WsMvW39ktDo+x7EcupO2fDIGxIo6yxLDcfCKfIaF7xT+X+iLOzh4nmhqeLenihay70egzur8W9Gx0FlQrypFlsDAtncR1xDO88SHRPRw80m71TaA0ADT7e5EIUQqmqbBN5EhxbswmoISsUTFACD2hF37gLGKekgg4OSl6OTqbq/4qpOBK4N4kA7zP6o2lsy6G+s4MwwOX2aB+eS70b3u5VD2QK5Wgf02jKbZqJTaKtoBpqOiDA9V15ws6xe7Dzu8zNsYmnwHIEpfeB2bl4jpJ03OIPfgAPijhFSsiS5nyOzCPr38GZrANWPDkbfkfbZl8UFQ0gszzdZF55JVEL4NOvzzWlWi/ODfWzQ+KkSfx/vtQIF20ZpbUmaSCIeYNrnTuBmG/LR8DfOLYdo5sTD8Jvxt3PXugGc9lEVVKaWy1psacHS1BNxpJkyYZTznhdJXQjRChRY3UOG/0A7KajVUfXvnGvtkvmhqWrLjNp/KQ8WWuJLE2S66GpNMYWUfUwKDFH7pc8OPXPJeMXvOcP8kqSQNUP2ac6FkzQun7VaoxL9uL+6S8Sod58q6iYpFotbLnBR3zgRaSsSQ12bXEjNxl2IMAjgqheVx/Rc7xVCE3qx1xfdfEI4L6g==

On Thu, Nov 8, 2018 at 5:04 AM Théo Zimmermann
<theo.zimmi AT gmail.com>
wrote:
> You may or may not be aware of the existence of a project to design a
> new standard library (without backward compatibility):
> https://github.com/coq/stdlib2

I took a look at the project; however, I found the current layout
confusing and I'm not sure where I would submit a "possible feature
discussion" request. Of course, maybe a bug tracker might not be the
best place for such discussions.

Anyway, something I've been thinking of for a while that would be
useful would be if the standard library (either as an extension to the
current one, or in the new one) had an integrated "decidable
proposition" typeclass, something like:

Class Decision (P : Prop) : Type :=
decide : {P} + {~P}.
Arguments decide P [Decision].

And then wherever a proposition should be decidable, the library would
declare an instance of Decision for it - with dependencies on
decidability for subpropositions as needed, of course.

It could also be nice to then add a "decide" tactic which simply tries
to find a decidability instance for the current goal and then evaluate
to either extract a proof, or give an error that the decision
procedure gave a false result.

I've also thought that this could be greatly enhanced by a
"combinatorics" type of functionality. So, for example, if it were
asked to decide "forall x y : bool, andb x (orb x y) = x" then it
would first search for an "exhaustive listing" instance for bool, then
use that to test all possible values of x and y against a decision
instance for @eq bool. And possibly, if it were asked to decide
something like "forall n : N, n < 100 -> P n" or "exists n : Z, -100 <
n /\ n < 100 /\ P n" then it could first search through the
proposition for an a priori bound on the values which need to be
tested.

Then, of course, decidability could feed back into combinatorics - for
example, it could do a brute force calculation of # { n : N | n < 100
/\ Prime n } using an a priori bound search and then a decision
instance for Prime to list out the elements of the sigma-type
internally and then count the length of the list. (Though this last
one would depend on whether a new standard library would use setoids
widely or not, in the way that e.g. MathClasses does...)

(I'm not insistent on using sumbool, though it tends to be my personal
preference. I would also be OK with
Class Decision (P : Prop) : Type :=
decide : bool.
Arguments decide P [Decision].
Class DecisionCorrect (P : Prop) `{!Decision P} : Prop :=
decision_correct : P <-> (decide P = true).
if it helps with efficiency of evaluating decision procedures, and/or
we want maximal abstraction of the proof resulting from the "decide"
tactic to "match (decision_correct P) with | conj _ H => H (eq_refl
true) end" as opposed to a proof constructed piece by piece along the
decidability call chain.)
--
Daniel Schepler



Archive powered by MHonArc 2.6.18.

Top of Page