Issue 18515: Collection::min/max accumulator initialized as self.first() (ocl2-rtf) Source: (, ) Nature: Revision Severity: Minor Summary: The accumulator in the definition of Collection::min and Collection::max is initialized as self.first(). post: result = self->iterate( elem; acc : T = self.first() | acc.min(elem) ) post: result = self->iterate( elem; acc : T = self.first() | acc.max(elem) ) The accumulator should be initialized as self.asSequence()->first(), because Collection::first() is undefined. Resolution: Nearly right. self is of course a Collection, so needs to be self->asSequence()->first(), or just self->any(true). Revised Text: In 11.7.1 max replace post: result = self->iterate( elem; acc : T = self.first() | acc.max(elem) ) by post: result = self->iterate( elem; acc : T = self->any(true) | acc.max(elem) ) In 11.7.1 min replace post: result = self->iterate( elem; acc : T = self.first() | acc.min(elem) ) by post: result = self->iterate( elem; acc : T = self->any(true) | acc.min(elem) ) Actions taken: March 1, 2013: received issue December 23, 2013: closed issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 28 Feb 2013 13:44:52 -0500 To: Subject: Issue/Bug Report ******************************************************************************* Name: Roberto Javier Godoy Employer: Universidad Nacional del Litoral mailFrom: rjgodoy@fich.unl.edu.ar Terms_Agreement: I agree Specification: OCL Section: 11.7.1 FormalNumber: formal/2012-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: 01 Page: 158 Title: Collection::min/max accumulator initialized as self.first() Nature: Revision Severity: Minor CODE: 3TMw8 B1: Report Issue Description: The accumulator in the definition of Collection::min and Collection::max is initialized as self.first(). post: result = self->iterate( elem; acc : T = self.first() | acc.min(elem) ) post: result = self->iterate( elem; acc : T = self.first() | acc.max(elem) ) The accumulator should be initialized as self.asSequence()->first(), because Collection::first() is undefined. X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=Df3JXIRW c=1 sm=1 a=eW53zEZrsyElcQ0NK1QpqA==:17 a=kQ3PTw-HgDwA:10 a=ih1MHRcCHdMA:10 a=IkcTkHD0fZMA:10 a=YYzpnO7rAAAA:8 a=6gIXP91biRgA:10 a=KHpXyVWLAAAA:8 a=oCcaPWc0AAAA:8 a=VpFa3nmEX1B6OgyVaosA:9 a=QEXdDO2ut3YA:10 a=_W_S_7VecoQA:10 a=-zspGdomsggA:10 a=gFGq0ozTCKgA:10 a=c9tJgGcuwpQA:10 a=WP4_USCxRkkA:10 a=8pP75x4bmd5e9iMw:21 a=eW53zEZrsyElcQ0NK1QpqA==:117 Date: Fri, 01 Mar 2013 16:47:06 +0000 From: Ed Willink User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 To: Juergen Boldt CC: ocl2-rtf@omg.org, rjgodoy@fich.unl.edu.ar Subject: Re: issue 18515 -- OCL 2 RTF issue X-Virus-Scanned: amavisd-new at omg.org X-Brightmail-Tracker: AAAAAR0YqvE= X-Brightmail-Tracker: AAAAAA== Hi Roberto Nearly right. self is of course a Collection, so needs to be self->asSequence()->first, or just self->any(true).  Regards   Ed Willink On 01/03/2013 16:18, Juergen Boldt wrote: From: webmaster@omg.org Date: 28 Feb 2013 13:44:52 -0500 To: Subject: Issue/Bug Report ******************************************************************************* Name: Roberto Javier Godoy Employer: Universidad Nacional del Litoral mailFrom: rjgodoy@fich.unl.edu.ar Terms_Agreement: I agree Specification: OCL Section: 11.7.1 FormalNumber: formal/2012-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: 01 Page: 158 Title: Collection::min/max accumulator initialized as self.first() Nature: Revision Severity: Minor CODE: 3TMw8 B1: Report Issue Description: The accumulator in the definition of Collection::min and Collection::max is initialized as self.first(). post: result = self->iterate( elem; acc : T = self.first() | acc.min(elem) ) post: result = self->iterate( elem; acc : T = self.first() | acc.max(elem) ) The accumulator should be initialized as self.asSequence()->first(), because Collection::first() is undefined. Juergen Boldt Director, Member Services 109 Highland Ave Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org  No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.2899 / Virus Database: 2641/6138 - Release Date: 02/28/13