|Re: undefined on expressions [message #514377 is a reply to message #514362]
||Mon, 15 February 2010 06:32
| Ed Willink
Registered: July 2009
The OCL 2.0 specification is not entirely clear. The inconsistent "OclInvalid" and "invalid" usage is resolved in OCL 2.3 so that
"invalid" is the instance of the "OclInvalid" type in the same way that "null" is the instance of the "OclVoid" type, with the
'undefined' value clearly partitioned as invalid or null.
We have been a bit embarrassed by the number of corner case evaluation issues in MDT/OCL 1.3.0 and the lack of model-driven
extensibility. Resolution of this has been prototyped in a ReflectiveLibrary branch in CVS, but we are too close to the API freeeze
that comes with M6 in late March to incorporate such changes for MDT/OCL 3.0.0. Expect them almost immediately for MDT/OCL 4.0.0.
That said, your evaluations are as expected for OCL 2.1 (renamed as 2.2), where OclAny::= is overloaded by OclVoid and OclInvalid to
define true/false returns. The OCL 2.3 specification should be less ambiguous. '=' is another special situation.
Provision of a detailed compliance list is one of the TODOs for the new ReflectiveLibrary which should allow you to choose between a
variety of alternate 'standard' libraries or to configure your own semantics.
On 15/02/2010 01:47, Alexandre Torres wrote:
> Hi, it has been some time since I last used MDT-OCL, so forgive me if I
> miss something ;)
> Reading the OCL specification I got the feeling that the evaluation of
> expressions with undefined value (OclUndefined) should evaluate to
> OclUndefined, except in some special situations:
> • True OR-ed with anything is True
> • False AND-ed with anything is False
> • False IMPLIES anything is True
> • anything IMPLIES True is True
> I'm issuing some evaluations on the interactive console OCL (that I
> suppose that is still implemented over MDT-OCL, as an example) and what
> is happening is a bit odd: expressions of equality btw undefined and
> another value are evaluated as plain false values:
> <false> (ok)
> <false> (should be undefined ?)
> <true> (should be undefined ?)
> <false> (should be undefined)
> I'd like to know if this is a configurable output, a specific behaviour
> or my bad interpretation of OCL specs.
> Is there a list differences btw OCL specs and the MDT-OCL implementation ?
> Thanks in advance.
> My OCL version is a bit old (v1.3 of 2.0 implementation)
Powered by FUDForum
. Page generated in 0.10790 seconds