Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Destruct vs. inversion

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Destruct vs. inversion


chronological Thread 
  • From: Nathan Collins <nathan.collins AT gmail.com>
  • To: "Benjamin C. Pierce" <bcpierce AT cis.upenn.edu>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Destruct vs. inversion
  • Date: Wed, 6 Apr 2011 18:35:00 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=a+zBAIterhNUFlN3OKAVfZpRc8j0L+iPJVlmS74C+l+kXKBYSf2woGuT09JGgN7Wvj IxE+jqWdUw/1EN592vOYSVfsexkVoFTFb1K/V05z/DMwHVmO3ZsdDsMpPlHdOSJo1nIe v97oMZSGwpr9c1+4V2+Aud97HRWSngIlWMXCg=

On Wed, Apr 6, 2011 at 9:50 AM, Benjamin C. Pierce
<bcpierce AT cis.upenn.edu>
 wrote:
> Dear Coq experts,
>
> Someone in my class asked a question about destruct vs. inversion: They can 
> be described in similar terms  ("generate subgoals for each of the possible 
> ways that such-and-such could have been built..."), and there are many 
> situations where either can be used; so what's the actual difference?
>
> Does anyone have a concise, intuitive way of explaining how they overlap in 
> function and how they differ, and/or a snappy characterization of when to 
> use one and when the other?

There is a nice discussion of some differences between inversion and
destruct (and induction), and some guidelines and gotchas, in chapter
4.4 (pages 72-3) of Adam Chlipala's CPDT [1].

Another difference is that destruct will work on a compound
expression, but inversion needs a name.  E.g. you can do

  destruct (f n)

to simplify

  match (f n) with ...

whereas

  inversion (f n)

is not allowed.

-nathan

[1] http://adam.chlipala.net/cpdt/




Archive powered by MhonArc 2.6.16.

Top of Page