Skip to content

2022-09 - SysML v2 Pilot Implementation

Choose a tag to compare

@seidewitz seidewitz released this 21 Oct 21:34
· 1645 commits to master since this release

This is an incremental update to the 2022-08 release. It corresponds to Eclipse plugin version 0.28.1.

Language Features

KerML and SysML

  1. Library packages. The keyword library can be used to identify a package as a library package, e.g., library packageDynamicsModelLibrary { ... }. Further prefixing a library package declaration with the keyword standard identifies it as a standard library package. However, standard should only be used to identify library packages that are part of the standard KerML and SysML model libraries (i.e., those in the sysml.library project in the pilot implementation), or other accepted standard model libraries in the future.
    [PR #416]

  2. Metadata access. A metadata access expression has the form elementName.metadata, where elementName is a qualified name for any kind of element. Such an expression evaluates to a sequence of instances of the reflective metaclass KerML::Metaclass representing the owned metadata feature annotations of the named element, in order. In addition, the last element of the sequence is always an instance of the reflective abstract syntax metaclass for the named element representing the instantiation of the element in the model.

    For example, given the model

    import RiskMetadata::*;
    part def SystemDesign {
        metadata Risk {
            totalRisk = RiskLevelEnum::medium;
        }
    }
    

    The expression SystemDesign.metadata evaluates to a sequence of two values, the first of which is an instance of the metadata definition RiskMetadata::Risk, and the second of which is an instance of SysML::PartDefinition. The following operators are convenient for operating on such sequences of metadata:

    • elementName@@Metaclass is a shorthand for elementName.metadata@Metaclass. It tests whether any of the metadata of the named element is a direct or indirect instance of Metaclass. For example, given the above sample model, the expressions SystemModel @@ Risk and SystemModel @@ SysML::Definition both evaluate to true.
    • elementNamemetaMetaclass is a shorthand for elementName.metadata asMetaclass. It filters the metadata of the named element for only those that are instances of Metaclass. This is useful for accessing the values of features of the metadata. For example, given the above sample model, (SystemDesignmetaRisk).totalRisk.probability evaluates to LevelEnum::medium and (SystemDesignmetaKerML::Element).name evaluates to "SystemDesign" (note that the parentheses are required, due to meta having the operator precedence of a binary operator).

    [PR #416]

  3. "Same" operator. The === operator checks if two occurrences are portions of the same life (i.e., have the same "identity"). The operator !== is the inverse of ===. For example, given the model

    part car {
       timeslice drivenByAlice;
       then timeslice drivenByBob;
    }
    

    the expression car.drivenByAlice == car.drivenByBob evaluates to false, because the two timeslices are different occurrences, but car.drivenByAlice === car.drivenByBob evaluates to true, because the two timeslices are both portions of the life of the same car. For data values (i.e., non-occurrences), the === operator is the same as ==.

    Implementation Note: Expression evaluation in the pilot implementation currently does not implement the functionality of === and !== and simply treats them the same as == and !=.
    [PR #417]

SysML Only

  1. Conjugated port typing. While the notation for conjugated port typing has not changed, the way the conjugated port definition is resolved has changed. Previously, in a declaration such as portp : ~P;, the conjugated port typing was a relationship between the port usage p and the port definition P, with the actual conjugated port definition being derived as the one owned by P. Now, the conjugated port typing relationship is instead between the port usage and the actual conjugated port definition, which is found by resolving the constructed qualified name P::'~P'. The corresponding port definition P is now a derived property of the conjugated port typing, determined as the owning port definition of the conjugated port definition.
    [PR #416]

  2. Send action. Send action syntax has been extended to include a new via clause: sendpayloadviasendertoreceiver;. This allows for arguments for both the sender (via) and receiver (to) parameters of SendAction (see also the model library update description below). While having both via and to is allowed, it is expected that generally only one or the other will be used, with via being used to send "out" through a port (parallel to the use of via on an accept action for accept "in" through a port).
    [PRs #410, #416]

  3. Messages. The parsing of message declarations has changed. A declaration of the form message fromsourceEventtotargetEvent; still parses to a connection usage, but without connection ends. Instead, it redefines Transfer::sourceEvent and Transfer::targetEvent to reference the given sourceEvent and targetEvent , respectively (see also model library update description below). This allows such a message to be realized by either a message connection in which the sourceEvent is a send action and the targetEvent is an accept action, or a flow connection, such as between two ports, in which case the source and target ports are also the sourceEvent and targetEvent.
    [PR #410]

Model Libraries

General

  1. Library packages. All standard model library packages are now declared as standard library package.
    [PR #416]

  2. Reflection. The reflective abstract syntax models KerML and SysML now include all navigable properties from the normative MOF abstract syntax model as features of the corresponding metaclasses/metadata definitions.
    [PR #408]

Kernel Semantic Library

  1. Event handling. Updated the models Occurrences, Performances, Transfers, TransitionPerformances and StatePerformances to capture semantics related to event handling, including prioritized dispatch, accept matching and run-to-completion.
    [PR #410]

Kernel Functions Library

  1. Base and data functions.

    • Added the abstract function '===' to BaseFunctions, for use as the function invoked by the === operator. Added the function '!==' as the opposite of '===' and the function invoked by the !== operator.
    • Added a specialization of BaseFunctions::'===' for data values to DataFunctions, for which it is the same as '=='.

    [PR #417]

  2. Sequence functions. Added the following new functions to SequenceFunctions.

    • same compares whether two sequences are the same using === (as opposed to equals, which uses ==).
    • includingAt returns a sequence of values constructed from two input sequences by adding the second sequence at a given index in the first sequence.
    • excludingAt returns a sequence of values containing all the values from an input sequence except those within a given range of indices (inclusive).

    Added the following behaviors for convenient "standalone" modification of a sequence given with an inout parameter:

    • add adds a sequence of values to the end of the input sequence (using including).
    • addAt adds a sequence of values at a given index of the input sequence (using includingAt).
    • remove removes a set of values from the input sequence (using excluding).
    • removeAt removes the values within a given range of indexes (inclusive) of the input sequence (using excludingAt).

    [PR #417]

  3. Occurrence functions. Added a new OccurrenceFunctions package that defines functions that operate on occurrences, primarily related to the time during which those occurrences exist.

    • '===' specializes BaseFunctions::'===' for occurrences. It tests whether two occurrences are portions of the same life. That is, whether they represent different portions of the same entity (colloquially, whether they have the same "identity").
    • isDuring tests whether a performance of the function happens during the input occurrence.
    • create ensures that the start of a given occurrence happens during a performance of this function. The occurrence is also returned from the function.
    • destroy ensures that the end of a given occurrence happens during a performance of this function. The occurrence is also returned from the function.
    • addNew adds a newly created occurrence to the given group of occurrences and returns the new occurrence.
    • addNewAt adds a newly created occurrence to the given ordered group of occurrences at the given index and returns the new occurrence.
    • removeOld removes a given occurrence from a group of occurrences and destroys it.
    • removeOldAt removes the occurrence at a given index in an ordered group of occurrences and destroys it.

    [PR #417]

Systems Library

  1. Connections.

    • Added MessageConnection as the most general base type for connection definitions and usages, with FlowConnection as specialization of MessageConnection.
    • Added the features sourceEvent and targetEvent to MessageConnection to identify the events occurrences within the source and target of the connection that create and accept the connection as a transfer, e.g., a source send action and a target accept action. For non-message flow connection usages, sourceEvent and targetEvent default to source and target.

    [PR #410]

  2. Actions.

    • Made SendAction a specialization of the new Transfers::SendPerformance behavior, which means it inherits a new sender parameter. The argument for this parameter is set using the new via clause in the send notation (see above).
    • Added AcceptMessageAction as a specialization of the new Transfers::AcceptPerformance behavior, with AcceptAction now a specialization of AcceptMessageAction. AcceptAction is still the base type for all accept action usages other than the accepter actions of TransitionActions.
    • Changed the type of TransitionAction::accepter to AcceptMessageAction.

    [PR #410]

Backward Incompatibilities

  1. Reserved words. Added: library meta standard

  2. Classification operators. The istype, hastype and @ operators have been extended to allow arguments with more than one value. The istype and hastype test whether all the argument values have the given type (either directly or indirectly for istype, or just directly for hastype). The @ operator, on the other hand, tests if any of the argument values have the given type (directly or indirectly). Note that this means that istype and hastype are always true for null (the empty sequence), while @ is always false.
    [PR #416]

  3. Meta-casting. Previously, a cast expression of the form featureRefasMetaclass could be used to "meta-cast" the referenced feature to the given metaclass. This will now generate a warning and always evaluate to null (unless, of course, the type of the referenced feature really conforms to the given the metaclass). The same functionality can now be realized by replacing the as operator with the new meta operator (see above).
    [PR #416]

  4. Send via ports. Previously, a send action of the form sendpayloadtoport; was used to send a payload out through a port. This will now generate a warning that port usages should generally not be "receiver" targets of send actions. Instead, use the new form sendpayloadviaport;.
    [PR #410]

Jupyter

  1. Expression evaluation. A new %eval magic command has been added that evaluates an expression, optionally in the context of a given model target. This is a preliminary capability that does not yet fully implement all the standard library functions beyond those required for operator evaluation. It also operates only on the static model definition and does not implement dynamic execution over time. However, it does implement metadata access and evaluation of user-defined functions (calculations).
    [PRs #403, #405]

Visualization

  1. PlantUML

    • Expression evaluation. The PlantUML visualization now has an EVAL style that visualizes the results of evaluating feature values, when possible (in Eclipse, select "Evaluate expressions" from the style menu). The EVAL style can also be used with the SHOWINHERITED style to visualize the evaluation of inherited features, properly accounting for any redefinition of features referenced in the evaluated expression.
      [PR #403]
    • Bug fixes. See below.
  2. Tom Sawyer

    • Fixed the visualization of proxy connection points.

Technical Updates

  1. isLibraryModel. The SysMLLibraryUtil::isLibraryModel method is now deprecated. Instead, use the Element::isLibraryElement method to check if an element is a library element. To check if an element is a standard library element, use the ElementUtil::isStandardLibraryElement method. (This utility method checks that the element has a library namespace that is a library package and that this library package is a standard library package.)
  2. org.omg.sysml.execution. A new org.omg.sysml.execution project has been added. This project is intended to eventually contain the implementation of a general model execution capability. Currently, it has only the org.omg.sysml.execution.expression package, which extends the model-level expression evaluation capability to handle the (non-model-level) evaluation of user-defined functions.

Bug Fixes

  1. Name resolution. Fixed a bug that could prevent proper name resolution of the last library model loaded in Jupyter.
    [PR #402]

  2. ItemFlow itemType. Prevented a possible null pointer exception when calling ItemFlow.getItemType.
    [PR #400]

  3. ItemFlow itemFlowFeature. Fixed the implementation of ItemFlow.getItemFlowFeature, which had broken in 2022-08.
    [PR #407]

  4. Flow connection visualization. Fixed the visualization of flow connection usages in PlantUML.
    [PR #401]

  5. Specialization visualization. Fixed the visualization of specialization with SHOWINHERITED style in PlantUML.
    [PR #404]

  6. Sequence diagram visualization. Fixed the rendering of sequence diagrams in PlantUML, which had broken recently.
    [PR #413]

  7. Feature value visualization. Added rendering of the feature value expressions in usages represented as symbols in PlantUML.
    [PR #411]

  8. JSON serialization. Fixed a bug in the model traversal algorithm that was preventing serialization of "owner" properties in some cases.
    [PR #415]