Skip to content

2021-12 - SysML v2 Pilot Implementation

Choose a tag to compare

@seidewitz seidewitz released this 14 Jan 21:55
· 2348 commits to master since this release

This is an incremental update to the 2021-11 release. It corresponds to Eclipse plugin version 0.19.0.

Language Features

  1. If actions. An if action evaluates a Boolean-valued condition. If the result is true, it performs a nested then action, otherwise it performs a nested else action.
    • An if action has the form
      actionifNameifconditionactionthenActionName{ ... }else actionelseActionName{ ... }
    • The action declaration part may be omitted for the entire if action, the then action and/or the else action:
      ifcondition{ ... }else{ ... }
      The curly braces are required, even if the body of the then action or else action is empty, unless the else action is itself an if action, in which case a simplified notation can be used:
      ifcondition{ ... }else if{ ... }else{ ... }
      This is equivalent to
      ifcondition{ ... }else{if{ ... }else{ ... } }
    • The else action is optional. If it is omitted, then no action is performed if the condition is false.
  2. While-loop actions. A while-loop action repeatedly performs a nested body action as long as a Boolean-valued while condition is true and an until condition is false. The while condition is evaluated before each iteration, and the until condition is evaluated after the iteration.
    • A while loop action has the form
      actionwhileLoopNamewhilewhileConditionactionbodyName{ ... }until untilCondition;
    • The action declaration part may be omitted for the entire while-loop action and/or the body action:
      whilewhileCondition{ ... }until untilCondition;
      The curly braces are required, even if the body is empty.
    • The until condition is optional. If it is omitted, then the default is untilfalse (that is, no effect).
      whilewhileCondition{ ... }
    • The while condition may be replaced with the keyword loop, which is equivalent to whiletrue.
      loop{ ... }until untilCondition;
      If the until condition is also omitted, then the action specifies a non-terminating loop.
      loop{ ... }
  3. For-loop actions. A for-loop action iterates over the values resulting from the evaluation of a sequence expression, assigning each in turn to a for variable feature and performing a nested body action for the assigned value.
    • A for-loop action has the form
      actionforLoopNameforforVariableDeclinsequenceExpractionbodyActionName{ ... }
    • The action declaration part may be omitted for the entire for-loop action and/or the body action:
      forloopVariableDeclinsequenceExpr{ ... }
  4. Path expressions. Previously, a path expression of the form expr.a.b.c was parsed as a tree of path step expressions. That is, it was parsed like (expr.a).b).c). Such expressions are now parsed so that a trailing path of two or more features parses as a feature chain. That is, expr.a.b.c parses as a single expression that applies the feature chain (e.g., a.b.c) to the result of the expression expr.

Model Library

  1. Occurrences. The HappensDuring and HappensBefore associations in the Occurrences Kernel Library model have been updated with cross-relation and transitivity constraints and the semantic constraints on the HappensJustBefore association have been simplified.
  2. Actions. Added the action definitions IfThenAction, IfThenElseAction, LoopAction, WhileLoopAction and ForLoopAction, along with corresponding base usages, to the Actions Systems Library model.
  3. SI. The longName feature binding has been removed from unit declarations. The declarations have been revised so that the declared unit name is its "long name" and its human ID is its abbreviation. Due to the name resolution rules for human IDs, this should have no effect on existing user models.
  4. USCustomaryUnits. A large number of additional units have been added to the USCustomaryUnits model from the Quantities and Units Domain Library, based on the NIST SP811 standard. (Note, however, that a further update to this package is expected in the next release.) All unit declarations in the package now also use the same naming convention described above for the SI package.

Backward Incompatibilities

  1. Keywords. SysML: Added: loop until while.
  2. Implicit typing. The following improvements have been made to the implicit typing of certain expressions, which may result in new type warnings in some places.
    • The result of a path step expression (e.g., expr.a.b.c) is typed like the result of the feature or feature chain being accessed (e.g., a.b.c).
    • The result of a path select expression (i.e., expr.{ ... }) is typed like the result of its first argument (expr), which is the expression that evaluates to the collection being selected from.
    • The result of an invocation expression used as a constructor for a non-function type (e.g., ItemType( ... )) is typed by the type being constructed (e.g., ItemType).
  3. Measurement unit "long names". The longName feature has been removed from the TensorMeasurementReference definition in the UnitsAndScale model from the Quantities and Units Library. If longName was being bound in a unit declaration, the value should instead be used as the name of the unit, with the short name or abbreviation used as the human ID.

Jupyter

None.

Visualization

  1. PlantUML
    None.
  2. Tom Sawyer
    None.

Technical Updates

  1. Content assist. The Xtext generation workflows have been updated to remove the generation of content assist code, including the content-assist-specific parser. This was necessary due to a problem with the generation of the content-assist parser (see the in PR #313), and it resolves the known issue of the editors hanging when content assist is triggered (see issue #220). A custom implementation of content assist may be considered in the future, as time and resources permit.

Bug Fixes

  1. Operands. Fixed the duplicated serialization into XMI of the operands of an OperatorExpression. This also eliminated the duplicate validation checks and error messages on operands.