Issue 12943: OCL 2.0: CollectionType constraint for invalid elements is incorrect (ocl2-rtf) Source: Zeligsoft, Inc. (Mr. Christian W. Damus, nobody) Nature: Uncategorized Issue Severity: Summary: The second constraint on CollectionType in Section 8.2.2 does not make sense. The instances of CollectionType are not collections, but the types of collections. Thus, a collection type does not have elements to be iterated. This constraint should be struck from Section 8.2.2: [1] A collection cannot contain OclInvalid values. context CollectionType inv: self->forAll(not oclIsInvalid()) and replaced by a new invariant constraint in Section 11.7.1 “Collection” (which currently has no well-formedness rules): [1] A collection cannot contain OclInvalid values. context Collection inv: self->forAll(not oclIsInvalid()) Resolution: As OCL does not permit the invalid value in a collection (as opposed to the null value), it should be made explicit that the evaluation of collection literals containing invalid results in invalid. The CollectionType constraint in Section 8.2.2 attempts to express this, but is incorrect because it is defined on the wrong meta-level (on CollectionType instead of Collection). Revised Text: Strike the second constraint on CollectionType in Section 8.2.2 “Well-formedness Rules for the Types Package” [1] A collection cannot contain OclInvalid values. context CollectionType inv: self->forAll(not oclIsInvalid()) Add an invariant constraint to Section 11.7.1 “Collection” [1] A collection cannot contain OclInvalid values. context Collection inv: self->forAll(not oclIsInvalid()) Actions taken: October 9, 2008: received issue October 16, 2009: closed issue Discussion: End of Annotations:===== m: "Christian W. Damus" To: issues@omg.org Subject: OCL 2.0: CollectionType constraint for invalid elements is incorrect Date: Thu, 9 Oct 2008 12:49:27 -0400 X-Mailer: Apple Mail (2.929.2) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s014.panelboxmanager.com X-AntiAbuse: Original Domain - omg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - zeligsoft.com X-Source: X-Source-Args: X-Source-Dir: X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id m99Gq5Qn008082 re: OCL 2.0 formal/06-05-01 Section 8.2.2 .Well-formedness Rules for the Types Package. The second constraint on CollectionType in Section 8.2.2 does not make sense. The instances of CollectionType are not collections, but the types of collections. Thus, a collection type does not have elements to be iterated. This constraint should be struck from Section 8.2.2: [1] A collection cannot contain OclInvalid values. context CollectionType inv: self->forAll(not oclIsInvalid()) and replaced by a new invariant constraint in Section 11.7.1 .Collection. (which currently has no well-formedness rules): [1] A collection cannot contain OclInvalid values. context Collection inv: self->forAll(not oclIsInvalid()) Thanks, Christian -- Christian W. Damus Senior Software Developer, Zeligsoft Inc. Component Lead, Eclipse MDT OCL and EMF-QTV E-mail: cdamus@zeligsoft.com