Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Automatically unfolding simple definitions

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Automatically unfolding simple definitions


chronological Thread 
  • From: Sean Wilson <sean.wilson AT ed.ac.uk>
  • To: Coq-Club <coq-club AT pauillac.inria.fr>
  • Subject: [Coq-Club] Automatically unfolding simple definitions
  • Date: Thu, 10 Jul 2008 15:11:56 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
  • Organization: School of Informatics, The University of Edinburgh

Hi,

I'm writing some automated tactics and want to check if there is a reduction 
tactic that can simplify the current goal in a certain way. It's sometimes 
useful to use definitions as shorthands for common expressions e.g.

Definition permutation x y := forall n, count n x = count n y.

In my domain, it is normally required that all 'simple' definitions like this 
(i.e. non-recursive functions) be unfolded first for my automation to work. 
As a simple example of what I need, given this definition:

Definition f x y := plus x y.

The following is true:

Goal forall x y, f x y = f y x.

My proof automation can prove this goal but only if "f" is unfolded first. 
I've tried various combinations to have this done automatically (i.e. I don't 
want to have to tell it what to unfold explicitly) but I cannot find a 
suitable reduction tactic. The closest I've found is compute which gives 
this:

forall x y : nat,
(fix plus (n m : nat) : nat := match n with
                               | 0 => m
                               | S p => S (p + m)
                               end) x y =
(fix plus (n m : nat) : nat := match n with
                               | 0 => m
                               | S p => S (p + m)
                               end) y x

I can then "fold plus" to get the simplification I want:

forall x y : nat, x + y = y + x

However, I'd like a tactic that does this automatically. Is there a tactic 
that can do unfolding like this without me having explicitly name 
definitions? Perhaps there is a way to automatically fold up goals 
containing "fix plus" like terms? Even a function only available in OCaml 
would be suitable.

Thanks,

Sean





Archive powered by MhonArc 2.6.16.

Top of Page