Issue 19020: How does Set distinguish duplicate values? (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Clarification Severity: Minor Summary: In 11.6.2: "It [Set] contains elements without duplicates." What is a duplicate? In 10.2.2.13 SetTypeValue "All elements belonging to a set value have unique values. self.element->isUnique(e : Element | e.value)" >From 11.9.1.3 isUnique, the basis of comparison is <>: forAll (x, y | (x.iter <> y.iter) implies (x.value <> y.value)) But what is the Element::value to which "<>" is applied. It is far from clear that the semantics of the Element in Section 10 which is completely unrelated to MOF::Element leads to the obvious answer. Suggest adding the obvious WFR. context Set inv: forAll(x | self->count(x) = 1) (count is already defined using "=") [And chnage 11.9.1.3 isUnique to use this much more readable formulation.] Resolution: Revised Text: Actions taken: October 23, 2013: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 23 Oct 2013 06:19:41 -0400 To: Subject: Issue/Bug Report ******************************************************************************* Name: Edward Willink Employer: mailFrom: ed@willink.me.uk Terms_Agreement: I agree Specification: OCL Section: 11.6.2 FormalNumber: 12-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: 01 Page: 156 Title: How does Set distinguish duplicate values? Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Remote Name: edwillink.plus.com Remote User: HTTP User Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Firefox/24.0 Time: 06:19 AM Description: In 11.6.2: "It [Set] contains elements without duplicates." What is a duplicate? In 10.2.2.13 SetTypeValue "All elements belonging to a set value have unique values. self.element->isUnique(e : Element | e.value)" >From 11.9.1.3 isUnique, the basis of comparison is <>: forAll (x, y | (x.iter <> y.iter) implies (x.value <> y.value)) But what is the Element::value to which "<>" is applied. It is far from clear that the semantics of the Element in Section 10 which is completely unrelated to MOF::Element leads to the obvious answer. Suggest adding the obvious WFR. context Set inv: forAll(x | self->count(x) = 1) (count is already defined using "=") [And chnage 11.9.1.3 isUnique to use this much more readable formulation.]