comp.lang.ada
 help / color / mirror / Atom feed
From: vincent.diemunsch@gmail.com
Subject: Re: The future of Spark . Spark 2014 : a wreckage
Date: Wed, 10 Jul 2013 05:19:52 -0700 (PDT)
Date: 2013-07-10T05:19:52-07:00	[thread overview]
Message-ID: <7ebe0439-fa4c-4374-a6c7-365ac78e6e39@googlegroups.com> (raw)
In-Reply-To: <krfb56$332$1@loke.gir.dk>


Hello Randy,

> I think existing Spark is evil, in that it funnels off effort best applied 
> to the entire Ada language (or at least, a much larger subset). Computers 
> are now powerful enough that the excuses for avoiding proofs of exceptions, 
> dynamic memory allocation, and the like no longer are valid.

Spark imposes static memory allocation to be able to prove total correctness,
which means that the program will always do what is expected, which is required
by embedded softwares... 


> The Globals notation is much more important. We tried to design such a 
> notation for Ada 2012, but it became too much work to complete and there was 
> a lot of concern about getting it wrong. So we left this for the "experts". 
> It appears that the experts are working on it, which is good, because we 
> still want this capability in the next version of Ada (whenever that will 
> be). And for that to be the case, we'll need it to have proper Ada syntax 
> using aspects.

Ada has been designed so as to let global variables be freely accessed. Only a pragma was used to specify that a function is Pure (of side effects) and can be skipped for optimisation. Therefore it is now almost impossible to change that and that is probably the reason why you had so much difficulties to define the global annotation, which is trivial, because how will you deal with a procedure that have no annotation, but still uses global variables ? A simple warning at compile time ? Refuse to compile ?

Aspects syntax is ugly. It is simply the return of a kind of primitive language like LISP, done with words and arrows. It shows clearly that it is simply a workaround.


> No, to allow *compile-time* analysis of pre and post conditions. An Ada 
> compiler cannot look into the body of a package to see what is there, and 
> without expression functions, almost no compile-time analysis could be 
> accomplished. (We also need globals annotations for similar reasons.) The 
> real end-game here ought to be compile-time proof (that is, proofs that are 
> created as part of the normal compilation of Ada code).

A proof can't be generated at compile time ! The proof must be written independently, based on formal specification, and checked by an analyser, that may or may not be the compiler.


> Proofs of any kind should never, ever depend on anything in the package body 

As others told you, a proof is a proof that the implementation respects the specification, therefore it needs to make an interpretation of the package body.

> Spark users are on a certain dead-end, IMHO. The future is getting proof 
> into the hands of all programmers, as a normal part of their day-to-day 
>  programming. That requires that proofs aren't necessarily complete, that 
> hey use whatever information is available, and most of all, that they only 
> depend on the specifications of packages (never, ever, on the contents of a 
>  body).

But you seem to make also the confusion between a test and a proof, and that is exactly what AdaCore is doing now : they simply write the tests as post-
conditions and uses symbolic interpretation during compile time. I think that is what you mention by "into the hands of all programmers", ie even those with very few theoretical background.

It's a nice feature to sell and great fun for compiler writers but it's far from a mathematical proof and what Spark was able to do. But mathematical proof requires formal specification and that is far from the "all programmers" knowledge. The problem is that recent books on Spark completly forgot to speak of the necessary formal specifications (like Z for instance).


To conclude here is my vision of Spark and Ada :
- use Ada for things that are necessary for the compiler to produce the code and to express the semantic of the program.
- use Pragmas only as compiler directives, for specific implementation or optimisation (InLine, Ravenscar, Remote-Call-Interface...). Not for assertion, tests or whatever.
- everything that is related to formal verification should stay as comment in
the code. These comments can then be verified by external tools. There can be different levels of verification, not only the Spark vision.
- formal specifications are necessary for formal verification, therefore Spark should be able to make the link between formal annotations and formal specification.
- tests can be put either as comments or as external files, but please not as aspects. It is ugly to write the detail of a procedure in the spec.


Forget Aspects and worst expression functions : they are simply an error.
Mixing testing, specification and proofs as pragma or aspects or a combination of both of them will result in a too complicated language lacking of abstraction and a proper syntax.

