Skip to Content.
Sympa Menu

coq-club - Re: Parameters in "Definitions"?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: Parameters in "Definitions"?


chronological Thread 
  • From: Bruno Barras <Bruno.Barras AT cl.cam.ac.uk>
  • To: "Randy Pollack" <rap AT dcs.ed.ac.uk>
  • Cc: coq-club AT pauillac.inria.fr, Bruno.Barras AT cl.cam.ac.uk
  • Subject: Re: Parameters in "Definitions"?
  • Date: Mon, 15 Feb 1999 17:52:31 +0000


Hello Randy,


> As a functional programmer I like to write, e.g.
> 
> (1)   plus (n,m:nat) : nat = ...
> 
> rather than
> 
> (2)   plus : nat->nat->nat = \n:nat.\n:nat. ...
> 
> In Coq, the "Fixpoint" definition lets one write (1) instead of (2).

to avoid redundancy, you could write

Definition plus : nat->nat->nat := [n;m] ...

but I agree this is not as readable as what you would expect.
Anyway, as you have noticed, the Fixpoint notation is more friendly.
So, you can do

Fixpoint plus [n,m:nat]: nat := ...

If your definition is indeed not recursive, it will not generate the
useless fixpoint operator and it behaves like a definition.

> The notation I want almost exists, by using a Fixpoint with a dummy
> boolean argument.

I don't understand why you need this extra argument...

Bruno.







Archive powered by MhonArc 2.6.16.

Top of Page