CVS difference for ai05s/ai05-0191-1.txt
--- ai05s/ai05-0191-1.txt 2010/11/12 04:38:30 1.4
+++ ai05s/ai05-0191-1.txt 2010/11/18 07:07:35 1.5
@@ -1,4 +1,4 @@
-!standard 13.3(9/1) 10-10-30 AI05-0191-1/03
+!standard 13.3(9/1) 10-10-30 AI05-0191-1/04
!standard 13.3(73)
!class amendment 09-11-03
!status work item 09-11-03
@@ -22,7 +22,7 @@
memory, and the second asserts that the two arguments are in fact occupying the
exact same memory location.
-Yet, formulating these predicates in Ada is cumbersome and errorprone.
+Yet, formulating these predicates in Ada is cumbersome and error prone.
It would be nice to provide these predicates as part of the language
definition.
@@ -49,11 +49,11 @@
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.
+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
+of the objects involved and 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, if the representation is contiguous,
the objects sit at the same address and occupy the same length of
@@ -71,11 +71,11 @@
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.
+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
+of the objects involved and 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.
NOTES:
@@ -225,3 +225,165 @@
attribute. Its header can be found at 13.3(73.1/1).
****************************************************************
+
+From: Erhard Ploedereder
+Sent: Tuesday, October 26, 2010 1:10 AM
+
+> This is not a bug: External_Tag is an operational, not representation,
+> attribute.
+
+Oops. Then the new text needs to go a few paragraphs further up, I guess.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Saturday, October 30, 2010 4:46 PM
+
+[He's referring to version /03, previously posted and not repeated here -
+Editor.]
+
+I really don't like the name Is_Same, seems much too generic, and sounds like it
+is testing for identical entities or somesuch, I would use
+
+Overlapping_Address_Range
+Same_Address_Range
+
+since this is what this is really about.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Saturday, October 30, 2010 5:35 PM
+
+Address_Range is misleading. "Range" in Ada implies contiguous, while we are
+trying to accommodate discontiguous representations.
+
+Something like "Occupies_Same_Bits" might be appropriate. Or perhaps
+X'Overlays(Y) when they shall all of their bits, and X'Overlaps(Y) when they
+share at least one bit.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Saturday, October 30, 2010 5:37 PM
+
+OK, I think worrying about non-contiguous representations is probably
+unnecessary in practice, but I see what you mean. Yes, either of those would be
+OK.
+
+****************************************************************
+
+From: Erhard Ploedereder
+Sent: Saturday, October 30, 2010 6:01 PM
+
+I preferred some more abstract terms to be closer to the concept "Aliasing" that
+to the concept "Representation". After all, I expect their use in Assertions and
+Pre- and Postconditions.
+
+Is_Same may be a bit bland. Fully_Aliased and Partially_Aliased was where I
+started. I'd rather not have the bits creep into the name.
+
+****************************************************************
+
+From: Bob Duff
+Sent: Saturday, October 30, 2010 6:06 PM
+
+> > Address_Range is misleading. "Range" in Ada implies contiguous,
+> > while we are trying to accommodate discontiguous representations.
+
+More importantly, we want to accomodate packed bit-fields.
+
+> > Something like "Occupies_Same_Bits" might be appropriate. Or
+> > perhaps X'Overlays(Y) when they shall all of their bits, and
+> > X'Overlaps(Y) when they share at least one bit.
+
+I like ..._Same_Bits. Is_Same is really way too general of a name.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Saturday, October 30, 2010 6:32 PM
+
+> More importantly, we want to accomodate packed bit-fields.
+
+True, that does make sense ...
+
+> I like ..._Same_Bits. Is_Same is really way too general of a name.
+
+So perhaps Same_Bits and Overlapping_Bits
+
+****************************************************************
+
+From: Gary Dismukes
+Sent: Saturday, October 30, 2010 9:40 PM
+
+> Is_Same may be a bit bland. Fully_Aliased and Partially_Aliased was
+> where I started. I'd rather not have the bits creep into the name.
+
+How about something like Has_Same_Storage and Overlaps_Storage?
+That would avoid mentioning bits. Maybe still too low-level?
+
+Tucker's suggestions of Overlays and Overlaps also seem OK, though it's too bad
+they only differ in one character.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, November 7, 2010 8:43 AM
+
+> How about something like Has_Same_Storage and Overlaps_Storage?
+> That would avoid mentioning bits. Maybe still too low-level?
+
+This *is* a low level thing that cannot be explained easily in formal terms, so
+it is fine to have low level names. I like these ones.
+
+> Tucker's suggestions of Overlays and Overlaps also seem OK, though
+> it's too bad they only differ in one character.
+
+Seems too high level to me. The question is are we talking about some low level
+check, or some high level semantic attribute with full "as-if" rules in place. I
+think the former!
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Sunday, November 7, 2010 9:01 AM
+
+I also like "Has_Same_Storage" and "Overlaps_Storage."
+Getting the word "storage" in there seems to remove some of the ambiguity,
+without introducing the somewhat jarring word "bits" into the names.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Saturday, October 30, 2010 5:12 PM
+
+> X'Is_Same(Y) and X'Overlaps(Y) are not considered to be reads of X and Y.
+
+No, but in a case like
+
+ X.A'Overlaps(Y.B)
+
+if the records X and Y have dynamic components you may need to read all sorts of
+bound information etc from the record to figure out the addresses of the two
+fields???
+
+****************************************************************
+
+From: Erhard Ploedereder
+Sent: Saturday, October 30, 2010 5:56 PM
+
+> No, but in a case like
+>
+> X.A'Overlaps(Y.B)
+>
+>> if the records X and Y have dynamic components you may need to read
+> all sorts of bound information etc from the record to figure out the
+> addresses of the two fields???
+
+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".
+
+****************************************************************
+
Questions? Ask the ACAA Technical Agent