comp.lang.ada
 help / color / mirror / Atom feed
From: mazzanti@iei.pi.cnr.it (Franco Mazzanti)
Subject: Re: Finalization and Garbage Collection: a hole in the RM?
Date: 1996/09/06
Date: 1996-09-06T00:00:00+00:00	[thread overview]
Message-ID: <mazzanti-0609960944120001@mac-mazz.iei.pi.cnr.it> (raw)


Robert A Duff said:

> Your best bet is to get the ascii version of the RM or AARM, and search
> in a text editor for "erroneous", "unspecified", "implementation
> defined", etc.  (I say "impl def", because it is theoretically possible
> for an implementation to take something that's implemenation defined,
> and define it to be erroneous.  In most cases, this is highly unlikely.
> You can probably tell by looking at each case whether or not its likely
> in practise.)

I have already done  that for "erroneous", (un, not)"specified",
"abnormal", and several others.  But no, I did not go through
implementation-defined aspects. I thought they cound not be transformed
by the implementation into erroneous executions ... You have opened
for me a new can of worms ...

> 
> Also, read 11.6.
> 

I already read this piece of cake many times, and still have to figure
out what it does really imply ... :-) 
I plan to reinvestigate that aspects soon.


> >For what I can see, according to [RM 1.1.4(18)]  (see below), there is
> >nothing "unpredictable" ("erroneous") in things being executed in
> >"arbitrary order".
> 
> Well, it depends how unpredictable you mean -- erroneous things are
> totally unpredictable, and can cause the program to behave outside the
> normal semantic model.  Bounded errors and arbitrary orders are only a
> little bit unpredictable (i.e. there's a well-defined set of
> possibilities).  Certainly *any* form of nondeterminism can cause
> trouble -- portability problems, programs that work with optimization
> turned off but not with optimization turned on, etc.  And it's worse in
> theory than in practise, since most compilers don't (for example) roll
> dice on every subprogram call to determine the order of parameter
> evaluation.
> 
> Thankfully, Ada has far fewer cases of totally unpredictable behavior
> than certain other palindromic languages.  ;-)  And Ada 95 eliminates one
> of the worst cases of erroneousness in Ada 83 -- uninitialized
> variables.
> 
> - Bob

I agree, but currently I am just trying to understand only the "totally
unpredictable" aspects. That is enough for now.

Returning to implementation-defined aspects, of the 136 cases mentioned
in Appendix M, most of them give  to implementations some freedom
in supporting some aspect, but without affecting the program run-time
semantics, or affecting the run-time semantics in a well defined way.
(see E.g. M(34) the order of elaboration of library items).

Other aspects, instead, give to implementations the freedom the change
or extend the normal semantic model, or the freedom to complete some
unspecified aspects of the normal semantic model with erroneousness.
And these are the best candidates for potential erroneous executions.
(e.g. M(14): The operations on "nonstandard integer types"  or
      M(38): The consequences of violating limitations on Restrictions
              pragmas.)
They are not many, I counted only 13 of them.
[ M(4,10,14,15,21,38,42,44,52,58,77,81,85) ]

A third group, finally, allows a function call to return an
"implementation-defined" result [M(20,40,86,87,123,124,127,128,131)].
(e.g. M(123): The result of a floating point arithmetic operation in 
              overflow situations, when the Machine_Overflows attribute 
              of the result type is False. 
 or  M(86) The result of the Task_Identification.Image attribute.)

The erroneousness of the program might be affected if the implementation
were allowed to return an "abnormal result".
Is this  possibility allowed by the RM, or the fact that some value
MUST be returned, even if implementation-defined, can be seen as
automatically ruling out the possibility or returning an abnormal 
value (which would probably be erroneous by itself).?

In other words: can a function required to return a (implementation
defined) result, directly cause an erroneous execution?
Is the attemp to return an abnormal result directly erroneous?

Franco




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

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-06  0:00 Franco Mazzanti [this message]
1996-09-06  0:00 ` Finalization and Garbage Collection: a hole in the RM? Robert A Duff
1996-09-07  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-09-09  0:00 Franco Mazzanti
1996-09-04  0:00 Franco Mazzanti
1996-09-08  0:00 ` Robert Dewar
1996-09-02  0:00 Franco Mazzanti
1996-09-03  0:00 ` Robert A Duff
1996-09-03  0:00 ` Robert Dewar
1996-08-30  0:00 Franco Mazzanti
1996-08-30  0:00 ` Robert A Duff
1996-08-26  0:00 Franco Mazzanti
1996-08-29  0:00 ` Robert A Duff
1996-08-29  0:00 ` Robert A 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