CVS difference for ai05s/ai05-0191-1.txt
--- ai05s/ai05-0191-1.txt 2010/11/19 05:34:14 1.6
+++ ai05s/ai05-0191-1.txt 2010/12/15 00:10:59 1.7
@@ -1,4 +1,4 @@
-!standard 13.3(9/1) 10-10-30 AI05-0191-1/04
+!standard 13.3(9/1) 10-11-19 AI05-0191-1/05
!standard 13.3(73)
!class amendment 09-11-03
!status Amendment 2012 10-11-18
@@ -37,7 +37,7 @@
Change 13.3(9/1) as follows: The following representation attributes
are defined: Address, Alignment, Size, Storage_Size, [and]
-Component_Size{, Is_Same, and Overlaps}.
+Component_Size{, Has_Same_Storage, and Overlaps_Storage}.
Add after 13.3(73):
@@ -45,11 +45,11 @@
For a prefix X that denotes an object:
-X'Is_Same
+X'Has_Same_Storage
-X'Is_Same denotes a function with the following specification:
+X'Has_Same_Storage denotes a function with the following specification:
-function X'Is_Same(@i(A : any_type)) return Boolean;
+function X'Has_Same_Storage(@i(A : any_type)) return Boolean;
The actual parameter shall be a name that denotes an object. The object denoted
by the actual parameter can be of any type. This function evaluates the names
@@ -57,7 +57,7 @@
denoted by the actual parameter occupies exactly the same bits as the
representation of the object denoted by X; it is false otherwise.
-AARM Note: Is_Same means that, if the representation is contiguous,
+AARM Note: Has_Same_Storage means that, if the representation is contiguous,
the objects sit at the same address and occupy the same length of
memory.
@@ -66,11 +66,11 @@
For a prefix X that denotes an object:
-X'Overlaps
+X'Overlaps_Storage
-X'Overlaps denotes a function with the following specification:
+X'Overlaps_Storage denotes a function with the following specification:
-function X'Overlaps(@i(Arg: any_type))
+function X'Overlaps_Storage(@i(Arg: any_type))
return Boolean;
The actual parameter shall be a name that denotes an object. The object denoted
@@ -81,9 +81,9 @@
NOTES:
-X'Is_Same(Y) implies X'Overlaps(Y).
+X'Has_Same_Storage(Y) implies X'Overlaps_Storage(Y).
-X'Is_Same(Y) and X'Overlaps(Y) are not considered to be reads of X and Y.
+X'Has_Same_Storage(Y) and X'Overlaps_Storage(Y) are not considered to be reads of X and Y.
!discussion
@@ -119,8 +119,8 @@
However, this does not cover aliasing achieved by unchecked or unsafe
programming, as is needed occasionally, e.g., in implementing heap
management. To extend the predicates to cover this case as well, the
-Is_Same predicate needs to accommodate arguments of arbitrary, unrelated
-types. For the Overlaps predicate, an argument of any type needs to be
+Has_Same_Storage predicate needs to accommodate arguments of arbitrary, unrelated
+types. For the Overlaps_Storage predicate, an argument of any type needs to be
accepted in any case (or, in a strictly type-safe variant, any
subcomponent type). Again, this cannot be reasonably done without
language magic. Generics are not a good answer, since the needed
@@ -131,25 +131,25 @@
predefined package with predicate definitions or predefined
predicates) a solution via predefined attributes of objects is selected:
-O'Is_Same(X: <any type>)
-O'Overlaps(X: <any type>)
+O'Has_Same_Storage(X: <any type>)
+O'Overlaps_Storage(X: <any type>)
-Is_Same returns true if the argument X occupies exactly the same
+Has_Same_Storage returns true if the argument X occupies exactly the same
memory space as O, it returns false otherwise.
-Overlaps returns true if the argument X shares any part of the memory
-space with O, it returns false otherwise. Is_Same implies Overlaps.
+Overlaps_Storage returns true if the argument X shares any part of the memory
+space with O, it returns false otherwise. Has_Same_Storage implies Overlaps_Storage.
-It has been suggested to define Not_Same and Not_Overlaps instead,
-since most predicates will assert the absence of aliasing. While this
-is true, the extreme ugliness of "not Not_Overlaps" to assert partial
-aliasing speaks in favor of not using negatives as predefined boolean
-attributes.
+It has been suggested to define Not_Same_Storage and Not_Overlaps_Storage
+instead, since most predicates will assert the absence of aliasing. While
+this is true, the extreme ugliness of "not Not_Overlaps_Storage" to assert
+partial aliasing speaks in favor of not using negatives as predefined
+boolean attributes.
-It has been suggested that Is_Same could require the same type as the
+It has been suggested that Has_Same_Storage could require the same type as the
object whose attribute is queried to make the check more efficient. A
simplification of the check would be possible only if the same
-constrained subtype were required. Also, the dissimilarity to Overlaps
+constrained subtype were required. Also, the dissimilarity to Overlaps_Storage
is a (small) argument against it; the major counter-argument is the
exclusion of type-unsafe aliasing. A compiler can optimize the
Is_Same attribute to a simple address equality when it recognizes the
@@ -164,7 +164,7 @@
procedure Exchange_Values(A, B: ref_type) Assert(not A'IsSame(B));
-Assert(not A'Overlaps(B(i))); A(B(i)) := A(B(i)) + 1;
+Assert(not A'Overlaps_Storage(B(i))); A(B(i)) := A(B(i)) + 1;
-- intended to count in A the number of value occurrences in B
-- part of a distribution sort
@@ -174,7 +174,7 @@
!ASIS
-Add two literals An_Is_Same_Attribute and An_Overlaps_Attribute to
+Add two literals An_Is_Same_Attribute and An_Overlaps_Storage_Attribute to
Attritbute_Kinds.
@@ -386,6 +386,23 @@
Same is true for A(i)'Overlaps(C), but this still is logically no read of A(i).
The point was that these attributes work on uninitialized variables or on those
with invalid values. Hence also the "evaluates the name".
+
+****************************************************************
+
+Summary of phone meeting, November 19, 2010
+
+Change to names: Gary's suggestions of Overlaps_Storage and Has_Same_Storage
+are OK.
+
+Brad suggests instead Storage_Overlaps, Storage_Equals. We don't like Equals,
+as it seems to mean something else.
+
+We're not sure if Storage_Overlaps or Overlaps_Storage is better.
+This is sort of an infix call (as it is an attribute with a prefix).
+A'Overlaps_Storage(B). So the order Gary suggested seems best. We'll leave
+these as Gary suggested.
+
+These will be treated as an editorial fix (this AI was previously approved).
****************************************************************
Questions? Ask the ACAA Technical Agent