comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: GNAT packages in Linux distributions
Date: Wed, 12 May 2010 20:53:45 +0200
Date: 2010-05-12T20:53:46+02:00	[thread overview]
Message-ID: <4beaf93a$0$6875$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <1c8dan2pi7bm9.1os0h56b9fukv$.dlg@40tude.net>

On 12.05.10 20:33, Dmitry A. Kazakov wrote:

>> Being better is precisely the point (of DbC).
>> DbC talks about proof obligations, not about provability.
> 
> Who is obliged to whom in what?

By being a programmer subscribing to the principles of DbC,
you are obliged to show that the components of your system
obey the components' contracts.  The compiler and run-time
try to help you achieving this goal.


>>>> About expression now, although understandability of a source does not  
>>>> provide proof, this help to at least make partial assertions and discover  
>>>> what's wrong.
>>>
>>> No more than an appropriately placed if-statement, tracing call, debugging
>>> break point etc.
>>
>> You cannot place an "if" in a specification.
> 
> The answer was in my post. You have skipped out. OK, it was that exceptions
> from declarations is not a good idea. And considering it more deeply,
> Eiffel cannot do it either, because specifications are static things.

Which set of "specifications" has only static things in it?
Why exclude conditionals whose results cannot reasonably
be computed by the compiler but

(a) can be computed for every single case occuring in the
executing program

(b) can guide the author of a client of a DbC component?


For example, assume that Is_Prime(N) is a precondition of sub P.
Furthermore, TIME(Is_Prime(N)) >> PERMISSIBLE_TIME.
Then, still, PRE: Is_Prime (N) expresses an obligation,
part of a contract:  Don't call P unless N is prime,
no matter whether or not assertion checking is in effect.

(A DbC principle is that assertions are *not* a replacement
for checking input (at the client side).)




>> What is "breach of contract" in your world?
> 
> A case for the court.

What's the court (speaking of programs)?


>>> What Ada lacks is better contracts specified by the programmer only when he
>>> wishes to. E,g, exception contracts, statements about purity of a function,
>>> upper bound of stack use etc.
>>
>> Raising of exceptions is an integral part of DbC specs.
> 
> And buffer overflow is an integral part of C... I meant static contracts,
> statically checked, if that was not clear.

It wasn't clear to me that you wanted a mathematically closed structure
to be the only legitimate substance of "contract".
I'm a programmer.  If I "design" anything, it is a program whose
parts need to interact in a way that meets some almost entirely
non-mathematical specification.  I try to add some formality
to the whole thing.  This helps. I wish I had static type checking
for a start!



>> How would you specify
>>
>>    subtype Even is ...; ?
> 
> Ada's syntax is:
> 
>    subtype <name> is <name> <constraint>;


