CVS difference for ai12s/ai12-0266-1.txt

Differences between 1.13 and version 1.14
Log of other versions for file ai12s/ai12-0266-1.txt

--- ai12s/ai12-0266-1.txt	2019/01/22 01:23:37	1.13
+++ ai12s/ai12-0266-1.txt	2019/02/01 03:02:41	1.14
@@ -1,8 +1,53 @@
-!standard 5.5.1(4/3)                                  19-01-19  AI12-0266-1/10
+!standard 5.5(3/5)                                      19-01-29  AI12-0266-1/11
+!standard 5.5(8.1/5)
+!standard 5.5(9.3/5)
+!standard 5.5.1(4/3)
 !standard 5.5.1(6/4)
 !standard 5.5.1(11/3)
+!standard 5.5.2(2.1/3)
 !standard 5.5.2(4/3)
+!standard 5.5.2(10/3)
+!standard 5.5.2(11/3)
+!standard 5.5.2(12/3)
+!standard 5.5.2(13/3)
+!standard 5.5.2(15/3)
+!standard A.18.2(74.1/3)
+!standard A.18.2(74.2/3)
+!standard A.18.2(230.1/3)
+!standard A.18.2(230.2/3)
+!standard A.18.2(230.3/3)
+!standard A.18.2(230.4/3)
+!standard A.18.3(46.1/3)
+!standard A.18.3(46.2/3)
+!standard A.18.3(144.1/3)
+!standard A.18.3(144.2/3)
+!standard A.18.3(144.3/3)
+!standard A.18.3(144.4/3)
+!standard A.18.5(37.1/3)
+!standard A.18.5(61.1/3)
+!standard A.18.5(61.2/3)
+!standard A.18.6(51.1/3)
+!standard A.18.6(51.2/3)
+!standard A.18.6(94.1/3)
+!standard A.18.6(94.2/3)
+!standard A.18.8(49.1/3)
+!standard A.18.8(85.1/3)
+!standard A.18.8(85.2/3)
+!standard A.18.9(61.1/3)
+!standard A.18.9(61.2/3)
+!standard A.18.9(113.1/3)
+!standard A.18.9(113.2/3)
+!standard A.18.10(44/3)
+!standard A.18.10(45/3)
+!standard A.18.10(70/3)
+!standard A.18.10(156/3)
+!standard A.18.10(157/3)
+!standard A.18.10(158/3)
+!standard A.18.10(159/3)
+!standard A.18.10(218/3)
+!standard A.18.10(219/3)
 !class Amendment 18-03-28
+!status Amendment 1-2012 19-01-29
 !status work item 18-03-28
 !status received 18-03-28
 !priority Medium
@@ -238,7 +283,7 @@
 
 Modify 5.5.2(11/3):
 
-  For an array component iterator, the chunk_specification of the associated
+  For an array component iterator, {the chunk_specification of the associated
   parallel construct, if any, is first elaborated to determine
   the maximum number of chunks (see 5.5), and then} the iterable_name is
   evaluated and the denoted array object becomes the /array for the loop/. If
@@ -272,7 +317,7 @@
 
 Modify 5.5.2(12/3):
 
-  For a container element iterator, the chunk_specification of the associated
+  For a container element iterator, {the chunk_specification of the associated
   parallel construct, if any, is first elaborated (to determine the maximum
   number of chunks -- see 5.5), and then} the iterable_name is evaluated and the
   denoted iterable container object becomes the /iterable container object for
@@ -571,6 +616,11 @@
 function Iterate_Subtree (Position : in Cursor)
       return Tree_Iterator_Interfaces.{Parallel}[Forward]_Iterator'Class;
 
+Modify A.18.10(70/3):
+
+function Iterate_Children (Position : in Cursor)
+      return Tree_Iterator_Interfaces.{Parallel_}Reversible_Iterator'Class;
+
 Modify A.18.10(156/3):
 
 function Iterate (Container : in Tree)
@@ -581,7 +631,7 @@
   Iterate returns a[n] {parallel} iterator object (see 5.5.1) that will
   generate a value for a loop parameter (see 5.5.2) designating each
   element node in Container, starting from with the root node and
-  proceeding in a depth-first order {when used as a forward_iterator,
+  proceeding in a depth-first order {when used as a forward iterator,
   and starting with all nodes concurrently when used as a parallel
   iterator}. Tampering with the cursors of Container is prohibited while
   the iterator object exists (in particular, in the
@@ -602,7 +652,8 @@
   5.5.2) designating each element in the subtree rooted by the node
   designated by Position, starting from with the node designated by
   Position and proceeding in a depth-first order {when used as a forward
-  iterator, or all nodes concurrently when used as a parallel iterator}.
+  iterator, or all nodes in the subtree concurrently when used as a 
+  parallel iterator}.
   If Position equals No_Element, then Constraint_Error is propagated.
   Tampering with the cursors of the container that contains the node
   designated by Position is prohibited while the iterator object exists
@@ -610,7 +661,28 @@
   whose iterator_specification denotes this object). The iterator object
   needs finalization.
 
+Modify A.18.10(218/3):
+
+function Iterate_Children (Position : in Cursor)
+      return Tree_Iterator_Interfaces.{Parallel_}Reversible_Iterator'Class;
+
+Modify A.18.10(219/3):
 
