Lesson 5 - Enforcing Multiplicity Limits - 3 Runners Caused No Errors

Greetings!

I believe that I defined the multiplicity for “runner” correctly based on the way “reindeer” is defined:

abstract ref part reindeer : Reindeer [9];
// Definition of Runner and Side not shown
abstract part runner : Runner [2];
part leftRunner :> runner { attribute :>> side := Side::leftRunner; }
part rightRunner :> runner { attribute :>> side := Side::rightRunner; }
part centerRunner :> runner; // 3rd Runner. Why does this not cause an error?

If the multiplicity is defined correctly, I would expect that usage of a 3rd runner would result in some kind of notification (error or warning.)

How is the multiplicity enforced or used?

Thanks!

~Ben

Hello Ben!

It might not seem intuitive, but in terms of SysML semantics there is vagueness whether leftRunner, rightRunner and centerRunner are all distinct.

In general Editor does not enforce multiplicity since the current SysML v2 spec does not specify any hard restrictions on multiplicities. However, a custom validation can be written using syside Automator to enforce multiplicity rules that suit your needs.

Hope that helps!

-Martynas

1 Like

Hello Ben,

What Martynas said is correct—unfortunately, this is a shortcoming of the specification. The keyword “disjoint" is currently not part of SysML (only KerML), and the open-world semantics allow any type to have an intersection unless explicitly forbidden by the model (by the way, the definition of different nose colors for each reindeer happens to achieve this implicitly).

If you are in the SysML v2 Release Google Group, this thread touched the topic: https://groups.google.com/g/sysml-v2-release/c/IxXXfalPO7U/m/ii1jttcSBwAJ

There are several ideas on how to overcome this, but there is no definitive answer yet. Most of us assume that tools will operate based on some kind of “disjointness policy" to guess user intent (as pioneered by Steve Jenkins in the onology world). If we stick to the open world semantics and the language as it is now, it will takes solvers/provers to figure out if a model is satisfiable—which is probably not very practical.

Vince

1 Like

Martynas, Vince,

Thank you for your explanation and for providing background details.

~Ben