comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Assertions in Ada
Date: 1997/08/22
Date: 1997-08-22T00:00:00+00:00	[thread overview]
Message-ID: <EFBI6M.F2K.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: dewar.872218059@merv


Robert Dewar (dewar@merv.cs.nyu.edu) wrote:

: Jon Anthony says

: <<b) If a) is the expectation, then why was this pragma left out of the
:    standard??  Just hadn't thought of it at the time? (oops that makes
:    3)>>


: It is one thing to stick this into an implementation, quite another to
: formally define what you mean. In particular the whole issue of whether
: the compiler can use the assertion involves some tricky business. We
: found that different people had very different ideas in mind.

: ...

: We could not resolve this issue, so the feature got omitted. It's always
: surprising (especially to those who do not have experience in language
: design) how the simplest appearing things can turn out to be very complex.

Other stumbling blocks to including it in the Standard:

   The safety-critical community seemed generally to prefer methods
   based on separate tools that look from the "outside" to
   verify conditions in the code, without adding anything to
   the generated code in the target machine.  Since we had presumed
   the safety-critical community would have been one of the big
   supporters of the pragma, this lack of interest was a big blow.

   One reviewer felt very strongly that a pragma assert in the
   declarative part should be interpreted as a block-wide invariant,
   rather than as a one-time assertion about the state at the
   point of the pragma.  This further broke the consensus on the meaning
   of the pragma, and when you can't get consensus, it is difficult
   to standardize.

Be that as it may, most "every day" programmers very much like
the notion of a pragma Assert, and I expect to see it widely used,
and presumably therefore widely (universally?) supported.

"Assert" is perfect for a pragma in Ada, because if an implementation 
doesn't support it, it simply ignores it, so the program is still fully
portable.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1997-08-22  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-21  0:00 Assertions in Ada AdaWorks
1997-08-21  0:00 ` Tucker Taft
     [not found]   ` <JSA.97Aug21183650@alexandria.organon.com>
1997-08-21  0:00     ` Robert Dewar
1997-08-22  0:00       ` Tucker Taft [this message]
1997-08-23  0:00         ` Ken Garlington
1997-08-24  0:00           ` Brian Rogoff
     [not found]         ` <199708251351.PAA13197@basement.replay.com>
1997-08-25  0:00           ` Robert Dewar
1997-08-27  0:00             ` Adrian P. Morgan
1997-08-31  0:00               ` Robert A Duff
1997-08-21  0:00   ` Brian Rogoff
1997-08-22  0:00     ` Robert Dewar
1997-08-23  0:00   ` Ken Garlington
1997-08-24  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-08-22  0:00 AdaWorks
replies disabled

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