Skip to Content.
Sympa Menu

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

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] non-automatic type class resolution


Chronological Thread 
  • From: Vadim Zaliva <vzaliva AT cmu.edu>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] non-automatic type class resolution
  • Date: Thu, 1 Sep 2016 16:19:29 -0700
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=vadim.zaliva AT west.cmu.edu; spf=Pass smtp.mailfrom=vadim.zaliva AT west.cmu.edu; spf=None smtp.helo=postmaster AT mail-wm0-f49.google.com
  • Ironport-phdr: 9a23:HF/HaBY7mJNWAL1BkJnMEj3/LSx+4OfEezUN459isYplN5qZpsq8bnLW6fgltlLVR4KTs6sC0LuP9f26EjZeqdbZ6TZZL8wKD0dEwewt3CUeQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2a3IyL0LW5/ISWaAFVjhK8Z6lzJVO4t1b/rM4T1LVrJqc0ginApnpWcqwC23FhIVONlj7349r28ZJ+pXcD88k9/tJNBP2pN58zSqZVWWwr

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?

Vadim


--
CMU ECE PhD candidate




Archive powered by MHonArc 2.6.18.

Top of Page