Issue 16048: oclIsInState() (ocl2-rtf) Source: NASA (Dr. Nicolas F. Rouquette, nicolas.f.rouquette(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: Summary: Since you are working on the StateMachines chapter, it may be worth considering after the first submission adding an explanation about oclIsInState(). This query operation is unfortunately mispelled as oclInState(), see: http://www.omg.org/issues/ocl2-rtf.open.html#Issue15257 This query operation is confusingly listed as a predefined property and explained as an operation in OCL2.2, clause 7.5.9: 7.5.9 Predefined properties on All Objects There are several properties that apply to all objects, and are predefined in OCL. These are: oclIsTypeOf (t : Classifier) : Boolean oclIsKindOf (t : Classifier) : Boolean oclInState (s : OclState) : Boolean oclIsNew () : Boolean oclAsType (t : Classifier) : instance of OclType .... The operation oclInState(s) results in true if the object is in the state s. Possible states for the operation oclInState(s) are all states of the statemachine that defines the classifier's behavior. For nested states the statenames can be combined using the double colon “::”. Resolution: Revised Text: Actions taken: March 7, 2011: received issue Discussion: End of Annotations:===== m: "Rouquette, Nicolas F (313K)" To: Bran Selic CC: "uml-spec-simplification@omg.org" , "ocl2-rtf@omg.org" Date: Mon, 7 Mar 2011 07:57:58 -0800 Subject: oclIsInState() Thread-Topic: oclIsInState() Thread-Index: Acvc4G4ojBxD9+ASSkeAiFXJuejFBQ== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Source-IP: altvirehtstap02.jpl.nasa.gov [128.149.137.73] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized Bran, Since you are working on the StateMachines chapter, it may be worth considering after the first submission adding an explanation about oclIsInState(). This query operation is unfortunately mispelled as oclInState(), see: http://www.omg.org/issues/ocl2-rtf.open.html#Issue15257 This query operation is confusingly listed as a predefined property and explained as an operation in OCL2.2, clause 7.5.9: 7.5.9 Predefined properties on All Objects There are several properties that apply to all objects, and are predefined in OCL. These are: oclIsTypeOf (t : Classifier) : Boolean oclIsKindOf (t : Classifier) : Boolean oclInState (s : OclState) : Boolean oclIsNew () : Boolean oclAsType (t : Classifier) : instance of OclType .... The operation oclInState(s) results in true if the object is in the state s. Possible states for the operation oclInState(s) are all states of the statemachine that defines the classifier's behavior. For nested states the statenames can be combined using the double colon .::.. - Nicolas. ronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsGACOWdE1UXeb0/2dsb2JhbAClelp0vkiCIINCBA Date: Mon, 07 Mar 2011 16:27:37 +0000 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 To: "Rouquette, Nicolas F (313K)" CC: Bran Selic , "uml-spec-simplification@omg.org" , "ocl2-rtf@omg.org" Subject: Re: oclIsInState() Hi Nicolas I think it was you who expressed the view that OCL was cluttered with stuff that was nothing to do with OCL. Now that I have the OCL Standard Library modeled, it is possible to consider identifying a core library. StateMachines can then add a merged Standard Library document that extends the core library by defining ---------------------- type OclAny : AnyType { operation oclIsInState(statespec : OclState) : Boolean; } type OclState conformsTo OclAny {} ---------------------- This would eliminate State from OCL. NB. A form of package merge is a fundamental part of the missing specification of how OCL allows Complete OCL documents to extend OclAny. A similar approach to modularize out messages is desirable, but here there is a concrete syntax merge for "^, ^^, ?" to accommodate. It would make more sense for UML to define the OCL Standard Library extension for StateMachines. Regards Ed Willink On 07/03/2011 15:57, Rouquette, Nicolas F (313K) wrote: Bran, Since you are working on the StateMachines chapter, it may be worth considering after the first submission adding an explanation about oclIsInState(). This query operation is unfortunately mispelled as oclInState(), see: http://www.omg.org/issues/ocl2-rtf.open.html#Issue15257 This query operation is confusingly listed as a predefined property and explained as an operation in OCL2.2, clause 7.5.9: 7.5.9 Predefined properties on All Objects There are several properties that apply to all objects, and are predefined in OCL. These are: oclIsTypeOf (t : Classifier) : Boolean oclIsKindOf (t : Classifier) : Boolean oclInState (s : OclState) : Boolean oclIsNew () : Boolean oclAsType (t : Classifier) : instance of OclType .... The operation oclInState(s) results in true if the object is in the state s. Possible states for the operation oclInState(s) are all states of the statemachine that defines the classifier's behavior. For nested states the statenames can be combined using the double colon .::.. - Nicolas. -------------------------------------------------------------------------------- No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3486 - Release Date: 03/06/11 From: "Rouquette, Nicolas F (313K)" To: Ed Willink CC: Bran Selic , "uml-spec-simplification@omg.org" , "ocl2-rtf@omg.org" Date: Mon, 7 Mar 2011 09:01:35 -0800 Subject: Re: oclIsInState() Thread-Topic: oclIsInState() Thread-Index: Acvc6VGn3rMtHu07QUC4bbIEvM5/tQ== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Source-IP: altvirehtstap01.jpl.nasa.gov [128.149.137.72] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized Ed, type OclState conformsTo OclAny {} Shouldn't there be a specification that OclState corresponds to UML::State? type OclAny : AnyType { operation oclIsInState(statespec : OclState) : Boolean; } At minimum, this operation should have: pre: self.oclIsKindOf(UML::StateMachine) How do you specify what this operation does? Do you have to revert to the implementation of the library or can we specify an extension library in OCL itself? - Nicolas. On Mar 7, 2011, at 8:27 AM, Ed Willink wrote: Hi Nicolas I think it was you who expressed the view that OCL was cluttered with stuff that was nothing to do with OCL. Now that I have the OCL Standard Library modeled, it is possible to consider identifying a core library. StateMachines can then add a merged Standard Library document that extends the core library by defining ---------------------- type OclAny : AnyType { operation oclIsInState(statespec : OclState) : Boolean; } type OclState conformsTo OclAny {} ---------------------- This would eliminate State from OCL. NB. A form of package merge is a fundamental part of the missing specification of how OCL allows Complete OCL documents to extend OclAny. A similar approach to modularize out messages is desirable, but here there is a concrete syntax merge for "^, ^^, ?" to accommodate. It would make more sense for UML to define the OCL Standard Library extension for StateMachines. Regards Ed Willink On 07/03/2011 15:57, Rouquette, Nicolas F (313K) wrote: Bran, Since you are working on the StateMachines chapter, it may be worth considering after the first submission adding an explanation about oclIsInState(). This query operation is unfortunately mispelled as oclInState(), see: http://www.omg.org/issues/ocl2-rtf.open.html#Issue15257 This query operation is confusingly listed as a predefined property and explained as an operation in OCL2.2, clause 7.5.9: 7.5.9 Predefined properties on All Objects There are several properties that apply to all objects, and are predefined in OCL. These are: oclIsTypeOf (t : Classifier) : Boolean oclIsKindOf (t : Classifier) : Boolean oclInState (s : OclState) : Boolean oclIsNew () : Boolean oclAsType (t : Classifier) : instance of OclType .... The operation oclInState(s) results in true if the object is in the state s. Possible states for the operation oclInState(s) are all states of the statemachine that defines the classifier's behavior. For nested states the statenames can be combined using the double colon .::.. - Nicolas. -------------------------------------------------------------------------------- No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3486 - Release Date: 03/06/11 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsGAF6ldE3Unw4U/2dsb2JhbACldFp0vimCIINCBA Date: Mon, 07 Mar 2011 17:33:56 +0000 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 To: "Rouquette, Nicolas F (313K)" CC: Bran Selic , "uml-spec-simplification@omg.org" , "ocl2-rtf@omg.org" Subject: Re: oclIsInState() Hi Nicolas type OclState conformsTo OclAny {} Shouldn't there be a specification that OclState corresponds to UML::State? Exactly the kind of thing we need to stop being intuitive about. I expect UML::State to become OCL::State, after Complete OCL merging. So with OCL:: the implicit default package, type OclState : State conforms to OclAny {} type OclAny : AnyType { operation oclIsInState(statespec : OclState) : Boolean; } At minimum, this operation should have: pre: self.oclIsKindOf(UML::StateMachine) How do you specify what this operation does? In practice: Currently the Eclipse OCL specification in /org.eclipse.ocl.examples.library/model/OCL-2.4.oclstdlib is actually: operation oclIsInState(statespec : OclState) : Boolean => 'org.eclipse.ocl.examples.library.oclany.OclAnyOclIsInStateOperation'; associating a feature-specific JavaClass with the library signature. For now, I regard the "=> 'classname'" as an implementation-specific extension whereas the rest of the signature is a candidate for OMG endorsement. Perhaps the various OCL implementors may converge on the Class API and so encourage development of a "Java binding for OCL" specification. In principle: There would be no problem in hijacking a bit more Complete OCL syntax, though I prefer {}'s and trailing ;'s to do: operation oclIsInState(statespec : OclState) : Boolean => 'org.eclipse.ocl.examples.library.oclany.OclAnyOclIsInStateOperation' { pre: self.oclIsKindOf(UML::StateMachine); body: .... post: .... } One day with a good OCL code generator post and/or body may be sufficient to synthesize the implementation. Do you have to revert to the implementation of the library or can we specify an extension library in OCL itself? The intention is to support library aggregation by naive merge, so that users can define enhanced String functionality, or so that derived languages such as QVT or MOFM2T can have extended standard libraries and allow third parties to provide useful libraries. [A modeled library also assists in isolating version-specifics.] Regards Ed - Nicolas. On Mar 7, 2011, at 8:27 AM, Ed Willink wrote: Hi Nicolas I think it was you who expressed the view that OCL was cluttered with stuff that was nothing to do with OCL. Now that I have the OCL Standard Library modeled, it is possible to consider identifying a core library. StateMachines can then add a merged Standard Library document that extends the core library by defining ---------------------- type OclAny : AnyType { operation oclIsInState(statespec : OclState) : Boolean; } type OclState conformsTo OclAny {} ---------------------- This would eliminate State from OCL. NB. A form of package merge is a fundamental part of the missing specification of how OCL allows Complete OCL documents to extend OclAny. A similar approach to modularize out messages is desirable, but here there is a concrete syntax merge for "^, ^^, ?" to accommodate. It would make more sense for UML to define the OCL Standard Library extension for StateMachines. Regards Ed Willink On 07/03/2011 15:57, Rouquette, Nicolas F (313K) wrote: Bran, Since you are working on the StateMachines chapter, it may be worth considering after the first submission adding an explanation about oclIsInState(). This query operation is unfortunately mispelled as oclInState(), see: http://www.omg.org/issues/ocl2-rtf.open.html#Issue15257 This query operation is confusingly listed as a predefined property and explained as an operation in OCL2.2, clause 7.5.9: 7.5.9 Predefined properties on All Objects There are several properties that apply to all objects, and are predefined in OCL. These are: oclIsTypeOf (t : Classifier) : Boolean oclIsKindOf (t : Classifier) : Boolean oclInState (s : OclState) : Boolean oclIsNew () : Boolean oclAsType (t : Classifier) : instance of OclType .... The operation oclInState(s) results in true if the object is in the state s. Possible states for the operation oclInState(s) are all states of the statemachine that defines the classifier's behavior. For nested states the statenames can be combined using the double colon .::.. - Nicolas. -------------------------------------------------------------------------------- No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3486 - Release Date: 03/06/11 -------------------------------------------------------------------------------- No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3486 - Release Date: 03/06/11