UML 2.2 RTF Avatar
  1. OMG Issue

UML22 — Section: 9.19.1

  • Key: UML22-261
  • Legacy Issue Number: 10006
  • Status: closed  
  • Source: ISP ( Leonid Dvoryansky)
  • Summary:

    Wrong definition of hasVisibilityOf() Classifier::hasVisibilityOf(n: NamedElement) : Boolean; pre: self.allParents()>collect(c | c.member)>includes ... if (self.inheritedMember->includes ) then hasVisibilityOf = (n.visibility <> #private) else hasVisibilityOf = true ... should be: if (not self.inheritedMember->includes ) then hasVisibilityOf = (n.visibility <> #private) else hasVisibilityOf = true

  • Reported: UML 2.0 — Fri, 28 Jul 2006 04:00 GMT
  • Disposition: Resolved — UML 2.2
  • Disposition Summary:

    There is more wrong than suggested in the issue. If you work through the logic of hasVisbilityOf, you end up with a tautology as demonstrated by Ed with the following argument:
    To determine if a.hasVisibilityOf is true, assuming n is private, we need to be able to deduce that (including the proposed change)
    if (not a.inheritedMember->includes) then false else true
    is true, under the constraint that
    a.inheritedMember->includesAll(a.inherit(a.parents()->collect(p | p.inheritableMembers(a)))
    where
    p.inheritableMembers(a) = p.member->select(m | a.hasVisibilityOf(m))
    Clearly, given the above constraint, not a.inheritedMember->includes is true if
    not (a.inherit(a.parents()>collect(p | p.member>select(m | a.hasVisibilityOf(m)))->includes)
    This, in turn, is equivalent to
    not (a.parents().member->includes and a.hasVisibilityOf and a.inherit)
    The conclusion so far is, therefore, that a.hasVisibilityOf is true if the above expression is false, that is, if
    a.parents().member->includes and a.hasVisibilityOf and a.inherit implies a.hasVisibilityOf
    Now, if either a.parents().member->includes or a.inherit are false, then the antecedent in the above implication is false, which means that a.hasVisibilityOf must be false. On the other hand, if both a.parents().member->includes and a.inherit are true, then the implication reduces to the tautology
    a.hasVisibilityOf implies a.hasVisibilityOf
    which is true whether or not a.hasVisibilityOf is true.
    However, it is not apparent why if (not a.inheritedMember->includes) is needed at all. If we simply define hasVisibilityOf as n.visibility <> private, i.e. members are visible in a child if they are not private, we remove the tautology and simplify the logic.

  • Updated: Fri, 6 Mar 2015 20:58 GMT