QVT 1.0 NO IDEA Avatar
  1. OMG Issue

QVT — The QVT Operational StdLib has various mispellings and copy-paste errors

  • Key: QVT-13
  • Legacy Issue Number: 10927
  • Status: closed  
  • Source: France Telecom R&D ( Mariano Belaunde)
  • Summary:

    The QVT Operational StdLib has various mispellings and copy-paste errors and lacks
    sometimes of precision. Here's a list of encountered problems:

    • List<Element> => List(Element)
    • MarkedAs has a string parameter
    • Missing a 'stereotypedKindOf'
    • Return type of Model::objects() should be a Sequence
    • Return type of Dictionary::size should be 'Integer'
    • Copy-paste error in values(), keys() and isEmpty() Dictionary
      operations: unexpected 'size' in signature
    • In List, "all aperations in OCL..." should be replaced by something
      more precise, like
      "all operations of the OCL Collection type are available"
    • List::insertAt : int => Integer. Should indicate the starting position for the index.
    • String::format Should indicate whether the type is a tuple or a dictionary,
      may be by splitting the operation in two operations.
    • Indentation problem starting from String::substringAfter
    • String::equals should better be named 'match' is different than the MOF Object::equals
    • Integer::range, the type of start and end parameters is missing
    • An M1 type named 'Property' is missing to comply with MOF reflexive API
    • The result type of Status::raisedException should be a M1 class named
      'Exception' (base type of all exceptions.
    • Methods imported from MOF::reflect should be repeated in the spec for clarity
      - Alphanumeric names for pre-defined OCL operations like '+', '-' … were missing.
    • The return type of objectsOfType should depend on the argument (like oclAsType).
  • Reported: QVT 1.0b1 — Tue, 17 Apr 2007 04:00 GMT
  • Disposition: Resolved — QVT 1.0
  • Disposition Summary:

    Resolution:

    (1) In Section 8.3 Replace all occurrences of List<Element> by List(Element)
    (2) Change the signature of markedAs: Element::markedAs(String value) : Boolean
    (3) After the operation "stereotypedBy", add the operation "stereotypedStrictlyBy" with the following definition: Element::stereotypedStrictlyBy(String) : Boolean : Same than stereotypedBy except that base stereotype are not taken into account.
    (4) Change the signature of Dictionary::size as: Dictionary(KeyT,T)::size() : Integer
    (5) Change the signature of Dictionary::values, Dictionary::keys and Dictionary:isEmpty as follows:
    Dictionary(KeyT,T)::values() : List(T)
    Dictionary(KeyT,T)::Keys() : List(KeyT)
    Dictionary(KeyT,T)::isEmpty() : Boolean,
    (6) Replace "all operations in OCL are available" by " all operations of the OCL Collection type are available"
    (7) In insertAt description, add the following sentence: "The index starts at zero (in compliance with OCL convention)"
    (8) Rename String::equals by String::match with the following signature and description.
    String::match (String matchpattern) : Boolean
    Returns true if the value of the String matches the regular expression, else return false. The syntax of regular expression is the syntax or regular expression in Java language.
    (9) Change the signature of the range operation as follows:
    Integer::range (start: Integer,end: Integer) : List(Element)
    (10) In Section 8.3.1 Predefined types, add the definition of a 'Exception' type with the following definition: This M1 class named Exception represents the base class for exceptions. The M1 Exception type is an instance of the Class metatype.
    (11) In Section 8.3.3, replace " All MOF reflective operations applying on Objects " by The reflective operations inherited from MOF that are available in QVT specification are:
    (12) In Section 8.3.2 Synonym types and synonym operations, insert the following paragraph at the end: The following synonyms are defined for the following pre-defined OCL operations:
    String : operator+ -> concat
    Integer: operator+ -> plus,
    operator- (binary) -> minus,
    operator- (unary) -> unaryminus
    operator* -> multiply
    operator/ -> divide
    Real: operator+ -> plus,
    operator- (binary) -> minus,
    operator- (unary) -> unaryminus
    operator* -> multiply
    operator/ -> divide

    (13) In the description of objectsOfType, add the following sentence:
    " The returned Element type is the type denoted by the type expression." And correct the signature as follow:
    Model::objectsOfType(OclType) : Set(Element)
    (14) Within section 8.3.8 Operation list, add the following operations:
    Set(T)::asList() : List(T)
    OrderedSet(T)::asList() : List(T)
    Sequence(T)::asList() : List(T)
    Bag(T)::asList() : List(T)

    Converts a collection into the equivalent mutable list.
    (15) In the signature of the following operations replace the result type by Set(Element): subobjects, allSubobjects, subobjectsOfType, allSubobjectsOfType, allsubobjectsOfKind. (Remark: this is in line with the result type of Model::objects()). Also in this signature replace 'TypeType' by 'OclType' (which is the M1 type).

    NOTE: Typo fixes after AB review
    In addition the following fixes need to be done in section 8.3.9 Operations on strings: the syntax for parameters should be: <paramname> : <type> instead of <type> <paramname> as found in: 'replace', 'equals', 'equalsIgnoreCase', 'find', 'rfind', 'startStrCounter', 'getStrCounter', 'incStrCounter'. Also 'void' type should be spelled 'Void' in 8.3.8 for 'add', 'prepend' and 'insertAt' signature.

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