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

Differences between 1.5 and version 1.6
Log of other versions for file ai12s/ai12-0196-1.txt

--- ai12s/ai12-0196-1.txt	2016/10/06 01:56:51	1.5
+++ ai12s/ai12-0196-1.txt	2016/11/12 01:05:44	1.6
@@ -1,6 +1,14 @@
-!standard A(3/4)                                 16-10-05   AI12-0196-1/05
-!standard A.18(5)
-!class Amendment 16-06-07
+!standard A.18(2/2)                                 16-11-11   AI12-0196-1/06
+!standard A.18.2(125/2)
+!standard A.18.2(133/3)
+!standard A.18.2(135/3)
+!standard A.18.3(81/3)
+!standard A.18.4(36/3)
+!standard A.18.7(34/2)
+!standard A.18.10(116/3)
+!class binding interpretation 16-10-10
+!status Amendment 1-2012 16-11-11
+!status ARG Approved 9-0-0  16-10-10
 !status work item 16-06-07
 !status received 16-06-05
 !priority Low
@@ -9,9 +17,10 @@
 
 !summary
 
-Parallel processing of containers
+The definition of the containers is modified to allow simple parallel
+processing of containers.
 
-!problem
+!question
 
 With the advent of multi-core computers, the performance of certain algorithms
 and data structures can be improved. The Ada standard containers are such data
@@ -23,11 +32,12 @@
 yet the call on the container may only be affecting a subset of the elements in the
 container, and may not affect state that is global to all of the elements being
 modified. Other calls only read elements of the container without modification.
-It seems it should be possible to apply parallelism to such cases so long as
+
+Should it be possible to apply parallelism to such cases so long as
 each independent thread operates on a unique, nonoverlapping set of elements
-from the container.
+from the container? (Yes.)
 
-!proposal
+!recommendation
 
 We propose to allow certain operations that manipulate or examine cursors
 (ie. Next, Previous, and Element) to be reentrant if the calls only accept
@@ -37,18 +47,10 @@
 
 !wording
 
-Modify A 3(4):
-
-   The implementation shall ensure that each language-defined subprogram
-   is reentrant in the sense that concurrent calls on any language-defined
-   subprogram{s (possibly the same)} perform as specified, so long as all objects
-   that are denoted by parameters that could be passed by reference or designated
-   by parameters of an access type are nonoverlapping.
-
 Modify A.18(2/2):
 
    A cursor referencing an element in a container is considered to be
-   overlapping {only} with the {element}[container] object itself.
+   overlapping {only} with the {element}[container object] itself.
 
 Modify AARM A.18(2.a/2)
    Reason: The last sentence is intended to clarify that operations
@@ -56,7 +58,7 @@
    different elements of the container}[on the same footing as operations that
    use a container] in terms of the reentrancy rules of Annex A.
 
-   {Ramification: A cursor is not considered to overlap with
+   {Ramification: A cursor is not considered to overlap with other elements of
    the associated container, thus parallel operations involving a set of cursors
    each operating on mutually exclusive sets of elements from the same container
    are expected to work.}
@@ -65,57 +67,56 @@
 
    Thus, it is only necessary for a user to protect a container if a single
    container needs to be used by multiple tasks {and concurrent calls to
-   the container are not reentrant}.
+   operations of the container have overlapping parameters.}.
 
-Append to A.18.2(125):
+Append to A.18.2(125/2):
 
-   For the purposes of determining whether To_Cursor is required to be
-   reenterant, the Container parameter is considered to not overlap
-   with any other object Redundant[(even with itself)].
-
-   AARM Ramification: Without the preceding rule, To_Cursor would not
-   be considered reentrant for concurrent calls on the same container object
-   by the reentrancy rules in A.3, since the container object of the concurrent
-   calls would overlap with itself. We want this to be
-   reentrant to allow parallel processing of Vectors to allow the Vector
-   elements to be split into separate "chunks" of processing.
+   For the purposes of determining whether the parameters overlap in a call to
+   To_Cursor, the container parameter is not considered to overlap with any
+   object Redundant[(including itself)].
+
+   AARM Reason: Without the preceding rule, concurrent calls to To_Cursor
+   on the same container would interfere by the reentrancy rules in Annex A,
+   since the container object of the concurrent calls would overlap with itself.
+   We want these to not interfere, for example to allow the Vector elements to
+   be split into separate "chunks" for parallel processing.
 
 Append to A.18.2(133/3):
 
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself], and the Index parameter is
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)], and the Index parameter is
    considered to overlap with the element at position Index.
 
 Append to A.18.2(135/3):
 
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself].
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)].
 
 Append to A.18.3(81/3):
 
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself].
-
-Append to A.18.4(81/3):
-
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself].
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)].
+
+Append to A.18.4(36/3):
+
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)].
 
 Append to A.18.7(34/2):
 
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself].
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)].
 
 Append to A.18.10(116/3):
 
-   For the purposes of determining whether Replace_Element is required to be 
-   reenterant, the Container parameter is considered to not overlap with any
-   other object Redundant[even with itself].
+   For the purposes of determining whether the parameters overlap in a call to
+   Replace_Element, the Container parameter is not considered to overlap with
+   any object Redundant[(including itself)].
 
 !discussion
 
