Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] multiple typeclass instance question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] multiple typeclass instance question


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] multiple typeclass instance question
  • Date: Wed, 9 Mar 2016 20:28:40 -0500
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f178.google.com
  • Ironport-phdr: 9a23:2TNLZhCahOCrS3KBc/M1UyQJP3N1i/DPJgcQr6AfoPdwSP74rsbcNUDSrc9gkEXOFd2CrakU1KyG7Ou6CSQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTokbDtsMeDKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxeL19RrhFBhwnNXo07Yvlr0rtVwyKs1kbVGwKkhNOSyzI7Q/3WIu55in9sOt+1S2XMOX5SLk1XXKp6KI9G0ygszsOKzNsqDKfscd3lq8O+B8=



On 03/09/2016 08:15 PM, Jonathan Leivent wrote:


On 03/09/2016 08:05 PM, Matthieu Sozeau wrote:
You are basically asking for putting the pretyper in the tactic monad
here, so that refine could return multiple successes, right?

I wouldn't restrict it to "refine", if that's what you are implying. Actually, I'm not sure what you're implying.:-[ So, maybe this will clarify my request:

Class Foo : Type := { value : nat }.

Instance foo_a : Foo := {value := 42}.

Instance foo_b : Foo := {value := 7}.

Goal value = 7.
reflexivity.
Qed.

Goal value = 42.
Fail reflexivity.

Could this second goal be provable as well?

No - I can see that won't ever work. The implicit Foo argument of value is already filled in as foo_b. OK - then I guess I'm really talking about this goal:

Goal exists f, @value f = 42.

in which case, making refine see multiple successes would work, via "refine (ex_intro _ _ _); reflexivity.".

Although, it would be interesting if the "Goal value = 42" were actually interpreted roughly as "Goal exists f, @value f = 42." In other words, delaying the implicit arg somehow.

-- Jonathan




Archive powered by MHonArc 2.6.18.

Top of Page