Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] non-automatic type class resolution

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] non-automatic type class resolution


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] non-automatic type class resolution
  • Date: Thu, 1 Sep 2016 19:38:17 -0400
  • 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-f175.google.com
  • Ironport-phdr: 9a23:1PxlGRI4w0AHTwB3uNmcpTZWNBhigK39O0sv0rFitYgXLfjxwZ3uMQTl6Ol3ixeRBMOAuqsC1rCd6PqoGTRZp83e4DZaKN0EfiRGoPtVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaymUrLV2s+wzqW5/4DZSwROnju0J71ofzusqgCElM4QiJdiI6B57hbIvHZOZ6wCx2RuJFGemxvxzsi19Z9ntS9XvqRypIZ7TazmcvFgHvRjBzM8PjVt6Q==



On 09/01/2016 07:19 PM, Vadim Zaliva wrote:
Sometimes I wish I can avoid automatic typeclass resolution and make it
generate sub-goals for all unresolved type class instances. Then I can
proceed and prove them manually, instead of using Hints, etc. Something
like 'unshelve':

The following example:

Class A (n:nat) : Prop.
Definition f (n:nat) `{A n} := n.
Definition g (n:nat) := n.
Lemma Foo: forall x, f (g x) = x.

In absence of:

Instance A_g: forall x, A (g x).

gives me:

Error:
Unable to satisfy the following constraints:
In environment:
x : nat

?H : "A (g x)"

And I could not proceed with the proof. Why couldn't it just generate a
sub-goal for A (g x) ?

Is there is a way to achieve this behavior in current version?

Is this sufficient?:

Class A (n:nat) : Prop.
Definition f (n:nat)`{A n} := n.
Definition g (n:nat) := n.

Lemma Foo: exists w, forall x, @f (g x) (w x) = x.
unshelve eexists.

-- Jonathan





Archive powered by MHonArc 2.6.18.

Top of Page