coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Aaron Bohannon <bohannon AT cis.upenn.edu>
- To: St�phane Lescuyer <stephane.lescuyer AT inria.fr>
- Cc: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] naming seems broken in inversion tactic
- Date: Fri, 18 Feb 2011 15:17:06 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=xqAlol1akxD3UZ/jQbim0h2r/ZrDD3R7TfsX5VFGaBdHtVsYnlpa9Q6GCGN58IRXSn qzTz9jJ/HdiAt3CzJVxo/ZsJDfYxzBNKC4QIQVZeVQcBNwjnVT7TBvsAklzJxwGiJZny uIYz6pMalEVDSR2dmF5bXiS10Wgi119eDNAwo=
Yeah, naming non-dependent products is not a bad idea, but in many of
my developments, I like to keep my hypothesis names under tighter,
more local control.
- Aaron
2011/2/18 Stéphane Lescuyer
<stephane.lescuyer AT inria.fr>:
> Hi Aaron,
>
> I would definitely call that a bug, or at least disturbing behaviour.
> Over the years, I have come to almost systematically name the
> non-dependent products in inductives on which I use inversion a lot,
> in that case something like:
>
> Inductive G: option A -> Prop :=
> | G_Some: forall a (HG_F : F a), G (Some a)
> | G_None: G None.
>
> It doesn't solve the issue of hypothesis' naming as a whole, but it's
> quite nice to know that hypotheses resulting from inversions will be
> named in a systematic fashion, and being able to tell instantly where
> an hypothesis comes from just by looking at its name.
>
> Stéphane
>
> On Fri, Feb 18, 2011 at 8:10 PM, Aaron Bohannon
>Â <bohannon AT cis.upenn.edu>
> wrote:
>> Hi,
>>
>> The "inversion" tactic can take a pattern for the names of the
>> hypotheses it generates. However, its treatment of names does not
>> seem "hygienic" to me. Consider the following code:
>>
>> <coq>
>>
>> Parameter A: Set.
>> Parameter F: A -> Prop.
>>
>> Inductive G: option A -> Prop :=
>> | G_Some: forall a, F a -> G (Some a)
>> | G_None: G None.
>>
>> Lemma example:
>> forall a, G (Some a) -> F a.
>> Proof.
>> intros a H.
>> (* tactic A:
>> inversion H as [a1 J1 Heq1 | ]. *)
>> (* tactic B:
>> inversion H as [a1 J1 | ]. *)
>> (* tactic C:
>> inversion H as [a1 H1 | ]. *)
>> Admitted.
>>
>> </coq>
>>
>> In Coq 8.3, I observe the following behavior: After tactic A, the
>> hypothesis I'm interested in will be named "J1". After tactic B, the
>> hypothesis I'm interested in will be named "J1". After tactic C, the
>> hypothesis I'm interested in will be named "H0" (because inversion
>> uses "H1" for the equation). Is this something that we can agree to
>> call a bug? It would at least be better for tactic C fail than have
>> it silently ignore the names given in the pattern, right?
>>
>> - Aaron
>>
>
>
>
> --
> I'm the kind of guy that until it happens, I won't worry about it. -
> R.H. RoY05, MVP06
>
- [Coq-Club] naming seems broken in inversion tactic, Aaron Bohannon
- Re: [Coq-Club] naming seems broken in inversion tactic,
Stéphane Lescuyer
- Re: [Coq-Club] naming seems broken in inversion tactic, Aaron Bohannon
- Re: [Coq-Club] naming seems broken in inversion tactic,
Stéphane Lescuyer
Archive powered by MhonArc 2.6.16.