Re: product types in OCL 2.0



Date view Thread view Subject view Author view Attachment view

From: Gerrit Renker (gerrit_renker@yahoo.co.uk)
Date: Mon 24 Feb 2003 - 07:38:08 GMT


Hi,
Sorry, the introduction of the Cartesian Product operator has escaped
me, my printed copy is still V1.5. I picked up a copy of the Version
1.6 OCL 2.0 at
http://cgi.omg.org/cgi-bin/doc?ad/2003-01-07 (hope that this is the
current one).

I can see a problem with this construct, it is ambiguous how
k-fold products for k>2 are defined.

For example
a->product(b) : Set(Tuple{A,B})

is clear, but what about a->product(b)->product(c) ?
It might be read (1) as the Cartesian Product of three sets,
in which case the type might be:
a->product(b)->product(c) : Set(Tuple{A,B,C})

But the same expression can also be interpreted as (2) the product of a
binary Cartesian Product (AxB) with a set of class C elements:
a->product(b)->product(c) : Set( Tuple{Tuple{A,B},C} )

If as an example the 'x' operator from maths is used:
--the first case can be written  as  A x B x C
--the second case can be written as (A xB) x C
which is less ambiguous.

Possibly such preference rules could be incorporated into the
definition?

With kind regards
Gerrit
 --- Jos Warmer <J.Warmer@klasse.nl> wrote: > Hi there,
> 
> In section 6.5.1, page 6-10, the operation 'product()' is defined on
> Collection, resulting the carthesian product.
> You can write:
> 
>                                      
> collection->product(otherCollection)
> 

=====
--
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

Date view Thread view Subject view Author view Attachment view