Version 1.6 of ai12s/ai12-0183-1.txt

Unformatted version of ai12s/ai12-0183-1.txt version 1.6
Other versions for file ai12s/ai12-0183-1.txt

!standard 3.7.2(3/3)          17-04-24 AI12-0183-1/04
!standard 4.9(2)
!standard 5.5.2(5/5)
!standard D.4(4)
!standard D.4(7/5)
!class presentation 16-03-23
!status Amendment 1-2012 16-03-23
!status work item 16-03-23
!status received 16-03-23
!priority Low
!difficulty Easy
!qualifier Omission
!subject Presentation errors in Ada 2012 post Corrigendum 1
!summary
This AI corrects minor errors in the Standard.
1) Add Ordered_FIFO_Queuing to D.4(4).
2) Be specific about which policy is defined in 9.5.3 and 9.7.1.
3) The header "Static Semantics" is missing from 4.9.
4) Define the type of the object Constrained attribute in 3.7.2.
5) Drop the redundant words in 5.5.2(5/5).
!question
1) AI12-0163-1 defines policy Ordered_FIFO_Queuing. But the Legality Rule D.4(4) does not allow that as a policy name. Should it? (Yes.)
2) D.5(7/2) says "The rules for this policy are specified in 9.5.3 and 9.7.1." This paragraph defines three queuing policies. "This" in this text refers to that last one mentioned (I think), but that's ambiguious. Should we be specific here? (Yes.)
3) 4.9 does not have a Static Semantics portion; the entire section though paragraph 32 is not under any header (which represents introductory text). Only paragraph 1 appears to be introductory, should there be a Static Semantics portion in this subclause? (Yes.)
4) 3.7.2(3/3) says that the result of A'Constrained is either True or False, but it never gives the type of the attribute. Compare to T'Callable, which explicit says that the type of the attribute is Boolean. Should this be fixed? (Yes.)
5) 5.5.2(5/5) starts:
"The subtype defined by the loop_parameter_subtype_indication, if any, of a
generalized iterator component iterator shall statically match ..."
There's no such thing as a "generalized iterator component iterator". Was just "generalized iterator" meant here? (Yes.)
!recommendation
(See Summary.)
!wording
[Editor's note: The following changes are included in the draft RM, even though it is not intended for the full ARG to take up this AI until just before the next document (a Revision?) is submitted to WG 9. This AI is only used to record wording changes that appear to the editor to be obvious improvements in the Standard.]
1) Modify D.4(4):
The policy_identifier shall be either FIFO_Queuing, {Ordered_FIFO_Queuing, }Priority_Queuing or an implementation-defined identifier.
2) Modify D.5(7/2) [as modified by AI12-0163]:
Three queuing policies, FIFO_Queuing, Ordered_FIFO_Queuing, and Priority_Queuing, are language defined. If no Queuing_Policy pragma applies to any of the program units comprising the partition, the queuing policy for that partition is FIFO_Queuing. The rules for {the FIFO_Queuing}[this] policy are specified in 9.5.3 and 9.7.1.
3) Add a "Static Semantics" header before 4.9(2).
4) Add to the end of 3.7.2(3/3):
The value of this attribute is of the predefined type Boolean.
5) Modify 5.5.2(5/5):
The subtype defined by the loop_parameter_subtype_indication, if any, of a generalized iterator [component iterator] shall statically match ...
!discussion
1) This is a clear omission from AI12-0163-1. Obviously, if we define a queuing policy, we have to allow it to be used in the Queuing_Policy pragma, else it would be the most useless Ada construct ever.
2) The other two queuing policies are defined in this subclause, so it's fairly obvious that "this" must refer to FIFO_Queuing. But it shouldn't be necessary to read the entire subclause in order to figure that out.
3) 4.9(2-32) are not introductory text, so they should be in some headed portion. Static Semantics seems appropriate for these rules. [Editor's note: The section was labeled Intro in the RM source files (.MSS) - separately from paragraph 1. This almost certainly was a cut-and-paste error where someone forgot to change the label in the @begin and @end.]
4) The type of this attribute has been missing since the earliest versions of Ada 9x (the author checked back to version 2.0 - which was the first version to have complete wording). Interestingly, the sentence giving the type was in the Ada 83 wording, so it was presumably lost in transcription.
The odd thing is that no one ever reported the mistake until 2017; that was just short of 24 years since it was made (version 2.0 was dated March 29, 1993). That shows the difficulty of noting errors of omission.
We treat this as a presentation issue, as the results of "True" and "False" imply type Boolean as there is no other language-defined type with those literals, and it doesn't make sense for any user-defined type that happens to be around to be used as the result type of a language-defined attribute.
5) There are three kinds of iterators defined in 5.5.2, "generalized iterators", "array component iterators", and "container element iterators". Each sentence in 5.5.2(5/5) gives a rule for one kind of these iterators, so it is clear that there are extra words in the first sentence - especially as no kind of iterator includes the word "iterator" twice.
!corrigendum 3.7.2(3)
Replace the paragraph:
A'Constrained
Yields the value True if A denotes a constant, a value, a tagged object, or a constrained variable, and False otherwise.
by:
A'Constrained
Yields the value True if A denotes a constant, a value, a tagged object, or a constrained variable, and False otherwise. The value of this attribute is of the predefined type Boolean.
!corrigendum 4.9(2)
Replace the paragraph:
A static expression is a scalar or string expression that is one of the following:
by:
Static Semantics
A static expression is a scalar or string expression that is one of the following:
!corrigendum 5.5.2(5/5)
Replace the paragraph:
The subtype defined by the loop_parameter_subtype_indication, if any, of a generalized iterator component iterator shall statically match the iteration cursor subtype. The subtype defined by the loop_parameter_subtype_indication, if any, of an array component iterator shall statically match the component subtype of the type of the iterable_name. The subtype defined by the loop_parameter_subtype_indication, if any, of a container element iterator shall statically match the default element subtype for the type of the iterable_name.
by:
The subtype defined by the loop_parameter_subtype_indication, if any, of a generalized iterator shall statically match the iteration cursor subtype. The subtype defined by the loop_parameter_subtype_indication, if any, of an array component iterator shall statically match the component subtype of the type of the iterable_name. The subtype defined by the loop_parameter_subtype_indication, if any, of a container element iterator shall statically match the default element subtype for the type of the iterable_name.
!corrigendum D.4(4)
Replace the paragraph:
The policy_identifier shall be either FIFO_Queuing, Priority_Queuing or an implementation-defined identifier.
by:
The policy_identifier shall be either FIFO_Queuing, Ordered_FIFO_Queuing, Priority_Queuing or an implementation-defined identifier.
!corrigendum D.4(7/5)
Replace the paragraph:
Three queuing policies, FIFO_Queuing, Ordered_FIFO_Queuing, and Priority_Queuing, are language defined. If no Queuing_Policy pragma applies to any of the program units comprising the partition, the queuing policy for that partition is FIFO_Queuing. The rules for this policy are specified in 9.5.3 and 9.7.1.
by:
Three queuing policies, FIFO_Queuing, Ordered_FIFO_Queuing, and Priority_Queuing, are language defined. If no Queuing_Policy pragma applies to any of the program units comprising the partition, the queuing policy for that partition is FIFO_Queuing. The rules for the FIFO_Queuing policy are specified in 9.5.3 and 9.7.1.
!ASIS
No changes needed.
!ACATS test
No test needed.
!appendix

