OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.2 OclMessage types are not statically derivable

  • Key: OCL25-124
  • Legacy Issue Number: 15258
  • Status: open  
  • Source: Model Driven Solutions ( Ed Willink)
  • Summary:

    The intro to Section 8.2 states:

    "OCL is a typed language. Each expression has a type that is either
    explicitly declared or can be statically derived."

    However OclMessage lacks type parameterisation and so the 7.7.2 example

    context Subject::hasChanged()
    post: let messages : Sequence(OclMessage) = observer^^update(? : Integer, ?
    : Integer) in
    messages->notEmpty() and
    messages->exists( m | m.i > 0 and m.j >= m.i )

    only works if the type analysis proceeds beyond "messages :
    Sequence(OclMessage)" to
    discover the initialiser with formal signature "Observer::update(i :
    Integer, j : Integer)".

    This will not in general be possible and so expressions such as "m.i > 0"
    cannot be
    statically checked, and cannot be dynamically expressed. Indeed since m is
    an OclMessage,
    "m.i" is not well-formed.

    Suggest that OclMessage is redefined as:

    OclMessage<OclOperation> or OclMessage<OclSignal>

    requiring the type to be determinate or discovered by oclAsType.

  • Reported: OCL 2.1 — Tue, 18 May 2010 04:00 GMT
  • Updated: Thu, 8 Oct 2015 14:12 GMT