Chapter 1. Modeling the State Structure of a System

Items and Parts

Core Modeling Concepts

Types
classify things and may have features.
There are two kinds of types: classifiers and features.
Classifiers
are types that classify things.
Examples: data types, item types, part types, action types.
Features
model the relations between things.
Examples: attributes, item properties, part properties, action steps.

Types

Examples of Classifiers and Features

An item type definition with two attributes
item def Person {
  attribute name : String;
  attribute age : Natural;
}
Two part type definitions
part def Engine;
part def Wheel;
A part type definition with four features
part def Car {
  attribute mass : ISQ::MassValue;
  Three part properties
  part engine : Engine;
  part wheels[4] : Wheel;
  ref part driver[0..1] : Person;
}
  1. The data type MassValue is predefined in the library package ISQ.
  2. wheels[4] means that the part property wheels has the multiplicity 4, implying that it has exactly 4 values.
  3. driver[0..1] means that this part property has at most one value.
  4. By default, part properties are "composite" features, representing parts/components, which cannot exist after the whole ceases to exist, unlike "referential" features.
  5. ref part means that this part property is not composite, but referential.

Terminology

SysML v2 comes with a superfluous jargon: calling classifiers (like data types or item types) "definitions" and calling features (like attributes or item properties) "usages", which is confusing.

Official SysML v2 TerminologyPreferrable (Classsical) Terminology
attribute definitiondata type
attribute usageattribute
item (part/port/action/etc.) definitionitem (part/port/action/etc.) type
item (part/port/etc.) usageitem (part/port/etc.) property
action usageaction property (or action step)

Connection Types

A connection is both a relationship between parts and a kind of part.

A connection type is an association that classifies connections between related parts.

Mounting association class model
part def Axle {...}
part def Wheel {...}
connection def Mounting {
  end [1] part mountingAxle : Axle;
  end [2] part mountedWheel : Wheel;
}

End properties, like mountingAxle and mountedWheel, always have the multiplicity 1.

The yellow multiplicities are called cross multiplicities.

The cross multiplicity [2] of the end property mountedWheel expresses the constraint that for any instance of Axle, there are exactly two links in the extent of Mounting linking the axle to two different wheels.

Connection Properties

An axle assembly consists of one axle, two wheels and two mount connections, such that each of the two wheels is connected to the axle via a mount connection.

part def Axle {...}
part def Wheel {...}
connection def Mounting {
  end [1] part mountingAxle : Axle;
  end [2] part mountedWheel : Wheel;
}
part def AxleAssembly {
  part axle : Axle;
  part wheels[2] : Wheel;
  connection mount[2] : Mounting 
    from axle to wheels;
}

The connection property mount specializes the connection type Mounting by restricting its end values to values from the corresponding part properties axle and wheels. It has exactly 2 values: one mount connection for each of the 2 wheels.

Ports and Interfaces

Ports, as values of port properties, are special objects representing connection points. The ports referenced by two port properties can be connected via an interface property for enabling transfers (e.g., of signals or physical quantities) if their types match in the sense that they have the same directed parameters, but with inverse direction.

port def MotorCtrlPort {
  out attribute speed : Real;
  out attribute dir : Integer;
  in errorStatus : Integer;
}
port def CtrlInputPort {
  in attribute speed : Real;
  in attribute dir : Integer;
  out errorStatus : Integer;
}
part def Vehicle {
  part motorController {
    port motorCtrlPort : MotorCtrlPort;
  }
  part motor {
    port ctrlInputPort : CtrlInputPort;
  }
  interface motorController.motorCtrlPort 
    to motor.ctrlInputPort;
}

An interface property is a special kind of connection property for connecting ports.