From: Randy Brukardt
Sent: Friday, February 10, 2017  5:55 PM

In researching a suggestion from Tucker, I happened to notice that 3.7.2(3/3)
does not give any type for the attribute Constrained. The text gives the
results as True and False, but no type. Contrast to 'Callable, for instance:

A'Constrained
Yields the value True if A denotes a constant, a value, a tagged object, or a
constrained variable, and False otherwise. 

T'Callable
Yields the value True when the task denoted by T is callable, and False
otherwise; a task is callable unless it is completed or abnormal. The value
of this attribute is of the predefined type Boolean.

We need the second sentence in A'Constrained.

In the absence of an objection, I'll put this into the presentation AI.

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

From: Jeff Cousins
Sent: Saturday, February 11, 2017  3:24 AM

OK

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

From: Tucker Taft
Sent: Monday, April 24, 2017  5:05 PM

Paragraph 5/5 of 5.5.2 (Generalized Loop Iteration) seems to have a typo in
its first sentence:

   "The subtype defined by the loop_parameter_subtype_indication, if any, of a
    generalized iterator component iterator shall statically match the
    iteration cursor subtype. ..."

I think "component iterator" should be deleted leaving "... of a generalized
iterator shall statically match ...".

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

From: Randy Brukardt
Sent: Monday, April 24, 2017  10:46 PM

This looks like the kind of typo that I'd introduce in editing the RM. But it
isn't: it's present in EVERY version of AI12-0156-1 (and probably in
AI12-0151-1, which it was split from, before that). How in the world did no
one notice that duplication in 2 years of ARG discussion and review???

Anyway, since it's in the original AI, I've put the correction into the
current presentation AI [AI12-0183-1] (it's an obvious typo, since there are
three kinds of iterators defined in this clause, and none of them have two
occurrences of the word "iterator"!), and immediately made the correction (as
is the usual policy for presentation changes). [We'll vote on that AI
someday, but there's no rush.]

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


Questions? Ask the ACAA Technical Agent