Regards 

Vincent



  parent reply	other threads:[~2013-07-10 12:19 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 17:56 The future of Spark . Spark 2014 : a wreckage vincent.diemunsch
2013-07-08 19:24 ` Simon Wright
2013-07-08 20:59 ` Florian Weimer
2013-07-09  7:40   ` Dmitry A. Kazakov
2013-07-09  8:30     ` Georg Bauhaus
2013-07-09  8:58       ` Dmitry A. Kazakov
2013-07-09 10:27         ` G.B.
2013-07-09 11:13         ` G.B.
2013-07-09 15:14     ` Adam Beneschan
2013-07-09 22:51     ` Robert A Duff
2013-07-10  7:49       ` Dmitry A. Kazakov
2013-07-10  8:21         ` Georg Bauhaus
2013-07-08 21:32 ` Randy Brukardt
2013-07-09  7:28   ` Dmitry A. Kazakov
2013-07-09 11:29     ` Simon Wright
2013-07-09 12:22       ` Dmitry A. Kazakov
2013-07-09 20:37     ` Randy Brukardt
2013-07-10 10:03       ` Dmitry A. Kazakov
2013-07-10 23:21         ` Randy Brukardt
2013-07-11  7:44           ` Dmitry A. Kazakov
2013-07-11 22:28             ` Randy Brukardt
2013-07-12  8:02               ` Dmitry A. Kazakov
2013-07-12 21:16                 ` Randy Brukardt
2013-07-14 10:19                   ` Dmitry A. Kazakov
2013-07-14 15:57                     ` Georg Bauhaus
2013-07-16  0:16                       ` Randy Brukardt
2013-07-17  1:30                         ` Shark8
2013-07-17 23:08                           ` Randy Brukardt
2013-07-18  7:19                             ` Dmitry A. Kazakov
2013-07-19  4:36                               ` Randy Brukardt
2013-07-16  0:13                     ` Randy Brukardt
2013-07-16  8:37                       ` Dmitry A. Kazakov
2013-07-16 22:13                         ` Randy Brukardt
2013-07-17  7:59                           ` Dmitry A. Kazakov
2013-07-17 23:26                             ` Randy Brukardt
2013-07-18  7:37                               ` Dmitry A. Kazakov
2013-07-19  4:32                                 ` Randy Brukardt
2013-07-19  7:16                                   ` Dmitry A. Kazakov
2013-07-20  5:32                                     ` Randy Brukardt
2013-07-20  9:06                                       ` Dmitry A. Kazakov
2013-07-12  1:01           ` Slow? Ada?? Bill Findlay
2013-07-09  7:57   ` The future of Spark . Spark 2014 : a wreckage Stefan.Lucks
2013-07-09 20:46     ` Randy Brukardt
2013-07-10  8:03       ` Stefan.Lucks
2013-07-10 12:46         ` Simon Wright
2013-07-10 23:10         ` Randy Brukardt
2013-07-11 19:23           ` Stefan.Lucks
2013-07-12  0:21             ` Randy Brukardt
2013-07-12  9:12               ` Stefan.Lucks
2013-07-12 20:47                 ` Randy Brukardt
2013-08-05  5:43                 ` Paul Rubin
2013-07-10 12:19   ` vincent.diemunsch [this message]
2013-07-10 16:02     ` Simon Wright
2013-07-11  0:36     ` Randy Brukardt
2013-07-11  6:19       ` Simon Wright
2013-07-11 23:11         ` Randy Brukardt
2013-07-11 10:10       ` vincent.diemunsch
2013-07-11 14:23         ` Dmitry A. Kazakov
2013-07-12  0:07           ` Randy Brukardt
2013-07-12  0:00         ` Randy Brukardt
2013-07-12  7:25           ` Simon Wright
2013-07-12 20:07             ` Randy Brukardt
2013-07-12 14:23           ` Robert A Duff
2013-07-12 20:14             ` Randy Brukardt
2013-07-11 23:50       ` Shark8
2013-07-08 23:18 ` Peter C. Chapin
2013-07-09  7:34   ` Stefan.Lucks
2013-07-09 15:21     ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox