FW: Invariants evaluating to undefined



FW: Invariants evaluating to undefined

From: D H. Akehurst ^lt;D.H.Akehurst@kent.ac.uk>
Date: Mon 03 Apr 2006 - 15:32:09 BST
Message-ID: <A97ADB9E8A23214492A613C7EC1CAF7B548016@dogsbody.ee.kent.ac.uk>
Having had a little time to look at the v2.0 of OCL2.0 I have some
questions regarding the new 'null' and OclInvalid values wrt the old
OclUndefined value and the discussion a few weeks ago under this thread.
 
consider a model containing class Person, with andassociation to itself
with end named 'wife' and an attribute 'name'.
 
if a person is not married are the following correct?
 
context Person
 
self.wife = null
self.wife.name = OclInvalid
Set{ null }->size() = Set{self.wife}->size() = 1
Set{ OclInvalid }->size() = Set{self.wife.name}->size() = 0
 
they seem to make sense, I'm not sure about the following
 
self.wife->isEmpty() = 1  -- ?? this is consistent with the above, but
not with old versions of OCL!
 
Have I missed something?
Received on Mon Apr 03 15:32:51 2006