comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Modulus and Remainder operations (Was Re: Help with a bit of C code)
Date: 13 Oct 1994 16:59:50 -0400
Date: 1994-10-13T16:59:50-04:00	[thread overview]
Message-ID: <37k746$50s@gnat.cs.nyu.edu> (raw)
In-Reply-To: 1994Oct13.181350.10997@nosc.mil

There is a big difference between the different kinds of "errors", and chief
among them is that some of them are not considered errors.

Implementation dependent means that the effect is a function of the
implementation, but the implementation is not required to document
what it does. It is not in any sense an error to write such code,
but its effect is non-deterministic, and so it would be wrong in
some sense to "rely" on a particular behavior, whatever that means.
The fact that it is impossible to formally characterize is why we
have abandoned statements like "relying on xxx is erronoues", such
statements are semantically vacuous.

Implementation defined means that the effect must be defined by the
implementation. The effect is entirely deterministic for a given
implementation, and there is nothing WHATSOEVER wrong in relying on
the documented behavior. Of course the code is potentially non-portable,
but there are many ways to write non-portable code, and many situations
in which it is quite legitimate to write non-portable code (e.g. in
device drivers). Writing non-portable code when you should be writing
portable code is a mistake, but is not somehow "wrong" at the language
level.

Erroneous means that the compiler is free to do anything at all, and
we definitely intend to imply that erroneous execution is an error in the
general sense, to be avoided. While it can be quite legitimate to write
a program that exploits an implementation dependent or implentation
defined feature, it is never legitimate to write an erroneous program,
and the compiler is free to for example raise program error (or worse)
if it detects the error (or if it doesn't).

A bounded error is a special case of erroneousness where the possible
things the compiler can do are limited. IN purely formal terms it is
no different from a non-deterministic behavior. However, the 
non-formalizable, but very important difference, is that it is definitely
considered an error, essentially as bad as writing erroneous programs,
to write programs containing bounded errors. The reason we go to the trouble
of limiting the damage is to (a) make programs easier to debug and (b) attempt
to limit the damage that occurs if a program accidentally runs into a bounded
error.




  parent reply	other threads:[~1994-10-13 20:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-27 14:40 Modulus and Remainder operations (Was Re: Help with a bit of C code) David A. Cobb
1994-09-28 13:56 ` Robert Dewar
1994-09-29  9:04   ` Christopher Costello
1994-09-29 14:34   ` Norman H. Cohen
     [not found]   ` <1994Oct7.225248.6208@nosc.mil>
     [not found]     ` <1994Oct10.084630.19894@sei.cmu.edu>
     [not found]       ` <37bof4$ljl@gnat.cs.nyu.edu>
     [not found]         ` <37cigq$6e0@felix.seas.gwu.edu>
1994-10-11 14:42           ` Norman H. Cohen
     [not found]     ` <hbakerCxFK2p.4wp@netcom.com>
     [not found]       ` <1994Oct11.161048.1058@nosc.mil>
1994-10-11 20:06         ` Norman H. Cohen
1994-10-13  1:51           ` Henry G. Baker
1994-10-13  8:27             ` Magnus Kempe
1994-10-13 12:30               ` Robert Dewar
1994-10-14 15:45               ` Henry G. Baker
1994-10-14 22:11                 ` Robert Dewar
1994-10-15 17:35                 ` Tucker Taft
1994-10-13 10:38             ` Tucker Taft
1994-10-13 21:34             ` Norman H. Cohen
1994-10-14 15:39               ` Henry G. Baker
1994-10-14 22:56                 ` David Weller
1994-10-16  1:25                   ` Henry G. Baker
1994-10-13 18:13           ` Charles H. Sampson
1994-10-13 16:56             ` Robert I. Eachus
1994-10-13 20:59             ` Robert Dewar [this message]
1994-10-13 23:44             ` Bob Duff
replies disabled

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