Skip to content

2022-07 - SysML v2 Pilot Implementation

Compare
Choose a tag to compare
@seidewitz seidewitz released this 10 Aug 19:46
· 1023 commits to master since this release

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

Language Features

The notation for a number of kinds of elements has been extended to allow them to have bodies ({...}).
[PR #381]

KerML

  1. Relationships. The relationship notation has be extended to allow any kind of element to be declared as an owned related element of a relationship, not just element declarations and annotations. In addition, the following relationship notations have also been extended to allow similar relationship bodies.

    • import
    • alias
    • specialization (including subclassification, subsetting and redefinition)
    • conjugation
    • disjoining
    • inverting
    • featuring
  2. Multiplicities. The multiplicity declaration notation can now have a full feature body.

SysML

  1. Relationships. The import, alias and dependency notations have been extended to allow bodies, but these bodies can only contain annotations (comments, documentation, textual representation or metadata).

  2. Action body elements. The following notations (used within action definitions and actions usages) can now have full usage bodies.

    • Guarded successions (firstsourceNameifconditionthentargetName;)
    • Target successions (thentargetName; and ifconditionthentargetName;)
    • Control nodes (fork, join, decision, merge)
  3. Transition usages. Within state definition and usage bodies, transition usages can now have full action bodies.

Model Libraries

Kernel Libraries

  1. Subdirectories. The Kernel Libraries directory has been reorganized into three subdirectories:

    • Kernel Semantic Library – Library models that provide the base types for required implicit specializations in KerML user model constructs, plus additional semantic models for more advanced capabilities (such as state-based behavior, etc.).
    • Kernel Data Type Library – Library models of standard data types that can be used in user models.
    • Kernel Function Library – Library models of standard functions that can be used in user models, including functions corresponding to all the operators in the KerML expression syntax.

    [PR #384]

  2. Local clocks.

    • Clocks. The singleton defaultClock feature has been renamed to universalClock. The defaults for the clock parameters of the TimeOf and DurationOf functions have been changed from defaultClock to localClock (see below).
    • Occurrences. A localClock feature has been added to Occurrence that defaults to Clocks::universalClock. The localClock of an Occurrence is passed down as the default for each of its composite suboccurrences.
    • SpatialFrames. The defaults for the clock parameters of various functions in this package have been changed from defaultClock to frame.localClock.
    • Triggers. The defaults for the clock parameters of TriggerAt and TriggerWhen have been changed from defaultClock to localClock.

    [PR #382]

Domain Libraries

  1. Local clocks.

    • Time. The singleton defaultClock part has been renamed to universalClock. The defaults for the clock parameters of the TimeOf and DurationOf calculation definitions have been changed from defaultClock to localClock.
    • SpatialItems. The existing declaration of localClock for SpatialItem has been updated to redefine Occurrences::localClock and default to Time::universalClock.

    [PR #382]

The above updates for local clocks allow, for example, the following:

part context {
  // This defines a local clock used by default within the “context” part.
  part :>> localClock = Time::Clock();

  state behavior {
    entry; then S1;
    
    state S1;
    
    transition
      first S1
      // The time instant in the trigger is, by default, 
      // relative to context::localClock.
      accept at Time::Iso8601DateTime("22-05-12T00:00:00")
      then S2;
    
    state S2;
  }
}

Backward Incompatibilities

The following textual notations have been removed, because they are considered to have become redundant or unnecessary as the notation has evolved.
[PR #381]

  1. Logical operators. For certain Boolean operators, the expression notation currently includes both operator symbols (adapted from C/Java expression syntax) and equivalent operator keywords (introduced later). This release removes the operator symbols in favor of the keywords.

    Removed Retained
    ! not
    && and
    || or
    ^^ xor
    => implies
    ... ? ... : ... if... ? ...else...

    Note that the pure logical operators & and | have also been retained.

  2. Parameter declaration. The textual syntax previously allowed for a parenthesized functional notation for declaring the parameters of a behavioral element (e.g., behaviors and steps in KerML and action definitions and usages in SysML), similarly to how parameters are declared in many programming languages. However, in KerML and SysML, parameters are simply directed features of behavioral elements which can also be declared in the body of a behavioral element. This release removes the parenthesized notation in favor of consistently using the same directed feature declaration syntax used for structural elements (e.g., ports).

    Previously allowed

    action def A (
       x : T1,
       out y : T2
    );
    calc def B (
        x : T1;
    ) return : T2;
    

    Alternative using directed features

    action def A {
        in x : T1,
        out y : T2
    }
    calc def C {
        in x : T1;
        return : T2;
    }
    

    Note that the direction must be provided when declaring a parameter as a directed feature (unlike the special parameter notation, in which in was the default), otherwise the feature will not be directed and not considered a parameter. Parenthesized functional notation is can still be used for invoking a function or calculation in an expression, e.g., C(t1).

  3. flow from shorthand. The textual notation previously allowed for a flow from shorthand on a usage declaration, for a flow connection into that usage, similar to the feature value shorthand for a binding. This has been eliminated.

  4. Prefix comments. Previously, a comment starting with /** (i.e., with two stars instead of one) was parsed as a "prefix comment", which was automatically about the lexically following element in a namespace body. This notation has been eliminated in favor of using a documentation (doc) comment nested in the body of the element being annotated. In order to allow this more generally, the textual syntax has also been extended to allow bodies on elements that where not able to have them before (see "Language Features" above).

    (For this release only, the previous prefix comment notation will generate a warning that the notation is no longer supported. This warning will be removed in the next release, at which point the notation will simply parse as a regular comment without any warning.)

Jupyter

None.

Visualization

  1. PlantUML
    • Feature values whose value expression is a feature reference or a feature chain are now visualized as binding connectors on interconnection and action views.
      [PR #379]
  2. Tom Sawyer
    • Fixed the visualization of connectors on structural interconnection diagrams.

Technical Updates

  1. Derived properties. The implementation for all derived properties has been moved from handwritten, in-line method code in metamodel Impl classes into separate delegate classes, using the Eclipse "setting delegate" mechanism.
    [PR #380]

Bug Fixes

  1. State and state transition performances. Errors in the Kernel Library models for StatePerformance and StateTransitionPerformance have been corrected.
    [PR #383]