Re: transitive closure concept



Date view Thread view Subject view Author view Attachment view

From: Thomas Baar (baar@ira.uka.de)
Date: Thu 22 Jan 2004 - 10:35:10 GMT


SainTiss wrote:

>Is there some kind of "transitive closure" concept in OCL?
>
>For example, suppose one would like to specify as a metamodel constraint that 
>a UML class should be "connected" to every other class by means of one or 
>more associations. So if A->B then A is connected to B, and if A->B->C then A 
>is also (indirectly) connected to C. 
>
>Is there a way to do this sort of thing in OCL, or is it just impossible to 
>specify these sorts of constraints?
>  
>

Sometimes, you don't need Dan Chiorean's TC-operator. This is the case when
the closure-relation does not have cycles. Then you can use a technique of
recursive definition as it is done in the UML metamodel to define the 
set allparents of all
direct and indirect superclasses.

I discussed this example also in one of my papers:

@InProceedings{Baar03a,
 author =       {Thomas Baar},
 title =        {The Definition of Transitive Closure with OCL
-- Limitations and Applications --},
 booktitle =    {Proceedings, Fifth Andrei Ershov International
                 Conference, Perspectives of System Informatics,
                 Novosibirsk, Russia},
 month =        jul,
 pages =        {358--365},
 publisher =    {Springer},
 series =       {LNCS},
 volume =       {2890},
 year =         {2003}
}


http://i12www.ira.uka.de/~baar/publications/2003/baar03a.ps




Best regards,

Thomas Baar

Date view Thread view Subject view Author view Attachment view