comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: next "big" language?? (disagree)
Date: 1996/06/20
Date: 1996-06-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.835306677@schonberg> (raw)
In-Reply-To: JSA.96Jun19115535@organon.com


Jon said

"I have to agree with Jon's point here.  I don't see any reason why the
definition of the language would have to prevent the compiler from
using the information for optimization.  If the customer didn't want
that to happen, the vendor could add a command-line option or pragma
to tell the compiler not to.  Don't Ada compilers already have
command-line options and/or pragmas to control how much optimization
takes place, anyway?"

This is really quite a tricky and subtle issue. If you do not see any
problem, then it is likely you don't see the issues fully yet. The basic
problem is that the notion of assertion can mean many things, and at the
level of discussing the precise semantics of assertions, there are
fundamental disagreements. There is certainly a school of thought that
is insistent that it is crucial that assertions NOT affect the semantics
or even the behavior of the program. 

You can declare this silly if you like, but it is more helpful if everyone
makes the effort to understand the issues.

In GNAT, 

   pragma Assert (X);

means EXACTLY

   if not X then
	raise Assert_Error;
   end if;

which is well defined, but not at all in the category of assertions that
the compiler can take advantage of, which can behave in a completely
differrent (and possibly suprising manner).

For instance, another view of assertions is exemplified by the following:

    pragma Assert (X /= 0);
    ...
    Q := 30 / X;

where the compiler "knows" that X is non-zero, and therefore skips the
test for X being zero in the division, and consequently generates some
junk value in Q. In this model, assertions do not correspond to any
executable code.

There is nothing wrong with either of these models of assertions (or with
any of several different models), but they are VERY different, and what we
found in practice is that people had very strong opinions that an assert
in the language should mean one or other of these, and that it was silly
to suggest any alternative meaning -- not exactly a recipe for agreement,
or for the devising of a language feature that would not cause a lot of
confusion.

