Issue 8917: allInstances (ocl2-rtf) Source: David Frankel Consulting (Mr. David Frankel, david(at)dfrankelconsulting.com) Nature: Uncategorized Issue Severity: Summary: It is not entirely clear from the OCL 2.0 specification whether the allInstances operation returns instances of subclasses of the designated type. In other words, it isn't 100% clear whether t.allInstances( ) returns instances of subclasses of t. Recommendation: The best solution would be to have two operations, one which returns instances of subclasses and one which does not. A second-best solution would be to make it clear that allInstances returns instances of subclasses. In this case, an OCL programmer could use the oclIsTypeOf( ) operation as a filter to write a derived operation that does not return instances of subclasses. If allInstances does not return instances of subclasses, it would not be nearly as straightforward to write a derived operation that does return instances of subclasses. Resolution: Revised Text: Update the allInstances() definition in Section 11.2.5 Operations and Wel-formedness Rules: allInstances() : Set(T) Returns all instances of T, including subtypes, where T is self. May only be used for classifiers that have a finite number of instances. This is the case, for example, for user-defined classes because instances need to be created explicitly. This is not the case, for example, for data types such as the standard String, Integer, and Real types. pre: self.oclIsKindOf(Classifier) -- self must be a Classifier and not self.oclIsKindOf(DataType) -- self must have a finite number of instances NOTE: The revision cannot be applied since superseded by issue 6532 which moves the definition 'allInstances' from 11.2.5 to 8.3.8. The new text of allInstances as defined by issue 6532 is in line with the intended clarification of this issue since it says: "returns all instances of the classifier and the classifiers specializing it" Actions taken: July 12, 2005: received issue October 16, 2009: closed issue Discussion: To obtain all instances of a class that are not instances of some specializing class, it is sufficient to be able to select them fron the allInstances set: t.allInstances()->select(oclIsTypeOf(t)). End of Annotations:===== ubject: allInstances Date: Tue, 12 Jul 2005 15:58:09 -0700 Thread-Topic: allInstances Thread-Index: AcWHNSP4spqvEdGhSwSVOuUM0cOBXQ== From: "Frankel, David" To: Cc: , "Uhl, Axel" X-OriginalArrivalTime: 12 Jul 2005 22:58:15.0632 (UTC) FILETIME=[2FE28D00:01C58735] X-SAP: out X-SAP: out Issue: It is not entirely clear from the OCL 2.0 specification whether the allInstances operation returns instances of subclasses of the designated type. In other words, it isn't 100% clear whether t.allInstances( ) returns instances of subclasses of t. Recommendation: The best solution would be to have two operations, one which returns instances of subclasses and one which does not. A second-best solution would be to make it clear that allInstances returns instances of subclasses. In this case, an OCL programmer could use the oclIsTypeOf( ) operation as a filter to write a derived operation that does not return instances of subclasses. If allInstances does not return instances of subclasses, it would not be nearly as straightforward to write a derived operation that does return instances of subclasses. From: Florian Schneider Subject: [Issue 8917] allInstances Date: Wed, 18 Jul 2012 10:18:47 +0200 Cc: Helmut Naughton To: ocl2-rtf@omg.org X-Mailer: Apple Mail (2.1278) X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q6I8IxKr004223 Issue: According to the OMG issue tracker, Issue 8917 is closed. In the issue's archive however, it is noted that the resolution cannot be applied. Both sections of the specification referred to in the issue's description do not exist anymore in version 2.3.1 of the OCL specification. Was the operation removed on purpose because it should not be used? A full text search on document formal/2012-01-01 (which is the 2.3.1 specification without changebars) still delivers results on the search term "allInstances". However the operation itself is only specified on the types InvalidType and BooleanType. Section 7.6.10 may lead to the conclusion that the operation should still be there for Classifier. The UML 2.4.1 Infrastructure (formal/2011-08-05) and Superstructure (formal/2011-08-06) specifications use allInstances in 1 respectively 3 occasions. Recommendation: As I am not exactly aware of what happened, I see the following possible actions that could resolve the issue (combinations possible): * Clarify description of allInstances in + Section 2 regarding compliance points + Section 7.6.10 by introducing a reference to where allInstances is specified * Reintroduce specification of allInstances in section 8, according to the text proposed in issue 8917 * If allInstances was removed, remove all textual occurrences of allInstances from the spec * If allInstances was deprecated, add an according note to section 8 * If allInstances was renamed, rename all textual occurrences of allInstances in the specification * If the specification of allInstances was moved elsewhere, add a reference to it in section 8 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=P9e4d18u c=1 sm=1 a=eW53zEZrsyElcQ0NK1QpqA==:17 a=0-VhLkpDQP4A:10 a=8nJEP1OIZ-IA:10 a=YYzpnO7rAAAA:8 a=KHpXyVWLAAAA:8 a=oCcaPWc0AAAA:8 a=M6SL45MlkEz3hclqAv0A:9 a=wPNLvfGTeEIA:10 a=eW53zEZrsyElcQ0NK1QpqA==:117 Date: Wed, 18 Jul 2012 15:00:27 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 To: Florian Schneider CC: ocl2-rtf@omg.org, Helmut Naughton Subject: Re: [Issue 8917] allInstances Hi allInstances() is discouraged but certainly not deprecated. You will find the definition that you are looking for in 8.3.8 as an additional operation on the UML class Classifier. allInstances has evolved a little; In OCL 1.x it was a property. OCL 2.x clarifications have endeavoured to explain the consequences of a class rather than object operation. In the forthcoming OCL Standard Library model, this irregularity is captured by defining it as a static operation. From The Eclipse OCL prototype: /** The type OclElement is the implicit supertype of any user-defined type that has no explicit supertypes. Operations defined for OclElement are therefore applicable to all user-defined types. **/ type OclElement conformsTo OclAny { annotation 'http://www.omg.org/ocl'(ClassGroup='OCL'); /** Return a set of all instances of the type and derived types of self. */ static operation allInstances() : Set(OclSelf) => 'org.eclipse.ocl.examples.library.classifier.ClassifierAllInstancesOperation'; /** Returns the object for which self is a composed content or null if there is no such object. */ operation oclContainer() : OclElement => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContainerOperation'; /** Returns the composed contents of self. */ operation oclContents() : Set(OclElement) => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContentsOperation'; } Regards Ed Willink On 18/07/2012 09:18, Florian Schneider wrote: Issue: According to the OMG issue tracker, Issue 8917 is closed. In the issue's archive however, it is noted that the resolution cannot be applied. Both sections of the specification referred to in the issue's description do not exist anymore in version 2.3.1 of the OCL specification. Was the operation removed on purpose because it should not be used? A full text search on document formal/2012-01-01 (which is the 2.3.1 specification without changebars) still delivers results on the search term "allInstances". However the operation itself is only specified on the types InvalidType and BooleanType. Section 7.6.10 may lead to the conclusion that the operation should still be there for Classifier. The UML 2.4.1 Infrastructure (formal/2011-08-05) and Superstructure (formal/2011-08-06) specifications use allInstances in 1 respectively 3 occasions. Recommendation: As I am not exactly aware of what happened, I see the following possible actions that could resolve the issue (combinations possible): * Clarify description of allInstances in + Section 2 regarding compliance points + Section 7.6.10 by introducing a reference to where allInstances is specified * Reintroduce specification of allInstances in section 8, according to the text proposed in issue 8917 * If allInstances was removed, remove all textual occurrences of allInstances from the spec * If allInstances was deprecated, add an according note to section 8 * If allInstances was renamed, rename all textual occurrences of allInstances in the specification * If the specification of allInstances was moved elsewhere, add a reference to it in section 8 ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2178 / Virus Database: 2437/5138 - Release Date: 07/17/12 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=P9e4d18u c=1 sm=1 a=eW53zEZrsyElcQ0NK1QpqA==:17 Subject: Re: [Issue 8917] allInstances From: Florian Schneider Date: Wed, 18 Jul 2012 16:09:50 +0200 Cc: ocl2-rtf@omg.org, Helmut Naughton To: Ed Willink X-Mailer: Apple Mail (2.1278) X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q6IE9v2r015006 Hello Mr. Willink, Thank you very much for the quick reply! While I can find the paragraph in version 2.2 released Feb 2010, the current version 2.3.1 seems to be missing this subsection. OMG Object Constraint Language (OCL) Version 2.3.1 without change bars OMG Document Number: formal/2012-01-01 Standard document URL: http://www.omg.org/spec/OCL/2.3.1 The above document has no section 8.3.8 . Chapter 8 only has sections 8.3.1 to 8.3.4 . Is version 2.3.1 missing some sections? Regards, Florian Schneider On 18.07.2012, at 16:00, Ed Willink wrote: > Hi > > allInstances() is discouraged but certainly not deprecated. > > You will find the definition that you are looking for in 8.3.8 as an additional operation on the UML class Classifier. > > allInstances has evolved a little; In OCL 1.x it was a property. OCL 2.x clarifications have endeavoured to explain the consequences of a class rather than object operation. In the forthcoming OCL Standard Library model, this irregularity is captured by defining it as a static operation. > > From The Eclipse OCL prototype: > > /** > The type OclElement is the implicit supertype of any user-defined type that has no explicit supertypes. Operations defined > for OclElement are therefore applicable to all user-defined types. > **/ > type OclElement conformsTo OclAny { > annotation 'http://www.omg.org/ocl'(ClassGroup='OCL'); > /** > Return a set of all instances of the type and derived types of self. > */ > static operation allInstances() : Set(OclSelf) => 'org.eclipse.ocl.examples.library.classifier.ClassifierAllInstancesOperation'; > /** > Returns the object for which self is a composed content or null if there is no such object. > */ > operation oclContainer() : OclElement => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContainerOperation'; > /** > Returns the composed contents of self. > */ > operation oclContents() : Set(OclElement) => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContentsOperation'; > } > > > Regards > > Ed Willink > > On 18/07/2012 09:18, Florian Schneider wrote: >> Issue: >> According to the OMG issue tracker, Issue 8917 is closed. In the issue's archive however, it is noted that the resolution cannot be applied. Both sections of the specification referred to in the issue's description do not exist anymore in version 2.3.1 of the OCL specification. >> >> Was the operation removed on purpose because it should not be used? A full text search on document formal/2012-01-01 (which is the 2.3.1 specification without changebars) still delivers results on the search term "allInstances". However the operation itself is only specified on the types InvalidType and BooleanType. Section 7.6.10 may lead to the conclusion that the operation should still be there for Classifier. The UML 2.4.1 Infrastructure (formal/2011-08-05) and Superstructure (formal/2011-08-06) specifications use allInstances in 1 respectively 3 occasions. >> >> Recommendation: >> >> As I am not exactly aware of what happened, I see the following possible actions that could resolve the issue (combinations possible): >> >> * Clarify description of allInstances in >> + Section 2 regarding compliance points >> + Section 7.6.10 by introducing a reference to where allInstances is specified >> >> * Reintroduce specification of allInstances in section 8, according to the text proposed in issue 8917 >> >> * If allInstances was removed, remove all textual occurrences of allInstances from the spec >> >> * If allInstances was deprecated, add an according note to section 8 >> >> * If allInstances was renamed, rename all textual occurrences of allInstances in the specification >> >> * If the specification of allInstances was moved elsewhere, add a reference to it in section 8 >> >> ----- >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 2012.0.2178 / Virus Database: 2437/5138 - Release Date: 07/17/12 >> >> >> > X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=P9e4d18u c=1 sm=1 a=eW53zEZrsyElcQ0NK1QpqA==:17 a=PGqWWfQJUIAA:10 a=8nJEP1OIZ-IA:10 a=YYzpnO7rAAAA:8 a=KHpXyVWLAAAA:8 a=oCcaPWc0AAAA:8 a=qjrcm7o7MBU0KFz4DR4A:9 a=wPNLvfGTeEIA:10 a=eW53zEZrsyElcQ0NK1QpqA==:117 Date: Wed, 18 Jul 2012 20:00:11 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20120713 Thunderbird/14.0 To: Florian Schneider CC: ocl2-rtf@omg.org, Helmut Naughton Subject: Re: [Issue 8917] allInstances Hi OCL 2.3.1 is a very minor textual update to resolve some issues raised by ISO/PAC. It should have no technical changes. It appears that a typo promoted 8.3.5 to 8.4 distoring numbering thereafter. 8.3.8 in OCL 2.3 is therefore 8.4.3 in OCL 2.3.1. Juergen: Please raise this message as an editorial issue against OCL 2.3.1. Juergen: Please raise my previous comment as an issue to memo-ize the need to clean up the allInstances() editorial descriptions/references. Regards Ed Willink On 18/07/2012 15:09, Florian Schneider wrote: Hello Mr. Willink, Thank you very much for the quick reply! While I can find the paragraph in version 2.2 released Feb 2010, the current version 2.3.1 seems to be missing this subsection. OMG Object Constraint Language (OCL) Version 2.3.1 without change bars OMG Document Number: formal/2012-01-01 Standard document URL: http://www.omg.org/spec/OCL/2.3.1 The above document has no section 8.3.8 . Chapter 8 only has sections 8.3.1 to 8.3.4 . Is version 2.3.1 missing some sections? Regards, Florian Schneider On 18.07.2012, at 16:00, Ed Willink wrote: Hi allInstances() is discouraged but certainly not deprecated. You will find the definition that you are looking for in 8.3.8 as an additional operation on the UML class Classifier. allInstances has evolved a little; In OCL 1.x it was a property. OCL 2.x clarifications have endeavoured to explain the consequences of a class rather than object operation. In the forthcoming OCL Standard Library model, this irregularity is captured by defining it as a static operation. From The Eclipse OCL prototype: /** The type OclElement is the implicit supertype of any user-defined type that has no explicit supertypes. Operations defined for OclElement are therefore applicable to all user-defined types. **/ type OclElement conformsTo OclAny { annotation 'http://www.omg.org/ocl'(ClassGroup='OCL'); /** Return a set of all instances of the type and derived types of self. */ static operation allInstances() : Set(OclSelf) => 'org.eclipse.ocl.examples.library.classifier.ClassifierAllInstancesOperation'; /** Returns the object for which self is a composed content or null if there is no such object. */ operation oclContainer() : OclElement => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContainerOperation'; /** Returns the composed contents of self. */ operation oclContents() : Set(OclElement) => 'org.eclipse.ocl.examples.library.classifier.ClassifierOclContentsOperation'; } Regards Ed Willink On 18/07/2012 09:18, Florian Schneider wrote: Issue: According to the OMG issue tracker, Issue 8917 is closed. In the issue's archive however, it is noted that the resolution cannot be applied. Both sections of the specification referred to in the issue's description do not exist anymore in version 2.3.1 of the OCL specification. Was the operation removed on purpose because it should not be used? A full text search on document formal/2012-01-01 (which is the 2.3.1 specification without changebars) still delivers results on the search term "allInstances". However the operation itself is only specified on the types InvalidType and BooleanType. Section 7.6.10 may lead to the conclusion that the operation should still be there for Classifier. The UML 2.4.1 Infrastructure (formal/2011-08-05) and Superstructure (formal/2011-08-06) specifications use allInstances in 1 respectively 3 occasions. Recommendation: As I am not exactly aware of what happened, I see the following possible actions that could resolve the issue (combinations possible): * Clarify description of allInstances in + Section 2 regarding compliance points + Section 7.6.10 by introducing a reference to where allInstances is specified * Reintroduce specification of allInstances in section 8, according to the text proposed in issue 8917 * If allInstances was removed, remove all textual occurrences of allInstances from the spec * If allInstances was deprecated, add an according note to section 8 * If allInstances was renamed, rename all textual occurrences of allInstances in the specification * If the specification of allInstances was moved elsewhere, add a reference to it in section 8 ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2178 / Virus Database: 2437/5138 - Release Date: 07/17/12 ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2178 / Virus Database: 2437/5138 - Release Date: 07/17/12