coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Robbert Krebbers <mail AT robbertkrebbers.nl>
- To: coq-club <coq-club AT inria.fr>
- Subject: [Coq-Club] Apply without TC inference
- Date: Wed, 27 Jul 2016 00:41:37 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mail AT robbertkrebbers.nl; spf=None smtp.mailfrom=mail AT robbertkrebbers.nl; spf=None smtp.helo=postmaster AT smtp1.science.ru.nl
- Ironport-phdr: 9a23:T1jiZhxttrJ1xinXCy+O+j09IxM/srCxBDY+r6Qd0e4eIJqq85mqBkHD//Il1AaPBtSDrawYwLOP+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwud7yzRNKZ1p3//tvx0qWbWx9Piju5bOE6BzSNhiKViPMrh5B/IL060BrDrygAUe1XwWR1OQDbxE6ktY/jtKJkpi9Xorcq89NKGfHxeL19RrhFBhwnNXo07Yvlr0+QYxGI4y4mVW8cnwBUSyvf4RvwU43q+n//v+t58DOdN8f7V6w3Qzmo5apxU1nujHFUZHYC7GjLh5ko3+pgqxW7qkknzg==
Hi,
is there a variant of apply that does not invoke type class inference on the arguments of the applied lemma, but instead turns type class constraints into shelved subgoals so that these can be solved later.
The (undocumented) tactic "class_apply" seems to be doing somewhat what I like, but not entirely: it only turns type class constraints into shelved subgoals when the applied lemma is prefixed with an @. This is insufficient when used as part of the implementation of some Ltac tactic because I do not want the users of my tactic having to prefix their lemmas with an @.
I have included an example below.
Robbert
=========
Require Import Classes.Init.
Class C A := c : A.
Instance nat_C : C nat := 0.
Instance bool_C : C bool := true.
Lemma silly {A} `{C A} : c = c -> True.
Proof. auto. Qed.
Goal True.
apply silly. (* BAD: @eq bool (@c bool bool_C) (@c bool bool_C) *)
(* I only want TC inference to be invoked later,
for example when doing: *)
Fail apply (@eq_refl nat).
Restart.
eapply silly. (* BAD: @eq bool (@c bool bool_C) (@c bool bool_C) *)
Restart.
eapply @silly. (* BAD: @eq bool (@c bool bool_C) (@c bool bool_C) *)
Restart.
class_apply silly. (* BAD: @eq bool (@c bool bool_C) (@c bool bool_C) *)
Restart.
class_apply @silly. (* GOOD: @eq ?A (@c ?A ?H) (@c ?A ?H) *)
apply (@eq_refl nat). (* works *)
(* But can we also do it without the @ ? *)
- [Coq-Club] Apply without TC inference, Robbert Krebbers, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Robbert Krebbers, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jason Gross, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jason Gross, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jason Gross, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Robbert Krebbers, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jason Gross, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Matthieu Sozeau, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Jonathan Leivent, 07/27/2016
- Re: [Coq-Club] Apply without TC inference, Robbert Krebbers, 07/27/2016
Archive powered by MHonArc 2.6.18.