What will static <name> and static <constraint> be for subtype Even?




  reply	other threads:[~2010-05-12 18:53 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 17:40 GNAT packages in Linux distributions Dmitry A. Kazakov
2010-05-09 18:16 ` Ludovic Brenta
2010-05-09 19:36   ` Dmitry A. Kazakov
2010-05-09 21:26     ` Ludovic Brenta
2010-05-09 21:34       ` Yannick Duchêne (Hibou57)
2010-05-10  1:20         ` Ludovic Brenta
2010-05-10  1:26           ` Ludovic Brenta
2010-05-25 20:40             ` Yannick Duchêne (Hibou57)
2010-05-10  9:41         ` Stephen Leake
2010-05-10  9:46           ` Ludovic Brenta
2010-05-10 14:29             ` sjw
2010-05-11  7:51               ` Ludovic Brenta
2010-05-11  9:33                 ` sjw
2010-05-10 18:47           ` Yannick Duchêne (Hibou57)
2010-05-09 21:28     ` Yannick Duchêne (Hibou57)
2010-05-09 21:30       ` Yannick Duchêne (Hibou57)
2010-05-09 22:44       ` Simon Wright
2010-05-10  7:54         ` Dmitry A. Kazakov
2010-05-10  8:02       ` Dmitry A. Kazakov
2010-05-10 18:45         ` Yannick Duchêne (Hibou57)
2010-05-10 21:00           ` Ludovic Brenta
2010-05-10 22:17             ` Yannick Duchêne (Hibou57)
2010-05-11  6:56               ` Ludovic Brenta
2010-05-11  7:39           ` Dmitry A. Kazakov
2010-05-11  8:06             ` Yannick Duchêne (Hibou57)
2010-05-11 15:46             ` Pascal Obry
2010-05-11 16:05               ` Yannick Duchêne (Hibou57)
2010-05-11 16:09                 ` Pascal Obry
2010-05-11 16:09                   ` Pascal Obry
2010-05-11 17:08                     ` stefan-lucks
2010-05-11 16:39                       ` Yannick Duchêne (Hibou57)
2010-05-11 19:45                         ` Yannick Duchêne (Hibou57)
2010-05-11 23:44                           ` Yannick Duchêne (Hibou57)
2010-05-12 12:12                             ` Mark Lorenzen
2010-05-12 14:55                               ` Yannick Duchêne (Hibou57)
2010-05-11 17:35                       ` Pascal Obry
2010-05-11 18:06                         ` Yannick Duchêne (Hibou57)
2010-05-11 16:23                   ` Yannick Duchêne (Hibou57)
2010-05-11 16:41                     ` J-P. Rosen
2010-05-11 16:45                 ` Dmitry A. Kazakov
2010-05-11 19:21                   ` Yannick Duchêne (Hibou57)
2010-05-12  8:41                   ` stefan-lucks
2010-05-12 14:52                     ` Yannick Duchêne (Hibou57)
2010-05-12 15:59                       ` Phil Thornley
2010-05-12 16:49                         ` Yannick Duchêne (Hibou57)
2010-05-13  8:05                           ` Phil Thornley
2010-05-12 15:37                     ` Dmitry A. Kazakov
2010-05-12 16:06                       ` Yannick Duchêne (Hibou57)
2010-05-12 17:24                         ` Dmitry A. Kazakov
2010-05-12 18:09                           ` Georg Bauhaus
2010-05-12 18:33                             ` Dmitry A. Kazakov
2010-05-12 18:53                               ` Georg Bauhaus [this message]
2010-05-12 21:57                                 ` Dmitry A. Kazakov
2010-05-13  2:03                                   ` Georg Bauhaus
2010-05-13  8:39                                     ` Dmitry A. Kazakov
2010-05-14 23:45                                       ` Georg Bauhaus
2010-05-15  9:30                                         ` Dmitry A. Kazakov
2010-05-15 18:39                                           ` Georg Bauhaus
2010-05-15 20:33                                             ` Dmitry A. Kazakov
2010-05-15  0:17                             ` Robert A Duff
2010-05-15  9:40                               ` Dmitry A. Kazakov
2010-05-12 18:15                           ` Georg Bauhaus
2010-05-25 20:45                           ` Yannick Duchêne (Hibou57)
2010-05-26  7:55                             ` Dmitry A. Kazakov
2010-05-26  8:38                             ` stefan-lucks
2010-05-26  8:01                               ` Yannick Duchêne (Hibou57)
2010-05-26 11:25                               ` Yannick Duchêne (Hibou57)
2010-05-26 13:02                                 ` stefan-lucks
2010-05-26 12:22                                   ` Yannick Duchêne (Hibou57)
2010-05-27 12:47                                     ` stefan-lucks
2010-05-27 12:26                                       ` Yannick Duchêne (Hibou57)
2010-05-26 13:06                                   ` (see below)
2010-05-27 12:41                                     ` stefan-lucks
2010-05-27 12:29                                       ` Yannick Duchêne (Hibou57)
2010-05-27 15:21                                       ` (see below)
2010-06-03  3:16                                         ` Yannick Duchêne (Hibou57)
2010-06-03 10:42                                           ` Brian Drummond
2010-06-03 21:14                                             ` (see below)
2010-06-03 22:00                                               ` Britt Snodgrass
2010-06-03 22:29                                                 ` (see below)
2010-06-03 13:49                                           ` (see below)
2010-06-04 13:49                                             ` Georg Bauhaus
2010-06-04 13:53                                               ` Georg Bauhaus
2010-06-04 14:24                                               ` Yannick Duchêne (Hibou57)
2010-06-04 17:34                                                 ` Georg Bauhaus
2010-06-04 15:29                                               ` (see below)
2010-05-12 18:10                       ` stefan-lucks
2010-05-12 17:48                         ` Dmitry A. Kazakov
2010-05-13  0:37                           ` stefan-lucks
2010-05-13  9:09                             ` Dmitry A. Kazakov
2010-05-13  0:33                     ` Yannick Duchêne (Hibou57)
2010-05-10 14:15       ` GNAT Pro license (was: " Peter Hermann
2010-05-10  1:40 ` Björn Persson
2010-05-10  2:04   ` Yannick Duchêne (Hibou57)
2010-05-10  7:01     ` Ludovic Brenta
replies disabled

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