Re: elements vs sets



Date view Thread view Subject view Author view

Daniel Jackson (dnj@lcs.mit.edu)
Mon, 6 Mar 2000 12:43:01 -0800


i've come rather late to this (now defunct?) discussion on singleton sets. i just wanted to point out that in our language, Alloy, we treat scalars as singleton sets, and it's turned out to be a big win. our users have found it easy to grasp; it has a very simple semantics; it sidesteps the partial function problem; it makes navigation expressions uniform; and it helped in our tool implementation. it also works nicely in diagrams: we use multiplicity symbols to distinguish sets, scalars and 'options'. more details at: http://sdg.lcs.mit.edu/alcoa . /daniel ----- Original Message ----- From: Jos Warmer <J.Warmer@klasse.nl> To: <Perdita.Stevens@dcs.ed.ac.uk> Cc: <puml-list@cs.york.ac.uk> Sent: Friday, February 25, 2000 4:50 AM Subject: Re: elements vs sets > Hello Perdita, > > At 11:05 AM 25-02-00 +0000, Perdita Stevens wrote: > >Well, you could use mySet -> asSequence -> first; but I agree that OCL is > >fundamentally broken in this respect. > > > The inclusion of a feature 'giveOneElement' for a Set (or Bag) in OCL has been > discussed in the past. We have decided not to include this, because such a > feature has undeterministic behavior. You request a random element from > the set (Bag) and you cannot determine which element you get. > Such undeterministic behavior was unwanted on OCL. Therefore it was not > included. > You can always use the 'forAll' operation instead of this. > > As explained in my answer to Leonor, the fact that a collection might actually > have one element in certain circumstances is not relevant. OCL tools cannot > rely on this when checking the well formedness of an OCL expression. > > >Anyone know whether there are any plans to fix it? What is happening in the > >RTF on OCL? > > > I know what is happening in the RTF on OCL. We (mostly myself) are working on > the resolution of a number of issues that have been send to the > "issues@omg.org" > address. The main points that have been sent in came from people who have > written OCL tools and found some problems in their work. > In principle, everything send to the issues list will be handled. You can > also > send issues to me, and request me to put them on the list. > > >Perdita > > Regards, Jos > > _____________________________________________________ > Klasse Objecten tel : +31 (0)35 6037646 > Chalonhof 153 fax : +31 (0)35 6037647 > 3762 CT Soest email : J.Warmer@klasse.nl > The Netherlands internet: http://www.klasse.nl > > > > To remove yourself from this list please mail puml-list-request@cs.york.ac.uk > with a message containing the word "unsubscribe". >


Date view Thread view Subject view Author view