Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
128 stars 24 forks source link

ST6RI-584 KerML notation for union, intersection and difference #396

Closed seidewitz closed 2 years ago

seidewitz commented 2 years ago

This pull request adds textual notation to KerML for the new Unioning, Intersecting and Differencing relationships. The notation consists of new clauses that can be used in any kind of type declaration (including classifiers, features, connectors, etc.), included in the set of clauses that appear after the specialization part of the declaration.

  1. unionA, B, ... – Specifies that the declared type has ownedUnioning relationships with each of the types A, B, ..., meaning that the declared type classifies everything that is classified by any of the listed types.
  2. intersectionA, B, ... – Specifies that the declared type has ownedIntersecting relationships with each of the types A, B, ..., meaning that the declared type classifies everything that is classified by all of the listed types.
  3. differencingA, B, ... – Specifies that the declared type has ownedDifferencing relationships with each of the types A, B, .... If this is the first differencing clause in the declaration, it means that the declared type classifies everyhing that is classified by the first listed type but not classified by any of the remaining types. Any additional differencing clauses in a declaration mean that the declared type does not classify anything classified by any of the listed types.

For example:

class Adult;
class Child;

class Person unions Adult, Child {
    feature dependents : Child[*];
    feature offspring : Person[*];
    feature grownOffspring : Adult[*] :> offspring;
    feature dependentOffspring : Child[*] :> dependents, offspring 
        differences offspring, grownOffspring 
        intersects dependents, offspring;
}

Note that multiple relationships of each kind can be specified using multiple clauses in a single declaration. But it is not allowable for a type to have just one of any of these kind of relationships over all.


// This is valid.
class Person unions Adult unions Child;

//This is NOT valid.
class Person unions Adult;
conradbock commented 2 years ago

Wording suggestions to indicate sufficiency (any->every, see underscores):

  1. union ... the declared type classifies _every_thing that is classified by any of the listed types.
  2. intersection ... the declared type classifies _every_thing that is classified by all of the listed types.
  3. differencing ... the declared type classifies _every_thing that is classified by the first listed type but not classified by any of the remaining types.
seidewitz commented 2 years ago

Wording suggestions to indicate sufficiency

Sure.