Are the following two OCL statements equivalent for some function context?
post: if a > 0 then b < c
post: b < c implies a > 0
Are the following two OCL statements equivalent for some function context?
post: if a > 0 then b < c
post: b < c implies a > 0
No.
In OCL, the construct is
if...then...else...endifso your first example can only be 'equivalent' to a different syntax error.The logical operations are rewritable using
ifconstructs, but considerable care is necessary to ensure that the possibilities with null or invalid inputs do not crash theifcondition term which must be a 2-valuedBoolean.