Issue 14986: OCL 2.1 Feature Overloading Semantics are not defined (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: OCL supports feature overloading and attempts to comply with UML. OCL does not define feature overloading itself. UML leaves feature overloading as a semantic variation point. The OCL behaviour is therefore undefined. However a variety of behaviours particularly those involving null and invalid only make sense if operations are selected at run-time according to the dynamic type. The example from an earilier pending issue: Sequence(OclAny){3, 3.0, '3'}->count(-(-3)) = 2 wherein UnlimitedNatural 3 widens to Integer 3 for successful comparison with Integer 3 Real 3.0 is successfully compared to Integer 3 widened to Real String '3' widens to OclAny and fails to compare to Integer 3 widened to OclAny. is difficult to realise if static type resolution is applicable in which case all pair-wise value comparisons would use OclAny::= rather than Real::=. Suggest: OCL define that features are selected dynamically at run-time. Resolution: Revised Text: Actions taken: January 18, 2010: received issue Discussion: End of Annotations:===== ronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAIzVEtUXeby/2dsb2JhbADVbIQzBA Date: Mon, 18 Jan 2010 18:12:10 +0000 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: issues@omg.org Subject: OCL 2.1 Feature Overloading Semantics are not defined X-Plusnet-Relay: 0e05a837403ec1476f06b40ff7d1f740 Hi OCL supports feature overloading and attempts to comply with UML. OCL does not define feature overloading itself. UML leaves feature overloading as a semantic variation point. The OCL behaviour is therefore undefined. However a variety of behaviours particularly those involving null and invalid only make sense if operations are selected at run-time according to the dynamic type. The example from an earilier pending issue: Sequence(OclAny){3, 3.0, '3'}->count(-(-3)) = 2 wherein UnlimitedNatural 3 widens to Integer 3 for successful comparison with Integer 3 Real 3.0 is successfully compared to Integer 3 widened to Real String '3' widens to OclAny and fails to compare to Integer 3 widened to OclAny. is difficult to realise if static type resolution is applicable in which case all pair-wise value comparisons would use OclAny::= rather than Real::=. Suggest: OCL define that features are selected dynamically at run-time. Regards Ed Willink