@@ -352,6 +353,141 @@
                      Get_Cursor     => Get_Cursor'Access,
                      Process        => Process'Access);
    end;
+
+!corrigendum A.18(2/2)
+
+@drepl
+A variety of sequence and associative containers are provided. Each container
+includes a @i<cursor> type. A cursor is a reference to an element within a
+container. Many operations on cursors are common to all of the containers. A
+cursor referencing an element in a container is considered to be overlapping
+with the container object itself.
+@dby
+A variety of sequence and associative containers are provided. Each container
+includes a @i<cursor> type. A cursor is a reference to an element within a
+container. Many operations on cursors are common to all of the containers. A
+cursor referencing an element in a container is considered to be overlapping
+only with the element itself.
+
+!corrigendum A.18.2(125/2)
+
+@drepl
+@xindent<If Index is not in the range First_Index (Container) .. Last_Index
+(Container), then No_Element is returned. Otherwise, a cursor designating the
+element at position Index in Container is returned.>
+@dby
+@xindent<If Index is not in the range First_Index (Container) .. Last_Index
+(Container), then No_Element is returned. Otherwise, a cursor designating the
+element at position Index in Container is returned. For the purposes of
+determining whether the parameters overlap in a call to To_Cursor, the
+container parameter is not considered to overlap with any object (including
+itself).>
+
+!corrigendum A.18.2(133/3)
+
+@drepl
+@xindent<If Index is not in the range First_Index (Container) .. Last_Index (Container),
+then Constraint_Error is propagated. Otherwise, Replace_Element assigns the
+value New_Item to the element at position Index. Any exception raised during
+the assignment is propagated. The element at position Index is not an empty
+element after successful call to Replace_Element.>
+
+@dby
+@xindent<If Index is not in the range First_Index (Container) .. Last_Index (Container),
+then Constraint_Error is propagated. Otherwise, Replace_Element assigns the
+value New_Item to the element at position Index. Any exception raised during
+the assignment is propagated. The element at position Index is not an empty
+element after successful call to Replace_Element. For the purposes of
+determining whether the parameters overlap in a call to Replace_Element, the
+Container parameter is not considered to overlap with any object (including
+itself), and the Index parameter is considered to overlap with the element at
+position Index.>
+
+!corrigendum A.18.2(135/3)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error is
+propagated. Otherwise, Replace_Element assigns New_Item to the element
+designated by Position. Any exception raised during the assignment is
+propagated. The element at Position is not an empty element after successful
+call to Replace_Element.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error is
+propagated. Otherwise, Replace_Element assigns New_Item to the element
+designated by Position. Any exception raised during the assignment is
+propagated. The element at Position is not an empty element after successful
+call to Replace_Element. For the purposes of determining whether the parameters
+overlap in a call to Replace_Element, the Container parameter is not considered
+to overlap with any object (including itself).>
+
+!corrigendum A.18.3(81/3)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error is
+propagated. Otherwise, Replace_Element assigns the value New_Item to the
+element designated by Position.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error is
+propagated. Otherwise, Replace_Element assigns the value New_Item to the
+element designated by Position. For the purposes of determining whether the
+parameters overlap in a call to Replace_Element, the Container parameter is
+not considered to overlap with any object (including itself).>
+
+!corrigendum A.18.4(36/3)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error
+is propagated. Otherwise, Replace_Element assigns New_Item to the element of
+the node designated by Position.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error
+is propagated. Otherwise, Replace_Element assigns New_Item to the element of
+the node designated by Position. For the purposes of determining whether the
+parameters overlap in a call to Replace_Element, the Container parameter is
+not considered to overlap with any object (including itself).>
+
+!corrigendum A.18.7(34/2)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error
+is propagated. If an element equivalent to New_Item is already present in
+Container at a position other than Position, Program_Error is propagated.
+Otherwise, Replace_Element assigns New_Item to the element designated by
+Position. Any exception raised by the assignment is propagated.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container, then Program_Error
+is propagated. If an element equivalent to New_Item is already present in
+Container at a position other than Position, Program_Error is propagated.
+Otherwise, Replace_Element assigns New_Item to the element designated by
+Position. Any exception raised by the assignment is propagated. For the
+purposes of determining whether the parameters overlap in a call to
+Replace_Element, the Container parameter is not considered to overlap with
+any object (including itself).>
+
+!corrigendum A.18.10(116/3)
+
+@drepl
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container (including if it
+designates the root node), then Program_Error is propagated. Otherwise,
+Replace_Element assigns the value New_Item to the element designated by
+Position.>
+@dby
+@xindent<If Position equals No_Element, then Constraint_Error is propagated;
+if Position does not designate an element in Container (including if it
+designates the root node), then Program_Error is propagated. Otherwise,
+Replace_Element assigns the value New_Item to the element designated by
+Position. For the purposes of determining whether the parameters overlap in a
+call to Replace_Element, the Container parameter is not considered to overlap
+with any object (including itself).>
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent