Re: product types in OCL 2.0



Date view Thread view Subject view Author view Attachment view

From: Steffen Zschaler (sz9@inf.tu-dresden.de)
Date: Thu 20 Feb 2003 - 22:02:50 GMT


Hallo,

What do you think about the following approach (which was actually 
discussed in the OCL2.0 group):

Allow allInstances for TupleTypes, defining it as the Cartesian product 
of the member types (provided they allow for the use of allInstances, 
because we want OCL terms to be evaluatable). I.e.:

Tuple(a: ClassA; b: EnumB).allInstances() =
  a.allInstances()->iterate (ai:ClassA; acc: Set(Tuple(a: ClassA; b: EnumB)) = Set{} |
      acc->union (
          b.allInstances()->iterate (bi:EnumB; acc: Set(Tuple(a: ClassA; b: EnumB)) = Set{} |
              acc->union (Tuple{a = ai, b = bi})
            )
        )
    )

Regards,

Steffen


Gerrit Renker schrieb:

>Dear Herman,
>
>there is no Cartesian Product type in OCL. All there is is the Tuple
>type. That means, in effect  modelling cartesian Products remains a
>complex endeavour (see my mail earlier on this list).
>As a consequence, mathematical relations (subsets of Cartesian
>Products) remain hard to model, too.
>
>Were you suggesting the use of a dedicated Cartesian Product type -- I
>was thinking along these lines, too.
>
>I think it is a deficiency that such simple constructs like a relation
>(not relationship) remain complex to model.
>
>Best regards
>Gerrit
>
>
> --- Herman Balsters <h.balsters@bdk.rug.nl> wrote: > Could anyone tell
>me whether there is a product type (pure Cartesian 
>  
>
>>product, hence not a tupletype) available in OCL 2.0?
>>
>>Regards,
>>
>>Herman Balstersdr. H. Balsters
>>Faculty of Business Science
>>University of Groningen
>>The Netherlands
>>
>>
>>
>>
>>To remove yourself from this list please mail
>>puml-list-request@cs.york.ac.uk
>>with a message containing the word "unsubscribe".
>>
>>    
>>
>
>=====
>--
>Gerrit Renker                     Research Assistant
>Constraints Group                 Computing Technologies Centre
>The Robert Gordon University      Aberdeen AB25 1HG
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>
>
>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 Attachment view