coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Matthieu Sozeau <mattam AT mattam.org>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] question about Existing Class
- Date: Wed, 29 Jun 2016 16:38:39 +0000
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f47.google.com
- Ironport-phdr: 9a23:cEx3Hhf7bNjv3PDF7AWsXqxHlGMj4u6mDksu8pMizoh2WeGdxc68Zx7h7PlgxGXEQZ/co6odzbGH6+a5BCdRsN6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JXvkbnvsMyCKyxzxxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjN92Mq+nh7aBSCL+3FUBm4Ri19DBxXPxBD8RJb49CXg4LlTwi6faOj/Uaw0WDm/p5xsWhLhlW9TMjcl7GjSosl5kL5SpVSmvRMpkN2cW52cKPcrJvCVRtgdX2cUG58JDyE=
Hi Jonathan,
short answer is not currently. I would advise to make an abbreviation class eqC instead. The fact that local hypotheses of
typeclass type are automatically considered for resolution is a feature. It could be an option of individual class declarations
to not do that: only explicit Instances/Existing Instances for that class would be considered. We'd certainly need to devise a
way to declare when a local binder (in fun (x : C foo) y => t) or a goal hypothesis (e.g. after intro H) should be considered though.
Best,
-- Matthieu
On Wed, Jun 29, 2016 at 6:09 PM Jonathan Leivent <jonikelee AT gmail.com> wrote:
On 06/29/2016 11:33 AM, Jonathan Leivent wrote:
> I just debugged an infinite loop in typeclass eauto that was
> apparently due to Existing Class causing instances created afterwards
> to become Existing Instances, even if not explicitly declared as
> such. I had declared "Existing Class eq", and really only wanted a
> very few cases of eq to be considered instances, but some later
> equalities automagically became instances (I can see them via Print
> Hints in the typeclass_instances db).
>
> First of all - is this a feature or a bug? Secondly, if a feature, is
> there a way to turn it off, at least for particular Classes?
>
> -- Jonathan
>
>
Hmmm... maybe it only happens with Axioms, Variables, Hypotheses, etc.?:
Existing Class eq.
Variable T : Type.
Variable eqT : forall a b : T, a = b.
Print HintDb typeclass_instances.
(* prints:
Discriminated database
Unfoldable variable definitions: all
Unfoldable constant definitions: all
Cut: emp
For any goal ->
For eq -> apply eqT(level 0, id 0)
*)
But - still - is there a way to turn this off?
-- Jonathan
- [Coq-Club] question about Existing Class, Jonathan Leivent, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Matthieu Sozeau, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jason Gross, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jason Gross, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/30/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Matthieu Sozeau, 06/29/2016
- Re: [Coq-Club] question about Existing Class, Jonathan Leivent, 06/29/2016
Archive powered by MHonArc 2.6.18.