SysML 2.1b1 RTF Avatar
  1. OMG Issue

SYSML21 — Operator '[' has undefined precedence in quantity value expressions

  • Key: SYSML21-352
  • Status: open  
  • Source: DEKonsult ( Mr. Hans Peter de Koning)
  • Summary:

    In KerML clause 8.2.5.8.2 Primary Expressions, operator '[' is declared as an abstract function in BaseFunctions.kerml, as an Undefined placeholder. As such the operator does not have a precedence position in Table 6 Operator Precedence (in 8.2.5.8.1 Operator Expressions).

    In SysML the operator '[' is redefined as a concrete calc def to construct quantity and measurement reference value tuples (defined by ScalarQuantityValue, VectorQuantityValue or TensorQuantityValue).

    When used in quantity expressions that contain also other (arithmetic) operators it is currently undefined what the evaluation order is.

    Examples:

    • What is the interpretation of 24 + 5 [kg] ? Is it (24 + 5) [kg] or 24 + (5 [kg])? The latter interpretation would raise a quantity arithmetic error since it is not valid to add a scalar number (implicitly of dimension one) and a scalar quantity value with a different quantity dimension.
    • What is the interpretation of 6 * 8.5 [kg] ? Is it (6 * 8.5) [kg] or 6 * (8.5 [kg])? Here, both are valid and yield the same result, but it can get more complicated.
    • What is the interpretation of 6 [kg] / 22 [L] ? Is it (6 [kg] / 22) [L] or (6 [kg]) / (22 [L])? Intuitively the latter, although one could argue both yield the same result: (6 / 22) [kg/L].
    • What is the interpretation of 13 [m/s]^2 ? Is it (13 [m/s])^2 or 13 ([m/s]^2)? Subexpression ([m/s]^2) would not be valid.

    The precedence of the '[' operator should be defined relative to the other binary operators.

  • Reported: SysML 2.0b4 — Tue, 9 Sep 2025 18:06 GMT
  • Updated: Sat, 13 Sep 2025 23:07 GMT