I expect most Ada 95 compilers will copy the GNAT pragma Assert, but this
is of course only one possible interpretation of this notion (it happens
to be one whose semantics are very easy to describe, but it is not necessarily
what everyone wants!).





  reply	other threads:[~1996-06-20  0:00 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4p0fdd$4ml@news.atlantic.net>
1996-06-04  0:00 ` next "big" language?? (disagree) Peter Hermann
1996-06-04  0:00   ` The Amorphous Mass
1996-06-04  0:00     ` Robert Dewar
1996-06-06  0:00       ` Ken Garlington
1996-06-12  0:00       ` Help making ada pretty CSC Trusted Systems Group
1996-06-14  0:00         ` Sandy McPherson
1996-06-19  0:00         ` Ruediger Berlich
1996-06-04  0:00     ` next "big" language?? (disagree) Peter Hermann
1996-06-04  0:00       ` The Amorphous Mass
1996-06-05  0:00         ` Michael David WINIKOFF
1996-06-07  0:00           ` Robert Dewar
1996-06-05  0:00     ` Ian Ward
1996-06-05  0:00       ` The Amorphous Mass
1996-06-08  0:00         ` Robert Dewar
1996-06-08  0:00         ` Robert Dewar
1996-06-08  0:00           ` The Amorphous Mass
1996-06-09  0:00             ` Robert Dewar
1996-06-05  0:00   ` ++           robin
1996-06-05  0:00     ` Ian Ward
1996-06-05  0:00       ` Ian Ward
1996-06-06  0:00         ` Richard Riehle
1996-06-07  0:00           ` Robert Dewar
1996-06-10  0:00             ` Richard Riehle
1996-06-07  0:00           ` Richard Riehle
1996-06-08  0:00             ` O'Connor
1996-06-11  0:00           ` ++           robin
1996-06-11  0:00             ` David Weller
1996-06-11  0:00             ` Chris Warack <sys mgr>
1996-06-11  0:00             ` James_Rogers
1996-06-11  0:00               ` Kevin J. Weise
1996-06-11  0:00         ` ++           robin
1996-06-11  0:00           ` Ian Ward
1996-06-12  0:00             ` ++           robin
1996-06-12  0:00               ` Ian Ward
1996-06-11  0:00       ` Jon S Anthony
     [not found]   ` <4p60nk$imd@euas20.eua.ericsson.se>
     [not found]     ` <4p8lmq$oq7@goanna.cs.rmit.edu.au>
1996-06-11  0:00       ` ++           robin
1996-06-11  0:00         ` A. Grant
1996-06-12  0:00           ` Robert Dewar
1996-06-17  0:00             ` A. Grant
1996-06-18  0:00               ` Robert Dewar
1996-06-24  0:00                 ` Robert I. Eachus
1996-06-26  0:00                   ` Norman H. Cohen
1996-06-19  0:00             ` Jon S Anthony
1996-06-20  0:00               ` Robert Dewar [this message]
1996-06-24  0:00                 ` Dale Stanbrough
1996-06-24  0:00                   ` Assertions (was: Re: next "big" language?? (disagree)) Robert A Duff
1996-06-24  0:00                     ` Assertions (a different intent?) Gary McKee
1996-06-24  0:00                     ` Assertions (was: Re: next "big" language?? (disagree)) Robert Dewar
1996-06-25  0:00                       ` Robert A Duff
1996-06-28  0:00                         ` Robert Dewar
     [not found]                     ` <4qrljg$15l8@watnews1.watson.ibm.com>
1996-06-28  0:00                       ` Robert Dewar
1996-06-24  0:00                   ` next "big" language?? (disagree) Lars Duening
1996-06-24  0:00                   ` hopkinc
1996-06-24  0:00                   ` Adam Beneschan
1996-06-24  0:00                   ` Robert Dewar
1996-06-26  0:00                   ` Marc C. Brooks
1996-06-26  0:00                   ` Marc C. Brooks
     [not found]                   ` <4qsbm7$r1s@Starbase.NeoSoft.COM>
1996-06-28  0:00                     ` "Assert"? "Assume"? (was: next "big" language?? (disagree)) Alexander Bunkenburg
1996-06-28  0:00                       ` Ian Collier
1996-07-01  0:00                     ` Cameron Laird
1996-06-24  0:00                 ` next "big" language?? (disagree) Keith Thompson
1996-06-25  0:00                   ` Simon Read
1996-06-25  0:00                   ` Robert A Duff
1996-06-24  0:00                 ` Adam Beneschan
1996-06-25  0:00                 ` Darin Johnson
1996-06-26  0:00                   ` Dale Stanbrough
1996-06-26  0:00                   ` A. Grant
1996-06-25  0:00                 ` Brian Nettleton @pulsar
1996-06-26  0:00                   ` Robert Dewar
1996-06-28  0:00                     ` Fergus Henderson
1996-06-28  0:00                       ` Robert Dewar
1996-06-30  0:00                         ` Fergus Henderson
1996-06-30  0:00                           ` Robert Dewar
1996-06-12  0:00           ` ++           robin
1996-06-12  0:00             ` A. Grant
1996-06-14  0:00               ` Richard A. O'Keefe
1996-06-12  0:00         ` Richard A. O'Keefe
1996-06-12  0:00           ` ++           robin
1996-06-12  0:00             ` Richard A. O'Keefe
1996-06-13  0:00               ` ++           robin
1996-06-13  0:00               ` ++           robin
1996-06-12  0:00   ` Jon S Anthony
1996-06-14  0:00   ` Jon S Anthony
1996-06-15  0:00   ` Jon S Anthony
1996-06-18  0:00     ` Adam Beneschan
1996-06-18  0:00   ` Jon S Anthony
1996-06-28  0:00     ` Assertions (an heretic view) Michel Gauthier
1996-06-28  0:00       ` Robert A Duff
1996-06-28  0:00       ` Robert Dewar
1996-06-06  0:00 ` next "big" language?? (disagree) Dale Pontius
1996-06-11  0:00 ` Jon S Anthony
1996-06-12  0:00 ` Help making ada pretty Pedro de las Heras
1996-06-18  0:00 ` next "big" language?? (disagree) ++           robin
1996-06-07  0:00 Ian Ward
1996-06-08  0:00 ` O'Connor
1996-06-10  0:00   ` Matt Kennel
1996-06-11  0:00     ` Ian Ward
1996-06-12  0:00       ` Norman H. Cohen
1996-06-11  0:00     ` Robb Nebbe
1996-06-09  0:00 ` Robert Dewar
replies disabled

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