Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] rewrite ... at ...

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] rewrite ... at ...


chronological Thread 
  • From: Aaron Bohannon <bohannon AT cis.upenn.edu>
  • To: Brandon Moore <brandon_m_moore AT yahoo.com>
  • Cc: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] rewrite ... at ...
  • Date: Tue, 8 Feb 2011 20:00:22 -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; b=tx/mEvo0rQPc5Pqr2gK7sSEruZQ5J28t9M+lqZF6xkQZ2FqWJ9cV9Gb8qg2AoITjqG J4pN3iRkOISb8eTqKEwiJAaa/JmT11+RagZLkl3KaFC7HUPWDRHGLQDmKZBayYeBgKJv vZ2IJDSC19QBC4d3EhRxRIu2JQQl/5aSjgs80=

On Tue, Feb 8, 2011 at 5:54 PM, Brandon Moore 
<brandon_m_moore AT yahoo.com>
 wrote:
> I just noticed arguments with underscores are allowed.
> "rewrite <- app_nil_l (x2::_)." will target the second instance.
> I think this would usually be almost as compact as using
> numbers, and much easier to read and write.

Ah, OK.  Thanks for the partial explanation and this tip.  I was
unfortunately in the situation where I have "P (e1 :: nil) (e2 ::
nil)" with e1 and e2 being very large expressions that are almost
identical except for deeply nested subterms.  It seems that, without
out a clearly specified semantics for pattern positions, the most
succinct, non-fragile way to do the rewrite is something like this...

assert (H := forall l1 l2, P (nil ++ l1) l2 -> P l1 l2)
  by (intros; replace l1 by (nil ++ l1) by app_nil_l; trivial).
apply H.

 - Aaron



Archive powered by MhonArc 2.6.16.

Top of Page