Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] specialize a subset of the parameters of a hypothesis

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] specialize a subset of the parameters of a hypothesis


Chronological Thread 
  • From: Pierre Courtieu <pierre.courtieu AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] specialize a subset of the parameters of a hypothesis
  • Date: Fri, 8 Jan 2016 19:03:48 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f45.google.com
  • Ironport-phdr: 9a23:5uvqCBKVtEiC/Xgzb9mcpTZWNBhigK39O0sv0rFitYgULf3xwZ3uMQTl6Ol3ixeRBMOAu6wC07KempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRMiK14ye7KObxd76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LRAghZksy/YXAsQTJBV+E4WJZWWELmDJJBRLE5Vf0RMGinDH9s79F2SSAJ8C+ZrcpQyij4rojHAfphT0dOngy93zNls19kYpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEEnUZWo4=

Thanks for the answers. This is also the solution I came up with, more
or less. But what one really want is to use the unification stuff
during the process, so that instantiating one argument also
instantiates some other (prvious) arguments.

Suppose you have

H0: Q a b c
H: forall x t y z, P x t -> Q x y z -> R.
======
...

Then "specialize with (2:=H0)" should actually instantiate x y and z:
H0: Q a b c
H: forall t, P a t -> R.
======
...

P.



2015-12-23 19:15 GMT+01:00 Gregory Malecha
<gmalecha AT cs.harvard.edu>:
> Hi, Pierre --
>
> I had a half-completed email with the same solution. I'm not familiar with
> any tactic that would let you do this in general, though I imagine there is
> a horrible implementation that looks something like:
>
> Ltac specialize_n H n v :=
> match n with
> | 2 => first [ specialize (H _ v) | specialize (fun x => H x v) ]
> | ...
> end.
>
> The general solution seems like it would require a plugin, but someone else
> might have a cleaner solution.
>
> On Wed, Dec 23, 2015 at 10:10 AM, Abhishek Anand
> <abhishek.anand.iitg AT gmail.com>
> wrote:
>>
>> Here is a workaround that I use.
>>
>> Goal False.
>> assert (forall (A B C:Type), A->B->C) as H by admit.
>> specialize (fun A a C => H A nat C a O).
>>
>>
>>
>>
>> -- Abhishek
>> http://www.cs.cornell.edu/~aa755/
>>
>> On Wed, Dec 23, 2015 at 10:36 AM, Pierre Courtieu
>> <Pierre.Courtieu AT cnam.fr>
>> wrote:
>>>
>>> Hi,
>>>
>>> [specialize] is kind of useful but it needs a list of concrete terms
>>> for a *prefix* of list of premisses of a hypothesis.
>>>
>>> AFAIK you cannot give only, say, 3rd and 5th arguments. Sometime this
>>> would be useful (because the hypothesis has independent premisses and
>>> no particular order in the hyps is better than another).
>>>
>>> Is there something to do so? I have a Ltac piece of code which does
>>> roughly this in a naive way, but it is limited to one argument at a
>>> time.
>>>
>>> Idealy I would like to write:
>>>
>>> generalize H with (x:=0) (3:=H2)(5:=H6).
>>>
>>> Is this creatively hackable in ltac :) ?
>>>
>>> Best regards,
>>> Pierre
>>
>>
>
>
>
> --
> gregory malecha
> http://www.people.fas.harvard.edu/~gmalecha/



Archive powered by MHonArc 2.6.18.

Top of Page