Version 1.5 of ais/ai-00226.txt

Unformatted version of ais/ai-00226.txt version 1.5
Other versions for file ais/ai-00226.txt

!standard E.1 (10)          04-11-30 AI95-00226/03
!class binding interpretation 04-04-01
!status Amendment 200Y 04-11-30
!status ARG Approved 7-0-0 04-11-21
!status work item 99-12-09
!status received 99-12-09
!priority Low
!difficulty Medium
!qualifier Clarification
!subject Cyclic Elaboration Dependences
!summary
If there is a cyclic elaboration dependences between the active partitions of a single distributed program, any partition involved must either deadlock or raise Communication_Error or Program_Error.
!question
Paragraph E.1(10) in full reads:
"It is a bounded error for there to be cyclic elaboration dependences between the active partitions of a single distributed program. The possible effects are deadlock during elaboration, or the raising of Program_Error in one or all of the active partitions involved."
This seems to allow some partitions to do anything, so long as Program_Error is raised in at least one other partition. Is this the intent? (No.)
!recommendation
See wording.
!wording
Replace E.1(10) by:
It is a bounded error for there to be cyclic elaboration dependences between the active partitions of a single distributed program. The possible effects, in each of the partitions involved, are deadlock during elaboration, or the raising of Communication_Error or Program_Error.
!discussion
An important property of Ada is that, if elaboration checks aren't suppressed, an Ada partition cannot execute a subprogram with an unelaborated body.
Paragraph E.1(10) is intended to give an additional permission for a deadlock to occur in a distributed Ada program. It is not intended to override the elaboration rules given in the rest of the Standard, so it is still true that a partition with an elaboration failure must either raise Program_Error or deadlock. It would be unreasonable to interpret it in any other way.
However, we must recognize that, in such circumstances, some partitions might just "go away" silently. Communication_Error would then be raised when trying to communicate with these partitions. Therefore, we are adding Communication_Error to the list of possible outcomes.
!corrigendum E.1(10)
Replace the paragraph:
It is a bounded error for there to be cyclic elaboration dependences between the active partitions of a single distributed program. The possible effects are deadlock during elaboration, or the raising of Program_Error in one or all of the active partitions involved.
by:
It is a bounded error for there to be cyclic elaboration dependences between the active partitions of a single distributed program. The possible effects, in each of the partitions involved, are deadlock during elaboration, or the raising of Communication_Error or Program_Error.
!ACATS test
An ACATS test needs to be constructed for RM E.1(10).
!appendix

!topic Cyclic elaboration dependences
!reference RM95 E.1(10)
!from Michael Yoder  99-07-08
!discussion

Paragraph E.1(10) in full reads:

"It is a bounded error for there to be cyclic elaboration dependences between
the active partitions of a single distributed program.  The possible effects
are deadlock during elaboration, or the raising of Program_Error in one or all
of the active partitions involved."

This seems to allow the infamous nasal demons effect in some partitions, so
long as Program_Error is raised in at least one other partition.  I believe (or
perhaps I should say I hope) that the intent of this paragraph is to make the
stricter requirement that each partition individually must either stop
execution or raise Program_Error.  This would preserve the property that, if
elaboration checks aren't suppressed, an Ada partition cannot execute a
subprogram with an unelaborated body.

Is this the intent?  If not, why not?  If so, do the other distinguished
reviewers agree the wording should be improved?

***********************************************************

From: Robert A Duff
Sent: Wednesday, December 08, 1999 11:19 AM

Mike, the mailing list has been messed up for some time.
Randy Brukardt has fixed things.

Randy, note Mike Yoder's address on the cc: list.  He's working at
TopLayer now -- same place as Mike Kamrad.

> Here is another message that appears to have been lost. This one was sent
> Thu, 8 Jul 1999.
>
>                 Randy.
>
> ---------
> !topic Cyclic elaboration dependences
> !reference RM95 E.1(10)
> !from Michael Yoder  99-07-08
> !discussion
>
> Paragraph E.1(10) in full reads:
>
> "It is a bounded error for there to be cyclic elaboration dependences
> between the active partitions of a single distributed program.  The
> possible effects are deadlock during elaboration, or the raising of
> Program_Error in one or all of the active partitions involved."
>
> This seems to allow the infamous nasal demons effect in some partitions,
> so long as Program_Error is raised in at least one other partition.  I
> believe (or perhaps I should say I hope) that the intent of this
> paragraph is to make the stricter requirement that each partition
> individually must either stop execution or raise Program_Error.  This
> would preserve the property that, if elaboration checks aren't
> suppressed, an Ada partition cannot execute a subprogram with an
> unelaborated body.
>
> Is this the intent?

I think so.

> If not, why not?  If so, do the other distinguished
> reviewers agree the wording should be improved?

Well, if we didn't say "nasal demons" (or "erroneous" or "unpredictable")
then we probably didn't mean that. But I suppose you're correct that it's
not absolutely clear as is.

- Bob

***********************************************************

From: Randy Brukardt
Sent: Thursday, December 09, 1999 6:25 PM

> This seems to allow the infamous nasal demons effect in
> some partitions, ...

What the heck is a "nasal demon"? It sounds like some
disease I catch at this time of year...

***********************************************************

From: Michael Yoder
Sent: Friday, December 10, 1999 7:50 AM

There are circles where this is a colloquialism which corresponds pretty
well to Ada's notion of "erroneous."  It allegedly came from a note in which
someone said, of a case where the action taken by the language was
undefined, "The program can do anything it wants.  It can cause demons to
fly out of your nose."  This eventually got compressed into "the nasal
demons effect," meaning completely unpredictable run-time behavior.

I think the language in question was C or C++, but I'd need to talk to the
folk who gave me the phrase.

***********************************************************

From: Robert A Duff
Sent: Friday, December 10, 1999 5:09 PM

> I think the language in question was C or C++, but I'd need to talk to the
> folk who gave me the phrase.

I think the phrase comes from comp.std.c or some such.  The C standard
has many things that are defined to be "unpredictable", which means
more-or-less the same thing as Ada's "erroneous".  Causing demons to fly
out of one's nose is one example of what an unpredictable program might
do.  There are lots of folks who learn language semantics by trying
things out, and assume that what one compiler does on one machine is the
law.  The "nasal demons" idea was a colorful attempt to teach them
otherwise.

In the Ada community, people say that erroneous programs can erase the
hard disk, or cause the keyboard to catch fire.

***********************************************************

Questions? Ask the ACAA Technical Agent