Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] meaning of formal specifications

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] meaning of formal specifications


Chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] meaning of formal specifications
  • Date: Tue, 26 Jan 2021 19:38:22 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=adamc AT csail.mit.edu; spf=Pass smtp.mailfrom=adamc AT csail.mit.edu; spf=None smtp.helo=postmaster AT outgoing-stata.csail.mit.edu
  • Ironport-phdr: 9a23:Mzf6wB1RS8oi8d3ysmDT+DRfVm0co7zxezQtwd8ZseIfLPad9pjvdHbS+e9qxAeQG9mCurQe1KGO7OigATVGvc/e9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+IA+5oAnMssQam5VuJ6Q+xhfVoHZDZuBayX91KV6JkBvw+8W98IR//yhMvv4q6tJNX7j9c6kkV7JTES4oM3oy5M3ltBnDSRWA634BWWgIkRRGHhbI4gjiUpj+riX1uOx92DKHPcLtVrA7RS6i76ZwRxD2jioMKiM0/3vWisx0i6JbvQ6hqhliyIPafI2ZKPxzdb7bcNgHR2ROQ9xRWjRcDI2iYYsBD+kPM+hWoIbypVQBsQCzChOwCO710DJEmnH70K883u88EQ/GxgsgH9cWvXnIsdr6LqISWv2rwanIyTXDbutW1i356IfSbxsspuuDUq9qfsrU1UYiDB/Kjk6KpozkOzOZzOENs2mH7+Z6S+2glnMnphh3rzOyycgilpPHiZgJylDY6yp52oA1KMWkRUJnYtOpDZRduSGHOoV2Q84vR2VltDo1xLAap5O2fycExIgpyhPfaPGLb5SE7xPsWuiRITp2hG5oda6/ihux90Wr1+PyVs6x0FlQrypFlMHBtm0V1xPN7MiHTOFx8Vm81jaS0Q3Y9+JKIVgsmKbGNZIswaQ8m5QPvUjZACP6glv6gLKKekk8+OWl5f7rbqv7qpKYLYN5iwHzPr4zlsChHeg1NBUFUXKB9uSmzrLj+FX0QLVUgf0ylanUqJfaJdkHpq62BA9V04Aj6xmmAze9zNQXh2UHI0hfdB2blIjmIVDOIPTiAfe6glSsjC1nyO7bMb38GpnNL37Dn6n9fbtl9kJQ1gk+wcpR6p5IEL0NPuj/VlHsuNDEFhM5Nha7w+fjCNVzzIMeXmePD7eDP6zPq1CI4/4gLvKQa48Oojn9Kvwl6+TrjX84hV8RZ7em0oYKaHygBPRpP12ZYWbwgtcGCWoFog0+TPXzhFKeVT5Tem29Urkn5jA7DYKmFZ3MSpqsgLyHxie7H4dZanpIClCWQj/UcNCPXO5JYyaPKOdglCYFXP6vUdwPzxar4Sb2wr8vBerQ+zURsZurgNF57ujYvRop/D1wScGczyeAQ3wizTBAfCM/wK0q+R818VyEy6Ut26UJR+wW3OtAV0IBDbCZyuV7D97oXQeYI4WCU1+nRpOjAC13Q94skYZXPxRNXu66hxWG5BKERqcPnuXWVpcv+6PYmX3wO4Bwx2uUjPB83WljedNGMCidvoA69wXXANWRwUKEi6mtdKITmTXR/XuKi2GVtUBcFgtxTePIUW1NPkY=

I would say that kind of easy classification only makes sense for a specific proof.  The dependent type you selected could easily also be the implementation side of another verification, maybe starting from just asking for a number relatively prime to an input, without initially requiring that that other number be a full-scale prime itself.

On 1/25/21 1:16 PM, Vincent Semeria wrote:
Could we defend that the specification is the type, and the implementation is the proof ?

For example the theorem of decomposition into prime numbers,
forall n:nat, { p:nat, Prime p  /\  n mod p = 0 }
This is a type of functions in Coq, saying that for all natural number n, there exists a natural number p such as p is prime and p divides n. This can also be read as a specification : "for a natural number n, find me a number p such as p is prime and p divides n". And now the proof of this theorem is a term of the above type. If this term is coded in Coq without axioms, it is also an algorithm that computes the number p in question, so it is an implementation of the specification.

On Mon, Jan 25, 2021 at 6:13 PM Xavier Leroy <Xavier.Leroy AT inria.fr> wrote:
On Mon, Jan 25, 2021 at 4:39 PM Fritjof <fritjof AT uni-bremen.de> wrote:
Hi,

I have a question regarding what formal specification exactly means in the
proof assistant context.

First *formal verification* means an implementation satisfies its formal specification.
The satisfiability is shown using formal methods of mathematics, e.g., a constructed proof
in Coq.

So we have the following terms:

1) implementation
2) formal specification
3) constructed proofs

In the context of proof assistants, e.g., Coq, I would describe:

1) implementation - as the *program*, collection of function definitions and data types
2) formal specification - as the properties that argue about the program, e.g., theorems, lemmas or axioms
3) constructed proofs - statements of the LTac language

(or any other way to construct proof terms, by the way.)

I agree with your description above.

However, I have also read that the implementation part is referred to as a formal specification:
- https://www.cis.upenn.edu/~bcpierce/papers/pierce-etaps2018.pdf

or the combination of 1,2 and 3 is referred to as a formal specification, like in: a program in haskell
is extracted from this formal specification.

In a stepwise refinement approach (which the DeepSpec project is, to some extent), the implementation of refinement step N is the specification of step N+1. 
 
Maybe code extraction / automatic code generation is not the best example of a refinement step, causing some confusion in terminology.

Hope this helps,

- Xavier Leroy



Am I right, that the term *formal specification* often donetes the combination of 1,2 and 3, or just 1
or am I  missing something?

Kind Regards,
fritjof





Archive powered by MHonArc 2.6.19+.

Top of Page