2021-12 - SysML v2 Pilot Implementation
This is an incremental update to the 2021-11 release. It corresponds to Eclipse plugin version 0.19.0.
Language Features
- 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
actiondeclaration 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
conditionis false.
- An if action has the form
- 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{...}untiluntilCondition; - The
actiondeclaration part may be omitted for the entire while-loop action and/or the body action:
whilewhileCondition{...}untiluntilCondition;
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 towhiletrue.
loop{...}untiluntilCondition;
If the until condition is also omitted, then the action specifies a non-terminating loop.
loop{...}
- A while loop action has the form
- 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
actiondeclaration part may be omitted for the entire for-loop action and/or the body action:
forloopVariableDeclinsequenceExpr{...}
- A for-loop action has the form
- Path expressions. Previously, a path expression of the form
expr.a.b.cwas 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.cparses as a single expression that applies the feature chain (e.g.,a.b.c) to the result of the expressionexpr.
Model Library
- Occurrences. The
HappensDuringandHappensBeforeassociations in theOccurrencesKernel Library model have been updated with cross-relation and transitivity constraints and the semantic constraints on theHappensJustBeforeassociation have been simplified. - Actions. Added the action definitions
IfThenAction,IfThenElseAction,LoopAction,WhileLoopActionandForLoopAction, along with corresponding base usages, to theActionsSystems Library model. - SI. The
longNamefeature 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. - USCustomaryUnits. A large number of additional units have been added to the
USCustomaryUnitsmodel 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 theSIpackage.
Backward Incompatibilities
- Keywords. SysML: Added: loop until while.
- 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).
- The result of a path step expression (e.g.,
- Measurement unit "long names". The
longNamefeature has been removed from theTensorMeasurementReferencedefinition in theUnitsAndScalemodel from the Quantities and Units Library. IflongNamewas 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
- PlantUML
None. - Tom Sawyer
None.
Technical Updates
- 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
- Operands. Fixed the duplicated serialization into XMI of the
operandsof an OperatorExpression. This also eliminated the duplicate validation checks and error messages onoperands.