Skip to main content



      Home
Home » Modeling » OCL » Nested OCL forAlls
Nested OCL forAlls [message #1703513] Sat, 01 August 2015 20:31 Go to next message
Eclipse UserFriend
I have the following Formula in First Order Logic.

    foAll a:A | forAll b :B | if a.r1=b then a.r2=b


simply, for all objects of type A, and for all objects of type B, if they are related by r1 then they are related by r2 as well. r1 and r2 are two association from A to B.

How this is written in OCL?


Re: Nested OCL forAlls [message #1703518 is a reply to message #1703513] Sun, 02 August 2015 05:13 Go to previous message
Eclipse UserFriend
Hi

A.allInstances()->forAll(a | B.allInstances()->forAll(b | a.r1=b implies
a.r2=b))

---

OCL 2.5 may accept that allInstances() is an unavoidably useful evil and
so allow

forAll(a : A, b : B| a.r1=b implies a.r2=b)

Regards

Ed Willink


On 02/08/2015 01:31, Hamid Qartal wrote:
> I have the following Formula in First Order Logic.
>
> foAll a:A | forAll b :B | if a.r1=b then a.r2=b
>
>
> simply, for all objects of type A, and for all objects of type B, if
> they are related by r1 then they are related by r2 as well. r1 and r2
> are two association from A to B.
>
> How this is written in OCL?
>
>
>
Previous Topic:What specification to use
Next Topic:How to query UML models with OCL?
Goto Forum:
  


Current Time: Tue Jul 08 23:18:21 EDT 2025

Powered by FUDForum. Page generated in 0.25450 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top