CVS difference for ai05s/ai05-0191-1.txt

Differences between 1.3 and version 1.4
Log of other versions for file ai05s/ai05-0191-1.txt

--- ai05s/ai05-0191-1.txt	2010/10/26 05:09:17	1.3
+++ ai05s/ai05-0191-1.txt	2010/11/12 04:38:30	1.4
@@ -1,4 +1,5 @@
-!standard H.8(0)                                10-10-25  AI05-0191-1/02
+!standard 13.3(9/1)                                10-10-30  AI05-0191-1/03
+!standard 13.3(73)
 !class amendment 09-11-03
 !status work item 09-11-03
 !status received 09-11-03
@@ -8,8 +9,8 @@
 
 !summary
 
-Two attributes are defined for all objects to allow determination of partial or
-full aliasing with another object.
+Two attributes are defined for all objects to allow determination of
+partial or full aliasing with another object.
 
 !problem
 
@@ -34,46 +35,63 @@
 
 Change 13.3(9/1) as follows: The following representation attributes
 are defined: Address, Alignment, Size, Storage_Size, [and]
-Component_Size{, External_Tag, Is_Same and Overlaps}.
+Component_Size{, Is_Same, and Overlaps}.
 
-<<<<< Note old bug: the External_Tag needs to be added in any case. >>>>
+Add after 13.3(73):
 
-Add after 13.3 78a:
-
 Static Semantics:
 
 For a prefix X that denotes an object:
-X'Is_Same(A)
+
+X'Is_Same
 
-A must denote an object. The object denoted by A can be of any type.
+X'Is_Same denotes a function with the following specification:
 
-The type of this attribute is Boolean. Its value is true if the object
-denoted by A occupies exactly the same memory space as the object
+function X'Is_Same(@i(A : any_type)) return Boolean;
+
+The actual parameter shall denote an object. The object denoted by the
+actual parameter can be of any type.  This function returns true if
+the representation of the object 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 the objects sit at the same address and
-occupy the same length of memory.
+AARM Note: Is_Same means that, if the representation is contiguous,
+the objects sit at the same address and occupy the same length of
+memory.
 
 
 Static Semantics:
 
 For a prefix X that denotes an object:
-X'Overlaps(A)
+
+X'Overlaps
+
+X'Overlaps denotes a function with the following specification:
+
+function X'Overlaps(@i(Arg: any_type))
+  return Boolean;
+
+The actual parameter shall denote an object. The object denoted by the
+actual parameter can be of any type.  This function returns true if
+the representation of the object denoted by the actual parameter
+shares at least one bit with the representation of the object
+denoted by X; it is false otherwise.
 
-A must denote an object. The object denoted by A can be of any type.
+NOTES:
 
-The type of this attribute is Boolean. Its value is true if the object
-denoted by A shares any part of its memory space with the object
-denoted by X; it is false otherwise. Is_Same(A) implies Overlaps(A).
+X'Is_Same(Y) implies X'Overlaps(Y).
 
+X'Is_Same(Y) and X'Overlaps(Y) are not considered to be reads of X and Y.
+
+
 !discussion
 
 Casting such memory-related predicates into the semantic framework of
 Ada 2005 is surprisingly difficult.
 
 Since these predicates are defined over the location of the arguments
-rather than their values, a definition that employs boolean functions
-with these objects as arguments cannot achieve the desired
+rather than their values, a definition that employs "normal" boolean
+functions with these objects as arguments cannot achieve the desired
 purpose. Passing parameters by value would have to be prohibited for
 such functions, which would call for language definition magic. In
 addition, fixing the type of the parameter(s) introduces restrictions
@@ -108,9 +126,8 @@
 merely add text to the code.
 
 Among several alternatives (rejected alternatives include a magic
-predefined package with predicate definitions, or predefined
-predicates) a solution via predefined attributes of objects is
-selected:
+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>)
@@ -136,14 +153,28 @@
 Is_Same attribute to a simple address equality when it recognizes the
 (sub)types of the objects to have equal length.
 
+The attributes are styled along the existing attribute 'Val, even though
+the referential nature of the actual argument requires a deviation from
+the normal model of functions.
 
+
 !example
+
+procedure Exchange_Values(A, B: ref_type) Assert(not A'IsSame(B));
 
-** TBD **
+Assert(not A'Overlaps(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
 
 !ACATS test
 
 An ACATS C test is needed for this feature.
+
+!ASIS
+
+Add two literals An_Is_Same_Attribute and An_Overlaps_Attribute to
+Attritbute_Kinds.
+
 
 !appendix
 

Questions? Ask the ACAA Technical Agent