+   Iterate_Children returns a {parallel and }reversible iterator object 
+   (see 5.5.1) that will generate a value for a loop parameter (see 5.5.2) 
+   designating each child node of Parent. If Parent equals No_Element, then
+   Constraint_Error is propagated. If Parent does not designate a node in 
+   Container, then Program_Error is propagated. Otherwise, when used as a 
+   forward iterator, the nodes are designated starting with the first child
+   node and moving the cursor as per the function Next_Sibling; when used as
+   a reverse iterator, the nodes are designated starting with the last child
+   node and moving the cursor as per the function Previous_Sibling{; when used
+   as a parallel iterator, starting with all child nodes concurrently}. 
+   Tampering with the cursors of Container is prohibited while the iterator 
+   object exists (in particular, in the sequence_of_statements of the 
+   loop_statement whose iterator_specification denotes this object). The 
+   iterator object needs finalization.
+
 !discussion
 
 Containers such as vectors are obvious candidates for parallelization, since it
@@ -670,6 +742,959 @@
 do so.
 
 
+!corrigendum 5.5(3/3)
+
+@drepl
+@xindent<@fa<iteration_scheme>@fa<@ ::=@ >@b<while>@ @fa<condition>@hr
+@ @ |@ @b<for>@ @fa<loop_parameter_specification>@hr
+@ @ |@ @b<for>@ @fa<iterator_specification>>
+@dby
+@xindent<@fa<iteration_scheme>@fa<@ ::=@ >@b<while>@ @fa<condition>@hr
+@ @ |@ @b<for>@ @fa<loop_parameter_specification>@hr
+@ @ |@ @b<for>@ @fa<iterator_specification>@hr
+@ @ |@ @b<for>@ @fa<procedural_iterator>@hr
+@ @ |@ @b<parallel>@ [(@fa<chunk_specification>)]@hr
+@ @ @ @ @b<for>@ @fa<loop_parameter_specification>
+@ @ |@ @b<parallel>@ [(@fa<chunk_specification>)]@hr
+@ @ @ @ @b<for>@ @fa<iterator_specification>>
+
+@xindent<@fa<chunk_specification>@fa<@ ::=@ >@hr
+@ @ @ @ @i<integer_>@fa<simple_expression>@hr
+@ @ |@ @fa<defining_identifier>@ @b<in>@ @fa<discrete_subtype_definition>>
+
+!corrigendum 5.5(8)
+
+@dinsa
+For the execution of a @fa<loop_statement> with a @b<while> 
+@fa<iteration_scheme>, the @fa<condition> is evaluated before each execution 
+of the @fa<sequence_of_statements>; if the value of the @fa<condition> is True, 
+the @fa<sequence_of_statements> is executed; if False, the execution of the 
+@fa<loop_statement> is complete.
+@dinst
+If the reserved word @b<parallel> is present in the @fa<iteration_scheme> of
+a @fa<loop_statement> (a 
+@i<parallel loop>), the iterations are partitioned into one or more
+@i<chunks>, each with its own separate logical thread of control (see 
+clause 9). If a @fa<chunk_specification> is present in a parallel loop,
+it is elaborated first, and the result of the elaboration determines the
+maximum number of chunks used for the parallel loop. If the
+@fa<chunk_specification> is an @i<integer_>@fa<simple_expression>, the 
+elaboration evaluates the expression, and the value of the expression 
+determines the maximum number of chunks. If a @fa<discrete_subtype_definition>
+is present, the elaboration elaborates the @fa<discrete_subtype_definition>,
+which defines the subtype of the chunk parameter, and the number of values in
+this subtype determines the maximum number of chunks. After elaborating
+the @fa<chunk_specification>, a check is made that the determined maximum
+number of chunks is greater than zero. If this check fails,
+Program_Error is raised.
+
+!corrigendum 5.5(9.1/4)
+
+@drepl
+For details about the execution of a @fa<loop_statement> with
+the @fa<iteration_scheme> being @b<for> @fa<iterator_specification>,
+see 5.5.2.
+@dby
+For details about the execution of a @fa<loop_statement> with
+the @fa<iteration_scheme> including an @fa<iterator_specification>,
+see 5.5.2.
+
+!corrigendum 5.5.1(4/3)
+
+@dinsa
+@xcode<@b<type> Reversible_Iterator @b<is limited interface and> Forward_Iterator;
+@b<function> Last (Object : Reversible_Iterator) @fa<return> Cursor @fa<is abstract>;
+@b<function> Previous (Object : Reversible_Iterator; Position : Cursor)
+   @b<return> Cursor @b<is abstract>;>
+@dinst
+@xcode<   @b<type> Parallel_Iterator @b<is limited interface and> Forward_Iterator;>
+
+@xcode<   @b<subtype> Chunk_Index @b<is> Positive;>
+
+@xcode<   @b<function> Is_Split (Object : Parallel_Iterator)
+      @b<return> Boolean @b<is abstract>;>
+
+@xcode<   @b<procedure> Split_Into_Chunks (Object     : @b<in out> Parallel_Iterator;
+                                Max_Chunks : @b<in>     Chunk_Index) @b<is abstract>
+      @b<with> Pre'Class   =@> @b<not> Object.Is_Split @b<or else raise> Program_Error,
+           Post'Class  =@> Object.Is_Split @b<and then>
+              Object.Chunk_Count <= Max_Chunks;>
+
+@xcode<   @b<function> Chunk_Count (Object : Parallel_Iterator) @b<return> Chunk_Index
+      @b<is abstract>
+      @b<with> Pre'Class   =@> Object.Is_Split @b<or else raise> Program_Error;>
+
+@xcode<   @b<function> First (Object : Parallel_Iterator;
+                   Chunk  : Chunk_Index) @b<return> Cursor @b<is abstract>
+      @b<with> Pre'Class   =@> (Object.Is_Split @b<and then> Chunk <= Object.Chunk_Count)
+                           @b<or else raise> Program_Error;>
+
+@xcode<   @b<function> Next (Object   : Parallel_Iterator;
+                  Position : Cursor;
+                  Chunk    : Chunk_Index) @b<return> Cursor @b<is abstract>
+      @b<with> Pre'Class   =@> (Object.Is_Split @b<and then> Chunk <= Object.Chunk_Count)
+                           @b<or else raise> Program_Error;>
+
+@xcode<   @b<type> Parallel_Reversible_Iterator @b<is limited interface>
+      @b<and> Parallel_Iterator @b<and> Reversible_Iterator;>
+
+!corrigendum 5.5.1(6/3)
+
+@drepl
+An @i<iterator type> is a type descended from the Forward_Iterator interface
+from some instance of Ada.Iterator_Interfaces. A @i<reversible iterator type>
+is a type descended from the Reversible_Iterator interface from some instance
+of Ada.Iterator_Interfaces. An @i<iterator object> is an object of an iterator
+type. A @i<reversible iterator object> is an object of a reversible iterator
+type. The formal subtype Cursor from the associated instance of
+Ada.Iterator_Interfaces is the @i<iteration cursor subtype> for the iterator
+type.
+@dby
+An @i<iterator type> is a type descended from the Forward_Iterator interface
+from some instance of Ada.Iterator_Interfaces. A @i<reversible iterator type>
+is a type descended from the Reversible_Iterator interface from some instance
+of Ada.Iterator_Interfaces. A @i<parallel iterator type> is a type descended from
+the Parallel_Iterator interface from some instance of Ada.Iterator_Interfaces.
+A type descended from the Parallel_Reversible_Iterator interface from some
+instance of Ada.Iterator_Interfaces is both a parallel iterator type and a
+reversible iterator type.
+An @i<iterator object> is an object of an iterator
+type. A @i<reversible iterator object> is an object of a reversible iterator
+type. A @i<parallel iterator object> is an object of a parallel iterator type.
+The formal subtype Cursor from the associated instance of
+Ada.Iterator_Interfaces is the @i<iteration cursor subtype> for the iterator
+type.
+
+!corrigendum 5.5.1(11/3)
+
+@drepl
+An @i<iterable container type> is an indexable container type with specified 
+Default_Iterator and Iterator_Element aspects. A @i<reversible iterable container type> 
+is an iterable container type with the default iterator type being a reversible
+iterator type. An @i<iterable container object> is an object of an
+iterable container type. A @i<reversible iterable container object> is an 
+object of a reversible iterable container type.
+@dby
+An @i<iterable container type> is an indexable container type with specified 
+Default_Iterator and Iterator_Element aspects. A @i<reversible iterable container type> 
+is an iterable container type with the default iterator type being a reversible
+iterator type. A @i<parallel iterable container type> is an iterable
+container type with the default iterator type being a parallel iterator type.
+An @i<iterable container object> is an object of an
+iterable container type. A @i<reversible iterable container object> is an object
+of a reversible iterable container type. A @i<parallel iterable container object> 
+is an object of a parallel iterable container type.
+
+!corrigendum 5.5.2(2/3)
+
+@drepl
+@xindent<@fa<iterator_specification>@fa<@ ::=@ >@hr
+@ @ @ @ @fa<defining_identifier>@ @b<in>@ [@b<reverse>]@ @i<iterator_>@fa<name>@hr
+@ @ |@ @fa<defining_identifier>@ [:@ @fa<subtype_indication>]@ @b<of>@ [@b<reverse>]@ @i<iterable_>@fa<name>>
+@dby
+@xindent<@fa<iterator_specification>@fa<@ ::=@ >@hr
+@ @ @ @ @fa<defining_identifier>@ [:@ @fa<loop_parameter_subtype_indication>]@ @b<in>@ [@b<reverse>]@ @i<iterator_>@fa<name>@hr
+@ @ |@ @fa<defining_identifier>@ [:@ @fa<loop_parameter_subtype_indication>]@ @b<of>@ [@b<reverse>]@ @i<iterable_>@fa<name>>
+
+@xindent<@fa<loop_parameter_subtype_indication>@fa<@ ::=@ >@fa<subtype_indication>@ |@ @fa<access_definition>>
+
+@xindent<If an @fa<iterator_specification> is for a parallel construct, the reserved word
+@b<reverse> shall not appear in the @fa<iterator_specification>.>
+
+!corrigendum 5.5.2(4/3)
+
+@drepl
+If the reserved word @b<reverse> appears, the @fa<iterator_specification> is a
+@i<reverse iterator>; otherwise it is a @i<forward iterator>. In a
+reverse generalized iterator, the @i<iterator_>@fa<name> shall be of a
+reversible iterator type. In a reverse container element iterator,
+the default iterator type for the type of the @i<iterable_>@fa<name> shall
+be a reversible iterator type.
+@dby
+If the reserved word @b<reverse> appears, the @fa<iterator_specification> is a
+@i<reverse iterator>. If the @fa<iterator_specification> is for a parallel 
+construct, the @fa<iterator_specification> is a @i<parallel iterator>.
+Otherwise, it is a @i<forward iterator>. Forward and reverse iterators are 
+collectively called @i<sequential> iterators. In a
+reverse generalized iterator, the @i<iterator_>@fa<name> shall be of a
+reversible iterator type. In a parallel generalized iterator, the
+@i<iterator_>@fa<name> shall be of a parallel iterator type.
+In a reverse container element iterator,
+the default iterator type for the type of the @i<iterable_>@fa<name> shall
+be a reversible iterator type. In a parallel container element
+iterator, the default iterator type for the type of the @i<iterable_>@fa<name>
+shall be of a parallel iterator type.
+
+
+!corrigendum 5.5.2(10/3)
+
+@drepl
+For a generalized iterator, the loop parameter is created, the
+@i<iterator_>@fa<name> is evaluated, and the denoted iterator object becomes
+the @i<loop iterator>. In a forward generalized iterator, the operation
+First of the iterator type is called on the loop iterator, to produce
+the initial value for the loop parameter. If the result of calling
+Has_Element on the initial value is False, then the execution of the
+@fa<loop_statement> is complete. Otherwise, the @fa<sequence_of_statements>
+is executed and then the Next operation of the iterator type is called with
+the loop iterator and the current value of the loop parameter to produce the
+next value to be assigned to the loop parameter. This repeats until
+the result of calling Has_Element on the loop parameter is False,
+or the loop is left as a consequence of a transfer of control. For a
+reverse generalized iterator, the operations Last and Previous are
+called rather than First and Next.
+@dby
+For a sequential generalized iterator, the loop parameter is created, the
+@i<iterator_>@fa<name> is evaluated, and the denoted iterator object becomes
+the @i<loop iterator>. In a forward generalized iterator, the operation
+First of the iterator type is called on the loop iterator, to produce
+the initial value for the loop parameter. If the result of calling
+Has_Element on the initial value is False, then the execution of the
+@fa<loop_statement> is complete. Otherwise, the @fa<sequence_of_statements>
+is executed and then the Next operation of the iterator type is called with
+the loop iterator and the current value of the loop parameter to produce the
+next value to be assigned to the loop parameter. This repeats until
+the result of calling Has_Element on the loop parameter is False,
+or the loop is left as a consequence of a transfer of control. For a
+reverse generalized iterator, the operations Last and Previous are
+called rather than First and Next.
+
+For a parallel generalized iterator, the @fa<chunk_specification>, if any, of 
+the associated parallel construct, is first elaborated, to determine the 
+maximum number of chunks (see 5.5), and then the operation Split_Into_Chunks 
+of the iterator type is called, with the determined maximum passed as the 
+Max_Chunks parameter, specifying the upper bound for the number of loop 
+parameter objects (and the number of logical threads of control) to be 
+associated with the iterator. In the absence of a @fa<chunk_specification>, 
+the maximum number of chunks is determined in an implementation defined 
+manner.
+
+Upon return from Split_Into_Chunks, the actual number of chunks for
+the loop is determined by calling the Chunk_Count operation of the
+iterator, at which point one logical thread of control is initiated
+for each chunk, with an associated chunk index in the range from one
+to the actual number of chunks. Within each logical thread of control,
+a loop parameter is created. If a @fa<chunk_specification> with a
+@fa<discrete_subtype_definition> is present in the associated parallel
+construct, then a chunk parameter is created, and initialized with a
+value from the discrete subtype defined by the
+@fa<discrete_subtype_definition>, so that the order of the chosen chunk
+parameter values correspond to the order of the chunk indices
+associated with the logical threads of control. The operation First
+of the iterator type having a Chunk parameter is called on the loop
+iterator, with Chunk initialized from the corresponding chunk index,
+to produce the initial value for the loop parameter. If the result of
+calling Has_Element on this initial value is False, then the execution
+of the logical thread of control is complete. Otherwise, the
+@fa<sequence_of_statements> is executed and then the Next operation of the
+iterator type having a Chunk parameter is called, with the loop
+iterator, the current value of the loop parameter, and the
+corresponding chunk index, to produce the next value to be assigned to
+the loop parameter. This repeats until the result of calling
+Has_Element on the loop parameter is False, or the associated parallel
+construct is left as a consequence of a transfer of control. In the
+absence of a transfer of control, the associated parallel construct of
+a parallel generalized iterator is complete when all of its logical
+threads of control are complete.
+
+!corrigendum 5.5.2(11/3)
+
+@drepl
+For an array component iterator, the @i<iterable_>@fa<name> is evaluated and
+the denoted array object becomes the @i<array for the
+loop>. If the array for the loop is a null array, then the execution
+of the @fa<loop_statement> is complete. Otherwise, the
+@fa<sequence_of_statements> is executed with the loop parameter denoting
+each component of the array for the loop, using a @i<canonical> order
+of components, which is last dimension varying fastest (unless the
+array has convention Fortran, in which case it is first dimension
+varying fastest). For a forward array component iterator, the iteration
+starts with the component whose index values are each the first in their
+index range, and continues in the canonical order. For a reverse array
+component iterator, the iteration starts with the component whose index
+values are each the last in their index range, and continues in the reverse
+of the canonical order. The loop iteration proceeds until the
+@fa<sequence_of_statements> has been executed for each component of the
+array for the loop, or until the loop is left as a consequence of a
+transfer of control.
+@dby
+For an array component iterator, the @fa<chunk_specification> of the associated
+parallel construct, if any, is first elaborated to determine the maximum number 
+of chunks (see 5.5), and then the @i<iterable_>@fa<name> is evaluated and
+the denoted array object becomes the @i<array for the
+loop>. If the array for the loop is a null array, then the execution
+of the @fa<loop_statement> is complete. Otherwise, the
+@fa<sequence_of_statements> is executed with the loop parameter denoting
+each component of the array for the loop, using a @i<canonical> order
+of components, which is last dimension varying fastest (unless the
+array has convention Fortran, in which case it is first dimension
+varying fastest). For a forward array component iterator, the iteration
+starts with the component whose index values are each the first in their
+index range, and continues in the canonical order. For a reverse array
+component iterator, the iteration starts with the component whose index
+values are each the last in their index range, and continues in the reverse
+of the canonical order. For a parallel array component iterator, the iteration 
+is broken up into contiguous chunks of the canonical order, such that all 
+components are covered with no overlaps; each chunk has its own logical thread 
+of control with its own loop parameter and iteration within each chunk is in 
+the canonical order. The number of chunks is implementation defined, but is 
+limited in the presence of a @fa<chunk_specification> to the determined 
+maximum. The loop iteration proceeds until the
+@fa<sequence_of_statements> has been executed for each component of the
+array for the loop, or until the loop is left as a consequence of a
+transfer of control.
+
+If a @fa<chunk_specification> with a @fa<discrete_subtype_definition> is 
+present in the associated parallel construct, then the logical thread of
+control associated with a given chunk has a chunk parameter
+initialized with a distinct value from the discrete subtype defined by
+the @fa<discrete_subtype_definition>. The values of the chunk parameters
+are assigned such that they increase in the canonical order of the
+starting array components for the chunks.
+
+!corrigendum 5.5.2(12/3)
+
+@drepl
+For a container element iterator, the @i<iterable_>@fa<name> is evaluated
+and the denoted iterable container object becomes the @i<iterable
+container object for the loop>. The default iterator function for the type of
+the iterable container object for the loop is called on the iterable container object
+and the result is the @i<loop iterator>. An object of the default
+cursor subtype is created (the @i<loop cursor>).
+@dby
+For a container element iterator, the @fa<chunk_specification> of the associated
+parallel construct, if any, is first elaborated to determine the maximum number 
+of chunks (see 5.5), and then the @i<iterable_>@fa<name> is evaluated
+and the denoted iterable container object becomes the @i<iterable
+container object for the loop>. The default iterator function for the type of
+the iterable container object for the loop is called on the iterable container object
+and the result is the @i<loop iterator>. For a sequential container element
+iterator, an object of the default cursor subtype is created (the @i<loop cursor>).
+For a parallel container element iterator, each chunk of iterations
+will have its own loop cursor, again of the default cursor subtype.
+
+!corrigendum 5.5.2(13/3)
+
+@drepl
+For a forward container element iterator, the operation First of the
+iterator type is called on the loop iterator, to produce the initial
+value for the loop cursor. If the result of calling Has_Element on
+the initial value is False, then the execution of the @fa<loop_statement>
+is complete. Otherwise, the @fa<sequence_of_statements> is executed with the
+loop parameter denoting an indexing (see 4.1.6) into the iterable container object
+for the loop, with the only parameter to the indexing being the
+current value of the loop cursor; then the Next operation of the
+iterator type is called with the loop iterator and the loop cursor to
+produce the next value to be assigned to the loop cursor. This
+repeats until the result of calling Has_Element on the loop cursor is
+False, or until the loop is left as a consequence of a transfer of control.
+For a reverse container element iterator, the operations Last and Previous
+are called rather than First and Next. If the loop parameter is a
+constant (see above), then the indexing uses the default constant
+indexing function for the type of the iterable container object for the loop;
+otherwise it uses the default variable indexing function.
+@dby
+A container element iterator then proceeds as described above for a
+generalized iterator, except that each reference to a loop parameter
+is replaced by a reference to the corresponding loop cursor. For a
+ontainer element iterator, the loop parameter for each iteration
+instead denotes an indexing (see 4.1.6) into the iterable container
+object for the loop, with the only parameter to the indexing being the
+value of the loop cursor for the given iteration. If the loop
+parameter is a constant (see above), then the indexing uses the
+default constant indexing function for the type of the iterable
+container object for the loop; otherwise it uses the default variable
+indexing function.
+
+!corrigendum 5.5.2(15/3)
+
+@drepl
+@xcode<-- @ft<@i<Array component iterator example:>>
+@b<for> Element @b<of> Board @b<loop>  -- @ft<@i<See 3.6.1.>>
+   Element := Element * 2.0; -- @ft<@i<Double each element of Board, a two-dimensional array.>>
+@b<end loop>;>
+@dby
+@xcode<-- @ft<@i<Array component iterator example:>>
+@b<parallel>
+@b<for> Element @b<of> Board @b<loop>  -- @ft<@i<See 3.6.1.>>
+   Element := Element * 2.0; -- @ft<@i<Double each element of Board, a two-dimensional array.>>
+@b<end loop>;>
+
+!corrigendum A.18.2(74.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Vector)
+      @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Vector)
+      @b<return> Vector_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.2(74.2/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Vector; Start : @b<in> Cursor)
+      @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Vector; Start : @b<in> Cursor)
+      @b<return> Vector_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.2(230.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Vector)
+   @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Vector)
+   @b<return> Vector_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+
+!corrigendum A.18.2(230.2/3)
+
+@drepl
+@xindent<Iterate returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel and reversible iterator object (see 5.5.1) 
+that will generate a value for a loop parameter (see 5.5.2) designating each 
+node in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator, and starting
+with all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.2(230.3/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Vector; Start : @b<in> Cursor)
+   @b<return> Vector_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Vector; Start : @b<in> Cursor)
+   @b<return> Vector_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.2(230.4/3)
+
+@drepl
+@xindent<If Start is not No_Element and does not designate an item in Container, then
+Program_Error is propagated. If Start is No_Element, then Constraint_Error is propagated.
+Otherwise, Iterate returns a reversible iterator object (see 5.5.1) that will generate
+a value for a loop parameter (see 5.5.2) designating each node in Container, starting with the
+node designated by Start and moving the cursor as per the Next function
+when used as a forward iterator, or moving the cursor as per the Previous
+function when used as a reverse iterator. Tampering with the cursors of Container
+is prohibited while the iterator object exists (in particular, in the
+@fa<sequence_of_statements> of the @fa<loop_statement> whose @fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+@dby
+@xindent<If Start is not No_Element and does not designate an item in Container, then
+Program_Error is propagated. If Start is No_Element, then Constraint_Error is propagated.
+Otherwise, Iterate returns a parallel and reversible iterator object (see 5.5.1) that 
+will generate a value for a loop parameter (see 5.5.2) designating each node in Container, 
+starting with the node designated by Start and moving the cursor as per the Next function
+when used as a forward iterator, or moving the cursor as per the Previous
+function when used as a reverse iterator, or all nodes concurrently when used as a
+parallel iterator. Tampering with the cursors of Container
+is prohibited while the iterator object exists (in particular, in the
+@fa<sequence_of_statements> of the @fa<loop_statement> whose @fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+
+!corrigendum A.18.3(46.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> List)
+      @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> List)
+      @b<return> List_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.3(46.2/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> List; Start : @b<in> Cursor)
+      @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> List; Start : @b<in> Cursor)
+      @b<return> List_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.3(144.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> List)
+   @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> List)
+   @b<return> List_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.3(144.2/3)
+
+@drepl
+@xindent<Iterate returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel and reversible iterator object (see 5.5.1) 
+that will generate a value for a loop parameter (see 5.5.2) designating each node 
+in Container, starting with
+the first node and moving the cursor as per the Next function when
+used as a forward iterator, and starting with the last node and moving
+the cursor as per the Previous function when used as a reverse iterator, and starting
+with all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.3(144.3/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> List; Start : @b<in> Cursor)
+   @b<return> List_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> List; Start : @b<in> Cursor)
+   @b<return> List_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.3(144.4/3)
+
+@drepl
+@xindent<If Start is not No_Element and does not designate an item in Container, then Program_Error
+is propagated. If Start is No_Element, then Constraint_Error is propagated.
+Otherwise, Iterate returns a reversible iterator object (see 5.5.1) that will generate
+a value for a loop parameter (see 5.5.2) designating each node in Container, starting with the
+node designated by Start and moving the cursor as per the Next function
+when used as a forward iterator, or moving the cursor as per the Previous
+function when used as a reverse iterator. Tampering with the cursors of Container
+is prohibited while the iterator object exists (in particular, in the
+@fa<sequence_of_statements> of the @fa<loop_statement> whose @fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+@dby
+@xindent<If Start is not No_Element and does not designate an item in 
+Container, then Program_Error is propagated. If Start is No_Element, then 
+Constraint_Error is propagated. Otherwise, Iterate returns a parallel and 
+reversible iterator object (see 5.5.1) that will generate
+a value for a loop parameter (see 5.5.2) designating each node in Container, 
+starting with the node designated by Start and moving the cursor as per the 
+Next function when used as a forward iterator, or moving the cursor as per 
+the Previous function when used as a reverse iterator, or all nodes 
+concurrently when used as a parallel iterator. Tampering with the cursors of 
+Container is prohibited while the iterator object exists (in particular, 
+in the @fa<sequence_of_statements> of the @fa<loop_statement> whose 
+@fa<iterator_specification>
+denotes this object). The iterator object needs finalization.>
+
+!corrigendum A.18.5(37.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Map)
+      @b<return> Map_Iterator_Interfaces.Forward_Iterator'Class;>
+
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Map)
+      @b<return> Map_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.5(61.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Map)
+   @b<return> Map_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Map)
+   @b<return> Map_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.5(61.2/3)
+
+@drepl
+@xindent<Iterate returns an iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, starting with
+the first node and moving the cursor according to the successor relation.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container,
+starting with the first node and moving the cursor according to the successor 
+relation when used as a forward iterator,
+and starting with all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.6(51.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Map)
+      @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Map)
+      @b<return> Map_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.6(51.2/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+      @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+      @b<return> Map_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.6(94.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Map)
+   @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Map)
+   @b<return> Map_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.6(94.2/3)
+
+@drepl
+@xindent<Iterate returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, starting with
+the first node and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last node and moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel and reversible iterator object (see 5.5.1) 
+that will generate a value for a loop parameter (see 5.5.2) designating each 
+node in Container, starting with
+the first node and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last node and moving
+the cursor according to the predecessor relation when used as a reverse 
+iterator, and starting with all nodes concurrently when used as a parallel 
+iterator. Tampering with the cursors of Container is prohibited while the 
+iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+
+!corrigendum A.18.6(94.3/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+   @b<return> Map_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Map; Start : @b<in> Cursor)
+   @b<return> Map_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.6(94.4/3)
+
+@drepl
+@xindent<If Start is not No_Element and does not designate an item in Container,
+then Program_Error is propagated. If Start is No_Element, then Constraint_Error is
+propagated. Otherwise, Iterate returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, starting with
+the node designated by Start and moving the cursor according to the successor relation
+when used as a forward iterator, or moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<If Start is not No_Element and does not designate an item in Container,
+then Program_Error is propagated. If Start is No_Element, then Constraint_Error is
+propagated. Otherwise, Iterate returns a parallel and reversible iterator object 
+(see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each node in Container, 
+starting with the node designated by Start and moving the cursor according to 
+the successor relation when used as a forward iterator, or moving
+the cursor according to the predecessor relation when used as a reverse iterator, 
+and starting with all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.8(49.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Set)
+      @b<return> Set_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Set)
+      @b<return> Set_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.8(85.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Set)
+   @b<return> Set_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Set)
+   @b<return> Set_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.8(85.1/3)
+
+@drepl
+@xindent<Iterate returns an iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each element in Container, starting with
+the first element and moving the cursor according to the successor relation.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel iterator object (see 5.5.1) that will 
+generate a value for a loop parameter (see 5.5.2) designating each element
+in Container, starting with the first element and moving the cursor according 
+to the successor relation when used as a forward iterator, and starting with 
+all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.9(61.1/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Set)
+      @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Set)
+      @b<return> Set_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.9(61.2/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+      @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+      @b<return> Set_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.9(113.1/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Set)
+   @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Set)
+   @b<return> Set_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.9(113.2/3)
+
+@drepl
+@xindent<Iterate returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each element in Container, starting with
+the first element and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last element and moving
+the cursor according to the predecessor relation when used as a reverse iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+@dby
+@xindent<Iterate returns a parallel and reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each element in Container, starting with
+the first element and moving the cursor according to the successor relation when
+used as a forward iterator, and starting with the last element and moving
+the cursor according to the predecessor relation when used as a reverse iterator, and
+starting with all nodes concurrently when used as a parallel iterator.
+Tampering with the cursors of Container is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator object
+needs finalization.>
+
+!corrigendum A.18.9(113.3/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+   @b<return> Set_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Set; Start : @b<in> Cursor)
+   @b<return> Set_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.9(113.4/3)
+
+@drepl
+@xindent<If Start is not No_Element and does
+not designate an item in Container, then Program_Error is propagated. If Start
+is No_Element, then Constraint_Error is propagated. Otherwise, Iterate returns
+a reversible iterator object (see 5.5.1) that will generate a value for a loop 
+parameter (see 5.5.2) designating
+each element in Container, starting with the element designated by Start and
+moving the cursor according to the successor relation when used as a forward
+iterator, or moving the cursor according to the predecessor relation when used
+as a reverse iterator. Tampering with the cursors of Container is prohibited while
+the iterator object exists (in particular, in the @fa<sequence_of_statements> of
+the @fa<loop_statement> whose @fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+@dby
+@xindent<If Start is not No_Element and does
+not designate an item in Container, then Program_Error is propagated. If Start
+is No_Element, then Constraint_Error is propagated. Otherwise, Iterate returns 
+a parallel and reversible iterator object (see 5.5.1) that will generate a 
+value for a loop parameter (see 5.5.2) designating
+each element in Container, starting with the element designated by Start and
+moving the cursor according to the successor relation when used as a forward
+iterator, or moving the cursor according to the predecessor relation when used
+as a reverse iterator, or all nodes concurrently when used as a
+parallel iterator. Tampering with the cursors of Container is prohibited while
+the iterator object exists (in particular, in the @fa<sequence_of_statements> of
+the @fa<loop_statement> whose @fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+
+
+!corrigendum A.18.10(44/3)
+
+@drepl
+@xcode<   @b<function> Iterate (Container : @b<in> Tree)
+      @b<return> Tree_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate (Container : @b<in> Tree)
+      @b<return> Tree_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.10(45/3)
+
+@drepl
+@xcode<   @b<function> Iterate_Subtree (Position : @b<in> Cursor)
+      @b<return> Tree_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate_Subtree (Position : @b<in> Cursor)
+      @b<return> Tree_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.10(70/3)
+
+@drepl
+@xcode<   @b<function> Iterate_Children (Container : @b<in> Tree; Parent : @b<in> Cursor)
+      @b<return> Tree_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<   @b<function> Iterate_Children (Container : @b<in> Tree; Parent : @b<in> Cursor)
+      @b<return> Tree_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.10(156/3)
+
+@drepl
+@xcode<@b<function> Iterate (Container : @b<in> Tree)
+   @b<return> Tree_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate (Container : @b<in> Tree)
+   @b<return> Tree_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.10(157/3)
+
+@drepl
+@xindent<Iterate returns an iterator object (see 5.5.1) that will generate a value for a
+loop parameter (see 5.5.2) designating each element in Container, starting from the root node and
+proceeding in a depth-first order. Tampering with the cursors of Container is prohibited
+while the iterator object exists (in particular, in the @fa<sequence_of_statements> of
+the @fa<loop_statement> whose @fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+@dby
+@xindent<Iterate returns a parallel iterator object (see 5.5.1) that will 
+generate a value for a loop parameter (see 5.5.2) designating each element in
+Container, starting from the root node and proceeding in a depth-first order 
+when used as a forward iterator, and starting with all nodes concurrently when 
+used as a parallel iterator. Tampering with the cursors of Container is 
+prohibited while the iterator object exists (in particular, in the 
+@fa<sequence_of_statements> of the @fa<loop_statement> whose 
+@fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+
+!corrigendum A.18.10(158/3)
+
+@drepl
+@xcode<@b<function> Iterate_Subtree (Position : @b<in> Cursor)
+   @b<return> Tree_Iterator_Interfaces.Forward_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate_Subtree (Position : @b<in> Cursor)
+   @b<return> Tree_Iterator_Interfaces.Parallel_Iterator'Class;>
+
+!corrigendum A.18.10(159/3)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated. Otherwise,
+Iterate_Subtree returns an iterator object (see 5.5.1) that will generate a value for
+a loop parameter (see 5.5.2) designating each element in the subtree rooted by the node
+designated by Position, starting from the node designated by Position and
+proceeding in a depth-first order. If Position equals No_Element, then Constraint_Error is
+propagated. Tampering with the cursors of the container that contains the node designated
+by Position is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the @fa<loop_statement>
+whose @fa<iterator_specification> denotes this object). The iterator
+object needs finalization.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated. 
+Otherwise, Iterate_Subtree returns a parallel iterator object (see 5.5.1) that 
+will generate a value for a loop parameter (see 5.5.2) designating each element 
+in the subtree rooted by the node designated by Position, starting from the 
+node designated by Position and
+proceeding in a depth-first order when used as a forward iterator, and starting
+with all nodes in the subtree concurrently when used as a parallel iterator. 
+If Position equals No_Element, then Constraint_Error is
+propagated. Tampering with the cursors of the container that contains the 
+node designated by Position is prohibited while the iterator object
+exists (in particular, in the @fa<sequence_of_statements> of the 
+@fa<loop_statement> whose @fa<iterator_specification> denotes this object). 
+The iterator object needs finalization.>
+
+!corrigendum A.18.10(218/3)
+
+@drepl
+@xcode<@b<function> Iterate_Children (Container : @b<in> Tree; Parent : @b<in> Cursor)
+   @b<return> Tree_Iterator_Interfaces.Reversible_Iterator'Class;>
+@dby
+@xcode<@b<function> Iterate_Children (Container : @b<in> Tree; Parent : @b<in> Cursor)
+   @b<return> Tree_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;>
+
+!corrigendum A.18.10(219/3)
+
+@drepl
+@xindent<Iterate_Children returns a reversible iterator object (see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each child node of Parent. If Parent equals
+No_Element, then Constraint_Error is propagated. If Parent does not designate a
+node in Container, then Program_Error is propagated. Otherwise, when used as a forward iterator,
+the nodes are designated starting with the first child node and
+moving the cursor as per the function Next_Sibling; when used as a reverse
+iterator, the nodes are designated starting with the last child node and
+moving the cursor as per the function Previous_Sibling. Tampering with the cursors of
+Container is prohibited while the iterator object exists (in particular,
+in the @fa<sequence_of_statements> of the @fa<loop_statement> whose
+@fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+@dby
+@xindent<Iterate_Children returns a parallel and reversible iterator object 
+(see 5.5.1) that will generate a
+value for a loop parameter (see 5.5.2) designating each child node of Parent. 
+If Parent equals
+No_Element, then Constraint_Error is propagated. If Parent does not designate a
+node in Container, then Program_Error is propagated. Otherwise, when used as 
+a forward iterator,
+the nodes are designated starting with the first child node and
+moving the cursor as per the function Next_Sibling; when used as a reverse
+iterator, the nodes are designated starting with the last child node and
+moving the cursor as per the function Previous_Sibling; when used
+as a parallel iterator, starting with all child nodes concurrently. Tampering 
+with the cursors of
+Container is prohibited while the iterator object exists (in particular,
+in the @fa<sequence_of_statements> of the @fa<loop_statement> whose
+@fa<iterator_specification> denotes this object).
+The iterator object needs finalization.>
+
 !ASIS
 
 ** TBD.
@@ -2193,6 +3218,83 @@
 
 Note that similar issues occur later for the other kinds of iterators, where
 you inserted "evaluation" rather than "elaboration".
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, January 30, 2019  1:22 AM
+
+The wording for the version of the vector Iterate with a Start parameter says 
+in part: (note: I left out the parts about exceptions and tampering; much that
+will be in the contracts anyway).
+
+function Iterate (Container : in Vector; Start : in Cursor)
+   return Vector_Iterator_Interfaces.Parallel_Reversible_Iterator'Class;
+
+Iterate returns a parallel and reversible iterator object (see 5.5.1) that 
+will generate a value for a loop parameter (see 5.5.2) designating each node
+in Container, starting with the node designated by Start and moving the 
+cursor as per the Next function when used as a forward iterator, or moving
+the cursor as per the Previous function when used as a reverse iterator, or
+all nodes concurrently when used as a parallel iterator.
+
+---
+
+As written, this essentially says that the Start parameter is ignored for a 
+parallel iterator, since the parallel iterator returns "all nodes 
+concurrently", and the basic description of this iterator says that it 
+"returns each node in Container". The value of Start doesn't seem to matter.
+
+But this is nonsense, since the iterator without a Start parameter does that. 
+We don't need two iterators that do exactly the same thing, and especially one
+that ignores its parameter.
+
+We need to do something with this:
+(1) Rewrite this in the parallel case to only return the nodes from Start to 
+    the end (which is a pain, and not that useful);
+(2) Forget the parallel capability for this iterator and the similar ones in 
+    other containers; or
+(3) Add an additional iterator with Start and Finish cursors. That could then 
+    be defined in a way that would make more sense for parallel execution.
+    (We didn't bother with an Iterate with Finish as we assumed that 
+    exit Cur = Finish; could be used to stop at a particular point -- but of 
+    course, that doesn't work very well for parallel execution.) [I think 
+    Brad mentioned this idea in the past.]
+
+One could define the iterator with Start only in terms of an iterator with 
+Finish, which might be better anyway, and it would give a sensible definition
+to the iterator with Start.
+
+Implementing Finish would be a bit of a pain, since it would require messing 
+with Next in a way that isn't necessary in the existing cases. The definition
+for reverse iterators also seems annoying.
+
+Thus, none of these plans seems clearly better than the others. I'd lean 
+toward (2), but mainly because it's the least work for me. (Not necessarily 
+the best reason for language design. ;-)
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, January 31, 2019  7:50 PM
+
+In addition to the previously noted problem, (stops to warm hands) I fixed the 
+wording in Iterate_Subtree to says: "starts with all nodes {in the subtree} 
+concurrently". And I added the parallel capability to Iterate_Children, which
+was inexplicably missing from the list of iterators to add that too. For that
+one, I said: "starts with all child nodes concurrently".
+
+Aside: "starts with all nodes concurrently" is a bit dubious, since what we 
+really want to happen is to split into chunks, and start with some node in 
+each chunk. But conceptually, starting them all concurrently seems OK.
+
+Second aside: The wording I quote below talks about "nodes", but there are no 
+nodes defined for vector containers (the canonical implementation is a 
+dynamically allocated array containing the elements directly).
+This is a preexisting problem: the only wording in vectors that talk about 
+nodes is the iterator wording. As such, I'll put that into a separate 
+clean-up AI, rather than trying to fix it in AI12-0266-1. (Warms hands
+again)
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent