Issue 15258: OCL 2.2 OclMessage types are not statically derivable (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: The intro to Section 8.2 states: "OCL is a typed language. Each expression has a type that is either explicitly declared or can be statically derived." However OclMessage lacks type parameterisation and so the 7.7.2 example context Subject::hasChanged() post: let messages : Sequence(OclMessage) = observer^^update(? : Integer, ? : Integer) in messages->notEmpty() and messages->exists( m | m.i > 0 and m.j >= m.i ) only works if the type analysis proceeds beyond "messages : Sequence(OclMessage)" to discover the initialiser with formal signature "Observer::update(i : Integer, j : Integer)". This will not in general be possible and so expressions such as "m.i > 0" cannot be statically checked, and cannot be dynamically expressed. Indeed since m is an OclMessage, "m.i" is not well-formed. Suggest that OclMessage is redefined as: OclMessage<OclOperation> or OclMessage<OclSignal> requiring the type to be determinate or discovered by oclAsType. Resolution: Revised Text: Actions taken: May 18, 2010: received issue Discussion: End of Annotations:===== m: "Willink, Ed" To: "'issues@omg.org'" Subject: OCL 2.2 OclMessage types are not statically derivable. Date: Tue, 18 May 2010 17:46:32 +0100 X-Mailer: Internet Mail Service (5.5.2657.72) Hi The intro to Section 8.2 states: "OCL is a typed language. Each expression has a type that is either explicitly declared or can be statically derived." However OclMessage lacks type parameterisation and so the 7.7.2 example context Subject::hasChanged() post: let messages : Sequence(OclMessage) = observer^^update(? : Integer, ? : Integer) in messages->notEmpty() and messages->exists( m | m.i > 0 and m.j >= m.i ) only works if the type analysis proceeds beyond "messages : Sequence(OclMessage)" to discover the initialiser with formal signature "Observer::update(i : Integer, j : Integer)". This will not in general be possible and so expressions such as "m.i > 0" cannot be statically checked, and cannot be dynamically expressed. Indeed since m is an OclMessage, "m.i" is not well-formed. Suggest that OclMessage is redefined as: OclMessage or OclMessage requiring the type to be determinate or discovered by oclAsType. Regards Ed Willink Please consider the environment before printing a hard copy of this e-mail. The information contained in this e-mail is confidential. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. If you have received this e-mail in error, please inform us immediately on +44 (0)118 923 8243 and delete it and all copies from your system. Thales Corporate Services Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 959962. Thales UK Limited. A company registered in England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number: 868273