Re: equality

Date view Thread view Subject view Author view Attachment view

From: Thomas Baar (
Date: Tue 25 Nov 2003 - 09:01:16 GMT

Dear Tim,

your are right, the choice to evaluate \bottom = \bottom to \bottom is 
(in my opinion) wrong.
It should be evaluated to true as well since = in the semantic domain is 
supposed to mean  identity.

However, there are reasons why the semantics of = in respect to \bottom 
was stipulated
in that way. In the first versions of OCL there was the idea of strict 
evaluation of OCL terms, i.e.
whenever a subterm is evaluated to \bottom the whole expressions has to 
be evaluated to
\bottom. It was soon realized, that such a general rule can restrict the 
expressive power
of OCL dramatically. Thus, some exceptions from that rule, e.g. 
evaluation of and-, forAll-expressions
and the undefined-predicate, were allowed.

However, you can still find at several places in the OCL standard the 
heritage of the strict-evaluation rule as
in the definition of = . In my opinion, that strict-evaluation is rather 
a bad idea (at least as it is
realized in the current proposal). I personally submitted a bunch of 
issues to the finalization task
force for OCL2.0 to get rid of the negative impact of the strict-evaluation.
Note, for instance, that based on  the current semantics of = you cannot 
an OCL expression of form 'x = x' to 'true' unless you have checked that 
x is evaluated different
from \bottom.

I would appreciate if we could handle expressions of form 'x=x' as 
tautologies in OCL
as well.

Best regards,

Thomas Baar

Tim Klinger wrote:

> Thomas,
> Thanks _very_ much for your detailed response.  I went and read the 
> formal semantics chapter which is considerably more expansive on this 
> topic than the informal semantics, and now understand the intent 
> here.  One question though.  Looking at the definition of I(=_t) on p. 
> A-12, it seems that \bottom = \bottom evaluates to \bottom.  I 
> would've thought it should evaluate to true.  Is \bottom really the 
> intended evaluation?
> Thanks,
> Tim

Date view Thread view Subject view Author view Attachment view