OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.1 11.7 Inflexible Collection operation signatures

  • Key: OCL25-98
  • Legacy Issue Number: 14577
  • Status: open  
  • Source: Model Driven Solutions ( Dr. Edward Willink)
  • Summary:

    The Collection(T)::product(c2 : Collection(T2))

    signature carefully uses T2 to distinguish self and argument element types.

    The same distinction is missing from

    Collection(T)::"="(c : Collection(T))
    Collection(T)::"<>"(c : Collection(T))
    Collection(T)::includesAll(c : Collection(T))
    Collection(T)::excludesAll(c : Collection(T))
    Set(T)::union(s : Set(T))
    Set(T)::union(b : Bag(T))

    etc etc

    The current definition makes at least one of

    Set

    {1.0}>excluding(1.0) = Set{1}->excluding(1)
    Set{1}
    >excluding(1) = Set{1.0}

    ->excluding(1.0)

    invalid through lack of a suitable collection operation.

    For some operations, such as union, a T2 conforms to T well-formedness constraint is appropriate,
    but for others, such as removeAll, T2 and T can be independent.

  • Reported: OCL 2.1 — Mon, 26 Oct 2009 04:00 GMT
  • Updated: Thu, 8 Oct 2015 14:12 GMT