From bobduff Wed Dec 16 15:53:18 1992 From: bobduff (Bob Duff) To: ada9x-mrt To: iso@ajpo.sei.cmu.edu Subject: LSN-1063 on Ada 9X Preference Rule !topic LSN on Ada 9X Preference Rule !key LSN-1063 on Ada 9X Preference Rule !reference MS-8.7;4.6 !reference RM83-4.6(15) !from Bob Duff $Date: 92/12/16 15:49:29 $ $Revision: 1.4 $ !discussion This Language Study Note is an update to LSN-1037. It addresses resolution number 9-8, "Preference Rule", from the Salem WG9 meeting. As Tucker explained at the Salem meeting, the new preference rule is: There is a preference for the primitive operators of the root numeric types root_integer and root_real. The rule is as follows: - In a given complete context, if two acceptable interpretations differ only in that one is for a primitive operator of the type root_integer or root_real, and the other is not, the interpretation using the primitive operator of the root numeric type is preferred. - For an innermost complete context, if there is exactly one overall acceptable interpretation where each constituent's interpretation is the same as or preferred (in the above sense) over those in all other overall acceptable interpretations, then that one overall acceptable interpretation is chosen. If the ambiguity cannot be resolved in this manner, the complete context is illegal. This is the same as stated in LSN-1037 and in the ILS, except that we have replaced "for a corresponding primitive operator for another numeric type" with "not". The reason for this change is upward compatibility. This rule is upward compatible except in cases involving Beaujolais effects. Ada 83 programs containing Beaujolais effects will be ambiguous, and therefore illegal, in Ada 9X. Thus, the rule is upward consistent. [Note that LSN-1037 incorrectly made this same claim for the rule stated there. We had modified the LPT rule to eliminate what we believed were confusing overload resolution rules, thus breaking the property as proven by the LPT, a fact that we missed when writing LSN-1037. The change to "not" restores the property.] WG9 requested study of this issue by the Language Precision Team (LPT). However, the LPT has already studied this issue in depth. For a detailed analysis of the elimination of Beaujolais effects, and the upward consistency of the proposed preference rule, see Chapter 6, "Overloading Preference Rules in Ada 9X", of the "Technical Operating Report (TOR) -- Formal Definition Report" of November 12, 1991, from the LPT. There are no plans for further study of this issue by the LPT. In any case, the alternative of reverting to the Ada 83 rules is not possible, for the reasons explained in LSN-1037. ------ Output from automsg.perl ------ Mail received from bobduff ----- Ignored header line(s): ----- !reference RM83-4.6(15) ----------------------------------- *** Key LSN-1063 given to topic 'LSN on Ada 9X Preference Rule' ----------- End of output ------------