Nested OCL forAlls [message #1703513] |
Sat, 01 August 2015 20:31  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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?
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.25450 seconds