Understanding KerML and SysML v2

A tutorial summary of the Kernel Modeling Language (KerML) and the Systems Modeling Language version 2 (SysML v2)

Copyright © 2024-2025 Gerd Wagner

Draft version, published 2025-04-26. Notice: This is a "living document" that will be extended and improved continuously.

Abstract

These notes have been collected for helping me to understand the new System Modeling Language version 2 (SysML v2) and the Kernel Modeling Language (KerML), on which it is based, and I hope they are also helpful to others. They consist of extracts from the KerML and SysML2 specifications, diagrams describing meta-model fragments, comments, explanations and instructive examples.


"This is one of the very few writings about SysML v2 I have encountered until today that has both depth and precision. Great job Gerd! I highly recommend reading it."

Vince Molnár, SysML v2 Conformance and Formal Methods WG lead about the SysML v2 FAQ (in a Linked post).

Table of Contents

List of Figures

List of Tables

Part I. The Kernel Modeling Language

The Kernel Modeling Language (KerML) is a domain-independent modeling language for describing existing systems or for defining designs of planned systems, including not only digital software/hardware systems such as information systems, but also socio-cyber-physical systems such as spacecrafts or smart cities, and possibly also biological and social systems.

While digital systems and social systems can be viewed, and modeled, as discrete dynamical systems, where system state changes are discrete (as modeled by discrete events), physical systems are typically continuous dynamical systems, where system state changes are continuous (as modeled by differential equations). Surprisingly, this fundamental conceptual distinction between two kinds of system state changes has not been taken into consideration in KerML/SysML.

SysML v2 and its underlying foundation, KerML, represent an ambitious effort to improve both upon UML 2 and upon SysML v1. In this effort, very bold design choices have been made for obtaining a well-integrated parsimonious and profound systems modeling language, but at the expense of backwards compatibility, thus possibly hampering its usability.

While the UML was the foundation of SysML version 1, KerML is the foundation of SysML version 2, and is built upon 20 years of experience with SysML version 1 and 30 years of experience with UML. KerML keeps many of the modeling concepts of UML, but it also changes several of its concepts, introduces new concepts, and changes some of its terminology.

Chapter 1. Introduction

KerML has been mainly designed for the purpose of developing (or engineering) technical systems by specifying their structure and behavior. However, the "structure and behavior" dichotomy is not really adequate for describing/defining a system, since its dynamics cannot be described in terms of its components' behaviors alone, but rather in terms of the (types of) events and processes that happen in the system and its operational environment, which includes their (component) behavior. KerML's lack of support for the modeling concepts of events and processes indicates a severe shortcoming.

Unlike for the UML, where diagram languages are the preferred way of expressing models, the preferred concrete syntax of KerML is textual. For instance, the following KerML text defines a classifier with a feature (attribute):

classifier Organization {
  feature name : String;
}

KerML models are expressed using a textual concrete syntax that can be parsed and mapped to an abstract syntax representation, which is then given a semantic interpretation according to the formal semantics of KerML's core constructs and the relationship of user model elements to the KerML Semantic Library.

KerML semantic constructs beyond the core are essentially just syntactic conveniences for reusing specific library concepts: structures for modeling objects, behaviors for modeling performances, associations for modeling links, etc. (from Chapter 1 Scope)

The formal semantics of KerML's core constructs is based on Tarski's model theory of predicate logic. Relative to a given interpretation, classifiers are essentially interpreted, like unary predicates, as a set of individuals from the universe of the interpretation, while features are essentially interpreted, like binary predicates, as binary relations that subset the Cartesian product of their domain and their range. In fact, due to KerML's support of ordered and non-unique features, and due to its adoption of the (puzzling) semantic postulate that features specialize their range, the formal semantics is more complicated.

Surprisingly, KerML does not provide any operational semantics for its behavior modeling elements, but rather considers them as predicates with a (static) model-theoretic semantics, which requires model interpretations that incorporate a complete history of the system under consideration. This approach is related to KerML's surprising choice of adopting a "4D ontology" where objects happen over time (that is, they are identified with their history), as opposed to UML's view of objects as 3D entities that change over time.

1.1. Overview

The main authors of the KerML specification document are: • Ed Seidewitz, Model Driven Solutions • Conrad Bock, US National Institute of Standards and Technology (NIST) • Bjorn Cole, Lockheed Martin Corporation • Ivan Gomes, Twingineer • Hans Peter de Koning, DEKonsult • Vince Molnár, Budapest University of Technology and Economics.

KerML is organized in three layers: Root, Core and Kernel, as illustrated by the diagram below. While the Root layer defines language engineering concepts, the Core and Kernel layers define modeling concepts.

Figure 1-1. Overview of KerML's three layers
???

The black dots in the class diagram denote association end ownerships according to UML2. For instance, the black dot at the source association end (of the association between the classes Element and Relationship) denotes that this association end is owned by the class Relationship, which means that the class Relationship has a property source with range Element.

Notice that the use of the term "class" in KerML departs from its use in UML. There are two types of Classes in KerML: Structures (representing object types) and Behaviors (representing event/activity/process types), and the instances of Classes are not objects, but occurrences (things that happen over time). In KerML, objects are instances of Structures, while the instances of Behaviors are performances (representing events/activities/processes).

KerML takes the approach of providing a predefined top-level instance for every metamodel classifier. For instance, DataValue is a predefined instance of the classifier DataType such that any user-defined data type is a subtype of it. Instead of declaring

datatype URL;

you can equivalently declare

classifier URL specializes DataValue;

The following diagram provides an overview of KerML's metamodel classifiers and their top-level instances. The arrows with a dashed line denote the is-instance-of relationship. E.g., the predefined classifier Anything is the top-level instance of the metamodel classifier Classifier (consequently, any other instance of Classifier specializes Anything).

Figure 1-2. KerML's predefined classifiers as top-level instances of meta-model classifiers
???

1.2. What's New or Different Compared to UML

KerML keeps many of the modeling concepts of UML, but it also changes several of its concepts, introduces new concepts, and changes some of its terminology. In the following subsections, we briefly discuss important KerML elements that are new or depart from UML.

New Terminology

The concept of generalization has been replaced with the inverse concept of specialization. This reflects the fact that it is more common to make statements about specialization compared to generalization.

A number of UML modeling concepts have been renamed in KerML and SysML2. In particular, in SysML2, classifiers are called 'definitions' and features are called 'usages'.

UML classes are called structures in KerML and item/part definitions in SysML2. Recall that in UML, properties are structural features while operations are behavioral features. In SysML2, properties with a data type range are called attribute usages, while properties with a class range are called item or part usages. UML operations are called steps (features with a Behavior range) or expressions (features with a Function range) in KerML and action usages or calculation usages in SysML2.

UML TermSysML1 TermKerML TermSysML2 Term
classifierclassifierclassifierdefinition
featurefeaturefeatureusage
classblockstructureitem/part definition
data typevalue typedata typeattribute definition
property (structural feature) with a data type rangevalue propertyfeature with a data type rangeattribute usage
property (structural feature) with a class rangereference/part propertyfeature with a class rangeitem/part usage
connector propertyconnector propertyconnectorconnection
operation (behavioral feature)operationstep (feature with a Behavior range) or expression (feature with a Function range)action usage or calculation usage
parameterparameterdirected featureparameter

Stand-Alone Feature Declarations

Like the Web Ontology Language OWL allows declaring stand-alone properties, also KerML/SysML2 allow declaring stand-alone features not included in the declaration of a type that forms their domain, like the following ones:

KerMLSysML
feature name : String;
feature children[*] : Person;
attribute name : String;
item children[*] : Person;

Such a stand-alone declaration implies that the domain of the feature or (attribute/item/etc.) usage is the most general classifier, which is Base::Anything.

Features of Features

Since features are types and types may have features, KerML/SysML2 allow defining features of features (including the case of attributes of attributes) and provide a convenient syntax for nesting feature declarations, as shown in the following example:

KerMLSysML
classifier Organization;
classifier Person {
  feature name : String;
  feature employers[*] : Organization {
    feature salary : Real;
  }
}
item def Organization;
item def Person {
  attribute name : String;
  ref item employers[*] : Organization {
    attribute salary : Real;
  }
}

In this example, two classifiers (or item definitions), Organization and Person, are declared. Person is declared together with two features, the attribute name and the item usage employers, in such a way that for employers, an attribute salary is declared. This means that a person can have many employers and for each of them an employer-specific salary corresponding to the following tables representing example populations of the types Person and employers:

Person
nameemployers
Tom(IBM, 8200)
Peter(McDonald, 2100), (Starbucks, 1700)
Mary(Amazon,1200), (Walmart, 900), (Chipotle, 800)

Using the form of relational database tables, we get the following population table for the feature Person::employers:

Person::employers
personemployersalary
TomIBM8200
PeterMcDonald2100
PeterStarbucks1700
MaryAmazon1200
MaryWalmart900
MaryChipotle800

A nested feature definition like the one above can be flattened as follows:

classifier Person {
  feature name : String;
}
feature employers[*] : Organization featured by Person {
  feature salary : Real;
}

Features/Attributes May Represent Inputs or Outputs

A feature/attribute that is declared with the keyword in represents inputs, while a feature/attribute declared with the keyword out (or inout) represents outputs (or both inputs and outputs).

classifier Vehicle {
  composite feature fuelTank {
    out feature fuelFlowOut : Fuel;
  }
  composite feature engine {
    in feature fuelFlowIn : Fuel;
  }
}

In/out features are also used for modeling the parameters of Functions, which are defined as behavior classifiers, the instances of which are its executions/evaluations.

Features May Represent Portions of a Thing

Portion features are composite features where the values cannot exist without the whole, because they are the “same thing” as the whole. (For example, the portion of a person's life when they are a child cannot be added or removed from that person's life.)

Examples:

classifier Fuel {
  portion feature fuelPortion : Fuel;
}
classifier Person {
  portion feature childhood : Person;
}

Features/Attributes May Be Read-Only

Values of read only features on each instance of their domain are the same during the entire existence of that instance.

This implies that read-only features must already have a value for an instance of their domain on its creation, so they are mandatory and frozen.

classifier Book {
  readonly feature type : BookTypeEnumerationLiteral;
  feature isbn : String;
}

Semantic Libraries

Unlike the UML, KerML and SysML2 come with Semantic Libraries, which are collections of KerML/SysML2 models that are part of their semantics. The Base library model defines the top-most elements of the specialization hierarchy for all KerML types, including the most general classifier Anything, the most general feature things, and the most general datatype DataValue.

???

The following fragment from the Semantic Libraries defines abstract classifiers representing the most general Data Type, Class, Association, Structure and Behavior:

abstract classifier Anything;
abstract datatype DataValue specializes Anything;
abstract class Occurrence specializes Anything 
    disjoint from DataValue;
abstract assoc Link specializes Anything;
abstract struct Object specializes Occurrence;
abstract behavior Performance specializes Occurrence 
    disjoint from Object;

Logical Process Modeling

While in UML, process/behavior modeling has been scattered over three different, but overlapping, diagram languages (State Machines, Sequence Diagrams and Activity Diagrams), each of them coming with its own operational semantics and with no integration in the UML metamodel, behaviors are modeled in a uniform and declarative manner in KerML by

  1. Viewing behaviors as classes that are instantiated by behavior executions as occurrences, which allows (1) defining behavior properties and parts, including properties for referencing their participant objects, (2) specializing behaviors.
  2. Considering the composition of behaviors: while the components of objects are modeled as parts, the components of behaviors are modeled as steps.
  3. Logically sequencing the steps of a behavior with the help of successions, which are special connectors, such that each succession defines a temporal precedence constraint.

As in UML, events are not first-class citizens in KerML. In fact, events are not even mentioned at all in the KerML spec, despite the fact that they are considered as a fundamental modeling concept in many other modeling languages, such as BPMN and OntoUML, as well as in many Discrete Event Simulation modeling languages.

Taking an Ontological Perspective

Unlike UML, KerML and SysML2 take an ontological perspective by adopting the concept of occurrences, which are things that happen over time, from the philosophical discipline of Ontology. In KerML and SysML2, not only behavior performances, but also objects are occurrences. This is discussed in the next section.

Viewing Objects as Occurrences

KerML and SysML2 break with the established view (e.g., in UML) that objects are continuants, which persist over time, while events, actions/activities and processes are occurrences, which happen over time. For them, all things, including objects, are occurrences, which means that objects are identified with their histories/lifes.

The UML world view corresponds to a 3D Ontology, referring to the three dimensions of the space, in which objects are extended, while the KerML/SysML2 world view corresponds to a 4D Ontology, in which objects are extended in space and time.

Formal Semantics

While the UML2 specification does not include any formal semantics, the formal semantics of KerML's core concepts (types, classifiers and features) is defined in the form of an OWL-style (Tarskian) model-theoretic semantics. Relative to a given interpretation, classifiers are essentially interpreted, like unary predicates, as a set of individuals from the universe of the interpretation, while features are essentially interpreted, like binary predicates, as binary relations that subset the Cartesian product of their domain and their range. In fact, due to KerML's support of ordered and non-unique features, and due to its adoption of the (puzzling) semantic postulate that features specialize their range, the formal semantics is more complicated.

Since all other KerML and SysML2 concepts are defined in terms of KerML's core concepts and predefined library elements, the model-theoretic semantics is extended to all of them. For instance, a SysML "action" is defined as a feature the range of which specializes the predefined classifier Performance, and, consequently, also behavors/processes do have a model-theoretic semantics (and not an operational one).

Chapter 2. The Core Concepts

KerML's core layer essentially consists of the elements Type, Classifier, Feature and Specialization such that

  • Classifiers and features are types.
  • Types may have features (so, also features may have features).
  • A type T may specialize another type S. Then T is a subtype of S and S is a supertype of T. A subtype inherits all features of its supertypes.

These principles are described by the following meta-model:

???

Both Classifiers (like data types, classes and associations) and Features (like attributes, connectors and steps) are Types. A feature has a domain, called featuring type, and a range, called (featured) type.

The current KerML spec defines FeatureTyping as a form of specialization, as shown in the diagram above. Since this would imply that features specialize their range, this design choice of KerML seems questionable. See also the note below in Section 2.3.

2.1. Types

Types classify things in a modeled system. The set of things classified by a type is the extent of the type, each member of which is an instance of the type. Everything being modeled is an instance of the type Anything from the Base library.

KerML distinguishes between two kinds of types: classifiers and features.

Types are namespaces, enabling them to have members via membership relationships to other elements identified as their members.

Types can be declared to specialize, and to be disjoint from, other types:

type Mammal specializes Animal disjoint from Mineral;
disjoint Person::parents from Person::children;

The symbol :> can be used interchangeably with the keyword specializes.

Unioning, intersecting, and differencing are relationships between a type and a set of other types:

type Person unions Adult, Child;
type A intersects B, C;
type X differences Y, Z;

Differencing specifies that a type classifies everything that is classified by the first of the differenced types but not by any of the remaining types.

2.2. Classifiers

Classifiers are types that classify things in the modeled system, as distinct from features, which model the relations between them

Classifiers are typically declared together with a set of features:

classifier Person {
  feature name : String;
  feature age : Integer;
}

2.3. Features

Features are types that classify how things in a modeled system are related. A feature relates instances in the intersection of the extents of its featuring types (the domain) with instances in the intersection of the extents of its featured types (the co-domain). Instances in the domain of a feature are said to "have values" that are instances of the co-domain. [Note: an alternative, and preferable, term for 'co-domain' is range.]

Features are normally declared with a range (or co-domain) in the body of a type declaration, in which case the type is their domain, as in the following example where the classifier Person is both the domain and the range of the features parents, siblings, children and cousins:

classifier Person {
  feature parents[0..2] : Person;
  feature siblings[*] : Person;
  feature children[*] : Person inverse of parents;
  // a cousin is a child of a parent's sibling
  feature cousins[*] : Person chains parents.siblings.children;
} 

Notice that the features parents, siblings, children and cousins all have the multiplicity * ("many"), which means that they are multi-valued. By default, the multiplicity of a feature is 1, which means that the feature is mandatory and functional (or, in other words, single-valued), having exactly one value. When the value of a feature is a set of values from its range, the feature is non-functional and its multiplicity is either 0..* or n..* where n > 0. Instead of 0..*, which means "neither mandatory nor functional", we can simply write the asterisk symbol *.

A feature that is declared within the body of a type is an owned feature of that type, so it automatically has that type as a featuring type.

The feature cousins is declared by feature chaining to include, for a given person, all persons that are children of siblings of the parents of this person. The feature children is declared by feature inverting to be the inverse of the feature parents. That is, for each pair (p1, p2) in the extent of children, the pair (p2, p1) is in the extent of parents.

Features can also be declared at the package level independently of a type declaration:

feature name : String;
feature age : Integer featured by Person;

Here, the feature name is declared with the datatype String as its range, and since no explicit domain is declared, the implicit domain is the pre-defined classifier Anything (from the Base library), while the feature age is declared to have the explicit domain Person, as expressed by the clause featured by Person. A package-level feature is always referential and is semantically featured by the base type Anything (which means that a value for it is available within any instance of any type). However, it is not syntactically an "owned" feature of Anything, since it is, by definition, owned by a package. That means that it has no "featuring types".

Type featuring, which can be declared with the keywords featured by, is a relationship between a feature and a type, where the type is a featuring type of the feature. Feature membership is a kind of type featuring that also makes the feature an owned member of the featuring type.

Feature typing is a relationship between a feature and a type that identifies the type as a featured type of the feature, as expressed by the colon in between the feature name "age" and the datatype name "Integer" or, equivalently, by the clause typed by in the following example:

feature age typed by Integer featured by Person;

According to the current semantics of KerML, feature typing is a certain form of specialization, which has the non-intuitive implication that a feature specializes its range. For instance, the feature age declared in the code example above would specialize its range Integer and, consequently, any pairs from the extent of age, like (Tom, 37), would be instances of the datatype Integer, in addition to the "basic instances" representing integers, which is quite strange.

Features may have certain type-level properties such as being unique, ordered, composite, derived, read-only or directed, as shown in the following meta-model fragment:

???

Notice that the concept of a directed feature (of a Behavior) replaces the UML concept of an operation parameter.

Except for isComposite, all other meta-properties only seem to apply to structural features, also called properties.

Property Value Relationships

A property value relationship (called "feature value" in the spec) is a special kind of binding connector, binding a (possibly initial or default) value to a property.

An example of a bound (as opposed to initial) property value relationship, stating that a property's value is always obtained as the result of the value expression, and in this sense derived is shown in the following example:

classifier TestRecord {
  feature scores[1..*] : Integer;
  derived feature averageScore : Rational = sum(scores)/size(scores);
}

An example of an initial property value relationship, stating that a property's initial value is obtained as the result of the value expression (but may be changed subsequently):

feature count : Natural := 0;

An example of a bound property default value relationship:

feature cutoff : Integer default 0.75 * averageScore;

An example of an initial property default value relationship:

feature engine : Engine default := standardEngine;

These different forms of property value relationships combine the definition of a property (structural feature) with different forms of bindings.

Ordered Sets and Multi-Sets (Bags) as Values of Multi-Valued Features

A multi-valued feature declaration can include either or both of the keywords ordered and nonunique (in either order). For instance, we can declare that the value of a multi-valued feature spouses is a sequence of persons in the following way:

classifier Person {
  feature spouses[*] : Person nonunique ordered;
}

If a feature is ordered, then for any domain instance, the values of the feature can be placed in order, indexed from 1 to the number of values. The default is that the feature is unordered.

If a feature is non-unique, then, for any domain instance, the same range instance may appear more than once as a value of the feature. The default is that the feature is unique.

Subsetting and Redefinition as Special Forms of Specialization

There are also several forms of specialization that apply specifically to features.

  1. Subsetting is a relationship between a specific feature (the subsetting feature) and a more general feature (the subsetted feature), where the specific feature may further constrain the featuring types, featured types and multiplicity of the general feature.
  2. Redefinition is a kind of subsetting in which the specific feature (the redefining feature) also replaces an otherwise inherited general feature (the redefined feature) in the context of the owning type of the specific feature.

The symbols :> and :>> can be used interchangeably with the keywords subsets and redefines, respectively.

An example of subsetting is the following:

classifier Wheel;
classifier DriveWheel specializes Wheel;
classifier Automobile {
  composite feature wheels[4] : Wheel;
  // Restricts multiplicity and type
  composite feature driveWheels[2] : DriveWheel subsets wheels;
}

An example of redefinition is the following:

classifier WheeledVehicle {
  composite feature wheels[1..*] : Wheel;
}
classifier MotorizedVehicle specializes WheeledVehicle {
  composite feature redefines wheels[2..4];
}

In this example, the effective name of the redefining feature is "wheels", which is the same name as the redefined feature.

2.4. Open Questions

1 Why Should a Feature Specialize Its Range?

TBD

A usage inherits the features from its definition in the same way that a specialized definition inherits from a more general definition element. For example, if a part usage vehicle is defined by a part definition Vehicle, and Vehicle has a mass defined by MassValue, then vehicle inherits the feature mass. In some cases, a usage may have more than one definition element, in which case the usage inherits the features from each of its definition elements, with the same rules for conflicting names as described above for subclassification. [SysML 7.6.1]

2 Questionable example models in the spec

Can a (continuous) mass noun like "fuel" be modeled as a class(ifier) as in the following example (from 7.3.4.2 Feature Declaration)?

classifier Fuel {
  portion feature fuelPortion : Fuel;
}
classifier Tank {
  in feature fuelFlow: Fuel;
  composite feature fuel : Fuel;
}

What are the instances of Fuel? Another question concerns the modeling of fuel flow in the Tank classifier declaration: isn't a fuel flow a fuel quantity per unit of time, and not a fuel quantity?

Another example is the following (from the "SysML v2 Intro Textual Notation" slides):

part def Vehicle {
  attribute mass : Real;
  ref item driver : Person;
  part fuelTank {
    item fuel: Fuel;
  }
}

Here, again, the question is how is Fuel modeled? As a class? There is a comment on the slide that "Items may also model continuous materials that are stored in and/or flow between parts of a system." However, the term "item" is commonly understood as referring to countable things.

3 What are good examples of portion features?

Portion features are composite features where the values cannot exist without the whole, because they are the “same thing” as the whole. (For example, the portion of a person's life when they are a child cannot be added or removed from that person's life.)

Are the following good examples of portion features?

// from 7.3.4.2 of KerML
classifier Fuel {
  portion feature fuelPortion : Fuel;
}
classifier Person {
  portion feature childhood : Child;
}

Chapter 3. Formal Semantics

The Core Layer grounds KerML semantics by interpreting it using mathematical logic. However, additional semantics are then specified through the relationship of Kernel abstract syntax constructs to model elements in the Kernel Semantic Library, which is written in KerML itself. Models expressed in KerML thus essentially reuse elements of the Semantic Library to give them semantics. The Semantic Library models give the basic conditions for the conformance of modeled things to the model, which are then augmented in the user model as appropriate. (from 6.1)

The following paragraphs are taken from the conference paper An Analysis of the Semantic Foundation of KerML and SysML v2, Proceedings of The 43rd International Conference on Conceptual Modeling (ER 2024).

A formal semantics, in the spirit of Tarski’s model-theoretic semantics for predicate logic, is only defined for the KerML Core layer. It refers to a vocabulary provided by the names of the classifiers and features defined as types in a KerML model. A feature is informally defined as “a Type that classifies relations between multiple things (in the universe)”. According to the specification, “KerML semantics are based on classification: a model has elements that classify things in the modeled system.”

According to the KerML semantics, an interpretation of a Core vocabulary is a quadruple ⟨ Δ, P, S, I ⟩ consisting of

  1. A universe Δ containing “all actual and potential things the vocabulary could possibly be about” (or, more specifically, data values, objects, and performances).
  2. A strict partially ordered set P called marking set.
  3. A set of sequences S including all unary sequences (consisting of a single element of the universe) and all alternating sequences like (d1, p1, d2), (d1, p1, d2, p2, d3), . . ., where di ∈ Δ and piP.
  4. An interpretation function I that maps each classifier and feature name of the vocabulary to a subset of S.

Consider the following KerML model defining the classifiers Car and Person, as well as the features driver and mainEngine.

classifier Person;
classifier Engine;
classifier Car {
  feature driver[0..1] : Person;
  composite feature mainEngine : Engine;
}

Imagine a situation with two persons (John and Mary), two cars (car1 and car2) and two engines (e1 and e1) such that car1 is driven by John, car2 does not have a driver, Mary is not driving any car, car1 has e1 as its main engine, and car2 has e2. Then, sequences like (john), (mary), (car1), (car2), (e1), (e2), (car1, p1, john), (car1, p2, e1), (car2, p3, e2) would be required in the set of sequences for the interpretation of Car, Person, driver and mainEngine.

The marking elements p1, p2, p3, etc. separate elements of the universe in sequences like (car1, p1, john) and are used to account for features that are non-unique or ordered. For non-unique features, the same pair of elements is separated with different markings, and hence the collection of entities in the feature's range for a particular entity of the domain can be conceived as a bag (or multiset). For ordered features, the markings used form a total order, such that the collection of entities in the feature's range for a particular entity of the domain can be conceived as a sequence.

The semantics is defined in such a way that an interpretation function for our example would map Car to {(car1), (car2)}, driver to {(car1, p1, john)}, mainEngine to {(car1, p2, e1), (car2, p3, e2)} and Person to {(john), (mary), (car1, p1, john)} and Engine to {(e1), (e2), (car1, p2, e1), (car2, p3, e2)}. Note that all sequences in the interpretation of a feature are also included in the interpretation of its range (or co-domain), therefore, all sequences ending with a person, like (car1, p1, john), are included in the interpretation of Person, and all those ending with an engine, like {(car1, p2, e1), (car2, p3, e2)}, are included in the interpretation of Engine.

The core semantics provides rules to interpret: the predefined top-level classifier Anything, which is present in all models and subsumes all other classifiers in the model, and the predefined top-level feature things, also present in all models, subsuming all other features; specialization between types; disjoining between types, when the interpretation of two types has no intersection; feature typing, where a feature is given a ‘featuring type’ corresponding to its domain, and a ‘featured type’, corresponding to its range; feature redefinition, multiplicity, uniqueness, ordering, inverting and chaining.

3.1. A Standard Model-Theoretic Semantics of Simple KerML Models

KerML's official semantics departs from the standard model-theoretic semantics for logic-based modeling languages (such as OWL and Alloy), as well as from formalizations of UML class models and ER models in the following way:

  1. Since KerML allows features to have features, features cannot be interpreted (like classical properties or binary predicates) as binary relations over the universe U (or subsets of U × U).
  2. Due to KerML's peculiar Feature Typing concept, the interpretation/extent of a classifier C includes the interpretations/extents of all features having C as their range, implying that classifiers can no longer be interpreted as subsets of U.
  3. Since KerML allows features to have non-unique and ordered collections (multisets and sequences) as values, the interpretations of a KerML model also include a marking set and the set of all sequences formed with elements of U and of the marking set.

As a consequence, KerML's official semantics has lost much of the intuitive and philosophical appeal of standard model-theoretic semantics.

We present a standard model-theoretic semantics of a fragment of KerML, called Simple KerML Models, which do neither allow features to have features nor non-unique/ordered value collections.

For readability, we prefer using the terms object type instead of "structure", action type instead of "behavior", and action instead of "performance". We also call a structural feature a property, a data-valued property an attribute, and a behavioral feature an action step.

While the classical model-theoretic semantics of predicate logic does not make any ontological distinctions among the elements of the universe, the model-theoretic semantics of OWL partitions the universe into data values and objects, whereas the model-theoretic semantics of KerML partitions the universe into data values, objects and actions.

We define a Simple KerML model as a KerML model that only defines

  1. data types, object types and action types as classifiers;
  2. features for classifiers, but not for features;
  3. features with plain value sets.

The following is an example of a Simple KerML model defining the action types BookRoom, CheckIn, Charge, CheckOut and RentHotelRoom, as well as the object types Room and Hotel, such that the action type RentHotelRoom has four action steps, the object type Room has one attribute and the object type Hotel has two attributes and one action step:

behavior BookRoom;
behavior CheckIn;
behavior Charge;
behavior CheckOut;
behavior RentHotelRoom {
  step bookRoom[1] : BookRoom;
  step checkIn[0..1] : CheckIn;
  step charge[1] : Charge;
  step checkOut[0..1] : CheckOut;
}
struct Room {
  feature roomNumber: Natural;
}
struct Hotel {
  feature name: String;
  feature rooms[1..*]: Room;
  step rentHotelRoom[*] : RentHotelRoom;
}

An action step (as an action-valued feature) defined for an object type, such as Hotel::rentHotelRoom, may express the fact that objects of that type can perform actions of the type defined for the step, such as hotels performing rentHotelRoom actions.

The KerML concept of multiplicities is semantically ambiguous: do they refer to history or to snapshot populations?

It has also been raised as an issue for KerML by Conrad Bock [KERML-306].

In the following section, we define a more concise mathematical representation of Simple KerML models as 12-tuples.

Simple KerML Models

A Simple KerML (SK) model defines a vocabulary consisting of the names of classifiers (data types, object types or action types) and classifier features, corresponding to the vocabulary of a predicate logical language consisting of names of constants, functions and predicates. Data literals correspond to constants, classifiers correspond to unary predicates, and classifier features correspond to unary functions (or binary predicates).

For Simple KerML models, we simplify the representation of the start and end times of occurrences by including two corresponding attributes in the definition of the predefined classifier Occurrence. In KerML, all occurrences have a startShot and an endShot, which are special zero-duration suboccurrences, whose occurrence time can be obtained by invoking the library function TimeOf. Consequently, the start time of an occurrence o is TimeOf( o.startShot ), and its end time is TimeOf( o.endShot ).

According to the KerML spec, all occurrences have an endShot, which raises the question, if KerML does not support ongoing occurrences with a moving time horizon?

It has also been raised as an issue for KerML by Conrad Bock [KERML-306].

An SK model, based on a set of predefined classifiers, is a 12-tuple

DT, OT, AT, Cl, ownF, feat, rng, muls, mulh, sup, CInv, GInv

Figure 3-1. Predefined classifiers of Simple KerML Models
???

specifying:

  1. The pairwise disjoint finite sets of names of (predefined and user-defined) data types DT, object types OT and action types AT, which merged together form the set of classifier names Cl, such that, by definition, each of them contains the predefined name of a most general type/classifier: DataValueDT, ObjectOT, ActionAT and { Occurrence, Anything } ⊆ Cl.
  2. A function ownF for assigning a set of local names of its owned features to a classifier name C. The function feat is obtained by extending ownF such that subclassifiers inherit the (onwed and inherited) features of their superclassifiers. Full feature names have the form C::f where f ∈ feat(C).
  3. A function rng for assigning a range (or co-domain) to any feature C::f with rng(C::f) ∈ Cl.
  4. A function muls for assigning snapshot multiplicities to features.
  5. A function mulh for assigning history multiplicities to features of occurrence types.
  6. A function sup for assigning direct superclassifiers to classifiers CCl, such that

    1. Anything ∈ sup*(C), where sup* is the transitive closure of sup,
    2. if CDT, then sup(C) ⊆ DT and DataValue ∈ sup*(C),
    3. if COT, then sup(C) ⊆ OT and { Object, Occurrence } ⊆ sup*(C),
    4. if CAT, then sup(C) ⊆ AT and { Action, Occurrence } ⊆ sup*(C),
    5. if C' ∈ sup(C), then feat(C') ⊆ feat(C).
  7. A set of classifier invariants CInvar, which are ordered pairs of a classifier C and a logical formula F(x) with one free variable x, stating that F(i) holds for all instances i from the extent of C.
  8. A set of global invariants GInvar, which are logical sentences (formulas without free variables).

Interpretations

While data values are ahistoric (they exist independently of time), all occurrences (objects and actions) have either been existing for some time in the past and possibly still exist, or exist at present. Occurrences remain in the history (of a modeled system) once they have ceased to "exist". Local universes of discourse (at certain points in time) include not only the present occurrences but all past occurrences as well; they increase as time progresses and new occurrences come into being (see also the discussion of constant versus varying domain semantics in [1]).

An interpretation of an SK model is an octuple

I = ⟨ ⟨Time, <⟩, ct, DV, Obj, Act, Occ, U, It

such that

  1. Time, <⟩ is a linear order of time instants and ctTime is the current time. We write Timect for the set { tTime : tct }.
  2. DV is a time-independent (ahistoric) set of data values, which includes strings and numbers.
  3. Obj: Timect → 2Objct and Act: Timect → 2Actct are functions that assign finite sets of objects Objt and actions Actt to any time instant tct such that DV, Objt and Actt are pairwise disjoint. These sets are expanding in time: for all t, t'ct, if t < t', then ObjtObjt' and ActtActt'.
  4. Likewise, Occ: Timect → 2Occct and U: Timect → 2Uct are functions that assign a set of occurrences Occt and things Ut to any time instant tct such that Occt = ObjtActt and Ut = DVOcct.
  5. It is a time-indexed interpretation function such that for all time instants t, t'ct:

    1. It(Anything) = Ut and It(Occurrence) = Occt.
    2. It(D) = It'(D) ⊆ DV for all DDT, and It(DataValue) = DV.
    3. It(O) ⊆ Objt for all OOT, and It(Object) = Objt.
    4. It(A) ⊆ Actt for all AAT, and It(Action) = Actt.
    5. A feature C::f with muls(C::f) = ⟨ ls, us ⟩ and rng(C::f) = R is interpreted as a function It(C::f) : It(C) → 2It(R) such that for any xIt(C) and its feature value set val = It(C::f)(x), card(val) ≥ ls and, if us≠ ∗, card(val) ≤ us, and

      1. if C is a data type, the feature interpretation function It(C::f) is ahistoric: It(C::f) = It'(C::f),
      2. if C is an occurrence type, then the feature has either an explicitly asserted history multiplicity mulh(C::f) = ⟨ lh, uh ⟩ or an implied (default) history multiplicity mulh(C::f) = ⟨ 0, * ⟩, and for any oIct(C) and c = card Ui≤ct Ii(C::f)(o), clh, and if uh≠ ∗, then cuh,
      3. the predefined occurrence type features startTime and endTime are interpreted according to their intended semantics: for any occurrence o, st = It(startTime)(o) ≤ ct and if o has an end time et = It(endTime)(o), then stetct.
    6. The interpretation of classifiers respects their specialization hierarchy: for any classifier CCl and any of its supertypes C' ∈ sup(C), It(C)It(C').
    7. The interpretation satisfies all constraints of the model:
      1. for all classifier invariants ⟨C, F(x)⟩ ∈ CInvar, IF(a) for all aC,
      2. for all global invariants SGInvar, IS.

An interpretation I, together with a variable value assignment v : VarUct for a finite set of variables Var, allows to interpret expressions. For instance, for expressions of the form x.f where x is an occurrence variable and f is a feature name:

Itv(x.f) = It(C::f)(v(x)) where v(x) ∈ C and f ∈ feat(C)

Whenever the range of a feature C::f is an occurrence type C', we can interpret expressions of the form x.f1.f2 where f1 ∈ feat(C) and f2 ∈ feat(C'), which are called path expressions. The resulting value set Itv(x.f1.f2) is obtained by merging the value sets It(C::f2)(p) for all pIt(C::f1)(v(x)). In this way, we can interpret path expressions of any length greater than zero.

Satisfaction of Logical Formulas

Finally, we can define how a variable-assignment-enhanced interpretation Itv satisfies a logical formula F formed with atomic formulas that are composed with the help of the usual logical operators. The base case of atomic formulas includes the following three forms:

  1. Classification atoms have the form C(x) where C is a classifier. They are satisfied by Itv if and only if v(x) ∈ It(C). Symbolically,

    ItvC(x) iff v(x) ∈ It(C).

  2. Comparison atoms have the form expr1 # expr2 where each exprk is either a data literal (from one of the underlying datatypes), a variable, or a path expression, and # is one of the comparison predicates (=, ≠, <, ≤, >, ≥).

    Itvexpr1 # expr2 iff Itv(expr1) It(#) Itv(expr2),

    where It(#) is the interpretation of the comparison predicate #.

Complex logical formulas formed with the logical operators ¬, ∧, ∨, →, ∀, ∃ are satisfied by a variable-assignment-enhanced interpretation in the usual way.

When a logical sentence (variable-free formula) S is satisfied by an interpretation at a time instant tTime, we write ItS. When it is satisfied at all time instants tct, we write IS.

Entailment

An SK model M entails a logical sentence if the sentence is satisfied by all interpretations of the model:

MS iff IS for all interpretations I of M.

Integrity Constraints

Integrity constraints, as elements of a KerML model, are logical sentences that have to be satisfied by the interpretations of the model. A KerML model may, for instance, define the following types of (integrity) constraints for a classifier:

Range Constraints

require that a feature must have a value from the value space of the type that has been defined as its range. For instance, a value of an attribute declared as feature age : Integer must be an integer. These (implicit) constraints are expressed in a model by specifying a range for the features concerned.

Mandatory Value Constraints

require that a feature must have a value. These constraints are expressed in a model with the help of a feature multiplicity that has a lower bound greater than 0. Notice that the default multiplicity of a feature is 1, implying that it is mandatory and single-valued.

Cardinality Constraints

apply to multi-valued features, only, and can require that the cardinality of a feature's value set is not less than a given minimum cardinality or not greater than a given maximum cardinality, as expressed by the feature's multiplicity.

In addition, there are further types of classifier constraints that only refer to a specific attribute and, therefore, could be expressed within the declaration of the attribute concerned:

Uniqueness Constraints (also called 'Key Constraints')

require that the value of an attribute C::a is unique among all instances of its domain: F(x) ≡ ∀y: C(y) → x.a ≠ y.a. Notice that this is different from declaring a feature to be unique, which requires its value collection to contain no duplicates.

Interval Constraints

require that the value of a numeric attribute a must be in a specific interval [min,max]: F(x) ≡ min ≤ x.ax.a ≤ max.

Pattern Constraints

require that a string attribute's value must match a certain pattern defined by a regular expression. They allow defining special string data types such as for URLs, email addresses or telephone numbers.

These classifier invariants could be expressed in the simplified way of an annotation appended to the attribute declaration. For instance, UML allows expressing uniqueness constraints with the help of the annotation (property modifier) keyword "key", while it also allows expressing standard identifier (or 'primary key') constraints with the help of the attribute annotation keyword "id" (implying that the attribute is unique and mandatory, and that its values are used as standard identifiers).

An interval constraint could be expressed with the attribute annotation keywords "min" and "max" together with corresponding numbers, while a pattern constraint could be expressed with the attribute annotation keyword "pattern" together with a regular expression.

References

[1] First-order temporal logics, a section of the article "Temporal Logic" by Valentin Goranko and Antje Rumberg, 2024, in Stanford Encyclopedia of Philosophy.

Chapter 4. Modeling the State Structure of a System

KerML's Kernel layer essentially consists of the modeling concepts DataTypes, Classes, Associations, Structures, Behaviors, Connectors, and Steps, as shown in the following diagram.

Figure 4-1. The main elements of the Kernel layer.
???

In KerML, "Classes" are occurrence types subsuming both "Structures" (or object types) and "Behaviors" (or action types). The instances of Classes are not objects, but occurrences (things that happen over time). Objects are instances of Structures.

The state structure of a system is captured by modeling all types of objects the system consists of. This also includes modeling the features (mainly attributes, component properties and connectors) of object types and the associations between them.

4.1. Data Types

Data types are classifiers that classify data values, which are abstract things that do not exist in time or space.

datatype IdNumber specializes ScalarValues::Integer;

If a data type has features, their values cannot change over time, because different feature values would inherently identify a different data value.

datatype SensorReading {
  feature sensorId : IdNumber;
  feature value : ScalarValues::Real;
}

The KerML library Base includes the predefined data type DataValue, which is the most general data type in the sense that every other data type is a subtype of it. A Kernel-layer data type declaration made with the keyword "datatype" like the following one:

datatype URL;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined data type DataValue:

classifier URL specializes DataValue;

4.2. Occurrence Types ("Classes")

In KerML, Classes are occurrence types:

Classes are classifiers that classify occurrences, which happen in time (and space). Relations between an occurrence and other things can change over time and space, while the occurrence still maintains its identity.

KerML defines two kinds of occurrence types: "Structures" (better called object types) and Behaviors (better called action types). However, the specification does not explain if these occurrence types classify only completed occurrences or both completed and ongoing occurrences.

The KerML library Occurrences includes the predefined Class Occurrence, which is the most general Class in the sense that every other Class is a subtype of it. A Kernel-layer Class declaration made with the keyword "class" like the following one:

class ArrivalEvent;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined Class Occurrence:

classifier ArrivalEvent specializes Occurrence;

4.3. Object Types ("Structures")

In KerML, objects are considered as occurrences (happening over time like processes) and object types are called "Structures", while action types are called "Behaviors":

Structures are Classes that classify objects, which are kinds of occurrences. Structures and Behaviors do not overlap, but Structures can own Behaviors, and the objects they classify can be involved in Behaviors (e.g., they can perform Behaviors).

An example of an object type declaration:

struct Sensor { 
  feature id : IdNumber;
  feature currentReading : Real;
  step updateReading { ... }  // a behavioral feature
}

The KerML library Objects includes the predefined classifier Object, which is the most general object type in the sense that every other object type is a subtype of it. A KerML Structure declaration like the following one:

struct Car;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined object type Object:

classifier Car specializes Object;

4.4. Associations

What is called an association between two (or more) related types in UML and SysML, corresponds to the mathematical concept of a relation as a subset of the Cartesian product of the related types. The instances of an association, called links, represent relationships between individuals and correspond to the tuples of a relation.

The following UML class diagram shows an example of an explicit many-to-many association Ownership that is specialized by a one-to-many association SoleOwnership:

???

Notice how the Ownership association end owners with multiplicity * ("many") is redefined by the SoleOwnership association end owner with multiplicity 0..1 ("at most one"), expressing the fact that any asset is linked to zero or many legal entities as its owners while it is linked to at most one legal entity as its sole owner.

An association between two types represents a function (in the sense of mathematics) if it has a functional (single-valued) association end. An overview about the different cases of functionality of an association is provided in the following table:

Functionality typeMeaning
one-to-oneboth functional and inverse functional
many-to-onefunctional
one-to-manyinverse functional
many-to-manyneither functional nor inverse functional

The following tables show an example snapshot population of the classifiers involved in the model shown in the diagram above:

LegalEntity
idname
le1Trump
le2Acme Corp
le3Oscorp
Asset
idname
a1Mar-a-Lago
a2Oscorp Tower
a3Rolls-Royce Phantom
Ownership
ownerownedAsset
le1a1
le2a2
le1a3
le3a2
SoleOwnership
ownerownedAsset
le1a1
le1a3

In the KerML spec, associations are characterized as follows:

Associations are classifiers that classify links between things. At least two owned features of an association must be end features representing its association ends, which identify the things being linked by (at the "ends" of) each link (exactly one thing per end, which might be the same thing). Associations with exactly two association ends are called binary associations. The end features of an association identify the participants in the links that are instances of the association and must have multiplicity 1. Associations can also have features that are not end features, which characterize each instance of the association separately from the things it links.

An association is also a relationship between the types of its association ends, called its related types, which might be the same. Links are between instances of an association's related types. For binary associations, the two related types are identified as the source type and the target type. For associations with more than two association ends (called "n-ary" associations), the first related type is the source type and all the remaining related types are target types.

In the following class diagram, the two UML associations Ownership and SoleOwnership from the class diagram above have been turned into KerML associations as link classifiers with the two ends owner and ownedAsset as their properties (or end features), such that their instances are (owner, ownedAsset) value pairs corresponding to binary links.

???

Notice that the end properties of KerML associations, here: owner and ownedAsset, since they are always single-valued, have the multiplicity 1. Notice also how the corresponding multiplicities of the original class diagram above, which are now marked in yellow, have moved to the UML association ends at the new KerML association classes. These association ends are called cross features in KerML. For instance, * is the cross multiplicity of Ownership::owner, while 0..1 is the cross multiplicity of SoleOwnership::owner.

Consider a binary association A with end properties e1 typed by E1 and e2 typed by E2. The cross multiplicity of e1 allows expressing how many A links may, or have to, exist for any instance of E2.

The model shown in the class diagram above can be expressed in KerML in the following way:

classifier LegalEntity {...}
classifier Asset {...}
assoc Ownership {
  end [*] feature owner : LegalEntity;
  end [*] feature ownedAsset : Asset;
}
assoc SoleOwnership specializes Ownership {
  end [0..1] feature redefines owner;
}

The multiplicities specified between the keywords "end" and "feature", like [*] and [0..1] in the example above, represent the cross multiplicities of the KerML association's end properties. The cross multiplicity [*] of Ownership::owner (and Ownership::ownedAsset) expresses the fact that for any instance of LegalEntity (and Asset), there are zero or more Ownership links. The cross multiplicity [0..1] of SoleOwnership::owner expresses the fact that for any instance of Asset, there is at most one SoleOwnership link. The default cross multiplicity is [*], which means that, by default, there are no cardinality constraints.

Notice that the names of the end features of a KerML association declaration should be singular noun phrases since they are always single-valued, that is, they reference exactly one individual.

The keyword feature, as well as the default cross multiplicity [*], may be omitted from an association end declaration:

assoc Ownership {
  end owner : LegalEntity;
  end ownedAsset : Asset;
}

The KerML library Links includes the predefined association Link, which is the most general association in the sense that every other association is a subtype of it. A Kernel-layer association declaration made with the keyword "assoc" like the following one:

assoc Employment;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined association Link:

classifier Employment specializes Link;

Implicit Associations Expressed by Reference Properties

A referential feature that has classes (representing occurrence types) as its domain and range establishes an implicit binary association between its domain and range. Such a feature may also be called a reference property. In the following example, the reference property ownedAssets establishes an implicit binary association between LegalEntity and Asset.

class LegalEntity {
  feature id : String;
  feature name : String;
  feature ownedAssets[*] : Asset;
}
class Asset
  feature id : String;
  feature name : String;
}

In this example, the implicit association is represented in a unidirectional way with references from LegalEntity to Asset but not vice versa. However, an implicit association can also be represented in a bidirectional way by declaring a pair of mutually inverse reference properties like so:

class LegalEntity {
  feature id : String;
  feature name : String;
  feature ownedAssets[*] : Asset;
}
class Asset
  feature id : String;
  feature name : String;
  feature owners[*] : LegalEntity inverse of LegalEntity::ownedAssets;
}

Notice that without declaring one of the two features ownedAssets and owners to be the inverse of the other, they would formally not represent the same association in a bidirectional way, but rather two different unidirectional associations.

Association Structures

Association Structures are both Associations and Structures, classifying link objects, which are both links and objects. As objects, link objects can be created and destroyed, and their non-end features can change over time. However, the values of the end features of a link object are fixed and cannot change over its lifetime (that is, they are effectively read only).

Example:

assoc struct ExtendedOwnership specializes Ownership {
  feature revaluations[*] ordered : MonetaryValue;
}

The KerML library Objects includes the predefined Association Structure LinkObject, which is the most general Association Structure in the sense that every other Association Structure is a subtype of it. A Kernel-layer Association Structure declaration made with the keyword "assoc struct" like the following one:

assoc struct Employment;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined Association Structure LinkObject:

classifier Employment specializes LinkObject;

4.5. Connectors and Bindings

Connectors are features that are typed by associations, having values that are links. Like an association, a connector has end features, known as its connector ends. Each connector end redefines an association end from each of the associations that type the connector and subsets a feature that becomes a related feature of the connector. Connectors typed by binary associations are called binary connectors.

A connector is also a relationship between its related features. For binary connectors, the two related features are identified as the source feature and the target feature, which might be the same.

These principles are described by the following meta-model, which redefines the range of a Connector feature to be an association:

???

Notice that, in addition to regular connectors, there are also two special kinds of connectors:

  1. binding connectors for binding the value of one feature to the value of another feature;
  2. successions for temporally sequencing behavior steps.

In the following example, a Mounting association between the object types Axle and Wheel classifies links between an axle and a wheel, such that an axle is linked to two wheels, as shown in the following class diagram and the corresponding KerML code.

???

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

struct Axle {...}
struct Wheel {...}
assoc Mounting {
  end [1] mountingAxle : Axle;
  end [2] mountedWheel : Wheel;
}

The corresponding connector property mount of the object type WheelAssembly has exactly two values, namely one mountingAxle-mountedWheel link for each of the two wheels of a wheel assembly mounted to the same axle:

struct WheelAssembly {
  composite feature axle : Axle;
  composite feature wheels[2] : Wheel;
  connector mount[2] : Mounting {
    end mountingAxle references axle;
    end mountedWheel references wheels;
  }
}

Notice that the related features referenced by connector ends are specified using the keyword references, denoting a special form of subsetting.

Connectors can be thought of as "instance-specific" associations, because their values (which are links) are each limited to linking things identified via related features on the same instance of the connector's domain.

Any value a connector (such as mount) is a link instantiating its typing association (Mounting), for which the participants are values of the related features (axle and wheels) of the connector.

Instead of explicitly declaring connector ends in the body of a connector, they can also simply be listed between parentheses, in which case the connector ends are matched in order to corresponding association ends:

struct WheelAssembly {
  composite feature axle : Axle;
  composite feature wheels[2] : Wheel;
  connector mount[2] : Mounting (axle, wheels);
}

A special notation can be used for a binary connector, in which the source-related feature is referenced after the keyword from, and the target-related feature is referenced after the keyword to:

struct WheelAssembly {
  composite feature axle : Axle;
  composite feature wheels[2] : Wheel;
  connector mount[2] : Mounting from axle to wheels;
}

KerML allows using an even simpler syntax for defining such a connector:

struct HalfAxleAssembly {
  composite feature halfAxle : HalfAxle;
  composite feature wheel : Wheel;
  connector halfAxle to wheel;
}

However, since this simplified syntax for defining binary connectors does not specify a name nor an underlying association, it is implied that a connector defined in this way is single-valued and typed by the most general binary association BinaryLink, which is predefined in the library Links.

Connector ends may also be declared with cross multiplicities. In this case, the given cross multiplicity redefines the cross multiplicity that would otherwise be inherited from the association end corresponding to the connector end.

Bindings

Binding connectors (or simply bindings) are single-valued binary connectors that require their source and target features to have the same values on each instance of their domain. Unlike for a regular single-valued binary connector, the value of a binding is not a link object (an occurrence in space and time), but rather a (kind of abstract) binary link, typically between an output and an input feature. A binding is implicitly typed by the library association SelfLink, which links things in the modeled universe to themselves.

A binding connector is declared using the keyword binding by specifying a binding equation, as in the following example:

struct Vehicle {
  composite feature fuelTank {
   out feature fuelFlowOut : Fuel;
  }
  composite feature engine {
    in feature fuelFlowIn : Fuel;
  }
  binding fuelFlowBinding of fuelTank.fuelFlowOut = engine.fuelFlowIn;
}

If no name is needed, the declaration of a binding connector can be simplified by just specifying the binding equation, like so:

  binding fuelTank.fuelFlowOut = engine.fuelFlowIn;

4.6. Questions

1 Unnamed connector example

In section 7.4.6.2 Connector Declaration, there is the following example containing an unnamed binary connector declaration:

struct WheelAssembly {
  composite feature axle[1] : Axle;
  composite feature wheels[2] : Wheel;
  connector axle to wheels;
}

How is an unnamed connector used (e.g., in a path expression)? Doesn't the example specify a single connection only between one of the two wheels and the axle?

Chapter 5. Modeling the Dynamics of a System

In general, the dynamics of a system can be captured by modeling the types of events and processes (including actions and activities), occurring in the system. However, SysrML2 does neither include an explicit concept of events (and event types), nor of processes (and process types). Rather, it sticks to the UML behavior modeling concepts of "actions" and "states".

Regarding the ontological semantics of SysML2's concept of "actions", it seems that it is supposed to subsume also event types and process types. This interpretation is based on the fact that the SysML spec (in Section 7.9.1) is using the term "event" for special occurrences involving performer objects, such as sending or receiving messages.

Ontologically, events may be (1) instantaneous or have a duration, (2) atomic or composite, while activities are special processes, and we have to distinguish between ongoing and completed processes, see (Guarino and Guizzardi 2024). Only completed activities and processes correspond to events, since events are always in the past. However, while this ontological distinction is important for ontology-driven conceptual domain modeling, we may, for simplicity, choose using overloaded concepts of activity/process types as event types, possibly subsuming both completed and ongoing processes, for systems modeling.

5.1. Behaviors, Steps and Successions

In KerML, the actions of a system are considered as performances of the system's "behaviors" and their types are called "Behaviors":

Behaviors are classes that classify performances, which are kinds of occurrences that can be spread out in disconnected portions of space and time. The performance of behaviors can cause effects on other things, including their existence and relations, some of which might be accepted as input to or provided as output from the behavior.

Behaviors can have steps, which are features typed by behaviors, allowing the containing behavior to coordinate the performance of other behaviors. Steps can be ordered in time using succession connectors. They can also be connected by item flows to model things flowing between the output of one step and the input of another. Steps can also nest other steps to augment or redefine steps inherited from their behavior types.

Features declared in the body of a behavior with a direction are considered to be the owned parameters of the behavior. Features with direction in are input parameters, those with direction out are output parameters, and those with direction inout are both input and output parameters.

The following example models a behavior with three action steps:

behavior Focus { in scene: Scene; out image: Image; }
behavior Shoot { in image: Image; out picture: Picture; }
behavior TakePicture {
  in scene : Scene;
  out picture : Picture;
  binding focus.scene = scene;
  step focus : Focus;
  succession focus then shoot;
  flow focus.image to shoot.image;
  step shoot : Shoot;
  binding picture = shoot.picture;
  step takePictureWithAutoFocus : TakePicture {
    in feature unfocusedScene redefines scene;
    step redefines focus : AutoFocus;
    out feature focusedPicture redefines picture;
  }
}

As shown in the example above, a step can have substeps declared in its body.

Notice that a step is a 'composite' feature: since for each performance of its owning behavior, its performance must happen during that performance, so it must end before, or at the same time when, the performance of their owning behavior ends. The same reasoning applies to the behavior connector concepts of bindings, successions and item flows: their link occurrences must also happen during the performance of their owning behavior.

The KerML library Performances includes the predefined Behavior Performance, which is the most general Behavior in the sense that every other Behavior is a subtype of it. A Kernel-layer Behavior declaration made with the keyword "behavior" like the following one:

behavior Drive;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined Behavior Performance:

classifier Drive specializes Performance;

Successions of Action Steps

A succession is a special type of connector that can be used for connecting successive action steps of a behavior. It is declared using the keyword succession together with the keywords first and then, as in the following example:

behavior TakePicture {
  step focus : Focus;
  step shoot : Shoot;
  succession controlFlow first focus then shoot;
}

Successions are single-valued binary connectors that require their source and target features to be behavioral. Unlike a regular connector instance, a succession instance is not a link object (an occurrence in space and time), but rather a kind of abstract binary link.

Normally, a succession is not explicitly typed by an association, which semantically implies that it is typed by the HappensBefore association that is predefined in the Occurrences library.

Successions between steps require the occurrence values of steps to be ordered in time such that for any occurrence of a behavior composed of two steps in succession, the first step suboccurrence happens before the then step suboccurrence.

The declaration of a succession can be simplified by omitting its name, like so:

  first focus then shoot;

As for connector ends on regular connectors, constraining multiplicities can also be defined for the connector ends of successions, as shown in the following example.

behavior TakePicture {
  step focus[*] : Focus;
  step shoot[1] : Shoot;
  // A focus may be preceded by a previous focus
  first [0..1] focus then [0..1] focus;
  // A shoot must follow a focus
  first [1] focus then [0..1] shoot;
}

Declaring successions with suitable step multiplicities allows defining behaviors based on certain temporal constraints similar to "declarative" business process modeling approaches such as DECLARE. For instance, the three most important types of DECLARE constraints, Precedence, Response and Neg-Succession, can be expressed by corresponding succession declarations, as shown in the following table.

Name of constraint typeDECLARE template nameKerML declaration patternLTL formulaExplanation of the constraint's meaning
PrecedencePrecedencesuccession focus[1] then shoot[0..1](¬focus U shoot) v □(¬focus)A shoot action must be preceded by a focus action.
Follow-upResponsesuccession focus[0..1] then shoot[1]□( focus ⇒ ◇shoot)A focus action must be followed by a shoot action.
ExclusionNeg-Successionsuccession cancel[0..1] then pay[0]□( cancel ⇒ ¬◇pay)A cancel (order) action must not be followed by a pay action.

In DECLARE, the meaning of constraint templates is provided by a translation to formulas of Linear Temporal Logic (LTL), which includes the temporal operators ◇ standing for "eventually", □ standing for "always", and U standing for "until". For instance, the formula (F U G) stands for "F until G" meaning that at some point in time G holds and all the time before that F holds. While the variables in the propositional temporal logic LTL, like F and G, normally represent sentences, in the context of providing a logical semantics for business processes, they are taken to represent actions or activities. For more about using LTL as a logical semantics for constraint-based business process models see Declarative Process Specifications by Ciccio and Montali, 2022.

An Example of a Weakly Structured Process Model

We consider a simple process type of renting hotel rooms adopted from (Pesic et al 2007) for illustrating process modeling with KerML. Processes of this type consist of seven types of activities: (1) "book room": enter client name, payment data, etc; (2) “check-in”: record client arrival, provide key card, etc; (3) “bill”: for billing the number of nights, room services, laundry services, etc; (4) “provide room service”: provide a room service for the client; (5) “provide laundry service”: provide a laundry service for the client; (6) “charge”: the client is charged the total price of the stay; and (7) “check-out”: client checks out at the reception.

Following the terminology of SysML2, we say "action" instead of "activity".

This hotel room renting process type is only weakly structured since it does not properly sequence all types of actions. But it has a few (dynamic) constraints:

  1. Every process has to start with a "book room" action followed by a “check-in” action.
  2. Every process must include at least one action of type “bill”, i.e., at least the number of nights will be billed. However, it might be the case that the bill is extended multiple times during a process (due to room services and laundry services provided during the stay).
  3. Every action of type “provide room service” or “provide laundry service” must be billed. However, it is possible that several services are billed at once, instead of billing each service separately.
  4. When the client “checks-out”, the bill must either have been charged already or will be charged at, or after, check-out.

We start by capturing the seven action types of this process type in the form of KerML Behavior definitions:

behavior BookRoom {
  feature clientName : String;
  feature preferredWayOfPayment: String;
  ...
}
behavior CheckIn {...}
behavior ProvideRoomService {...}
behavior ProvideLaundryService {...}
behavior Bill {...}
behavior Charge {...}
behavior CheckOut {...}

Then we use these action type definitions for defining corresponding action steps in a RentHotelRoom action type definition:

behavior RentHotelRoom {
  step bookRoom[1] : BookRoom;
  step checkIn[0..1] : CheckIn;
  step provideRoomService[*] : ProvideRoomService;
  step provideLaundryService[*] : ProvideLaundryService;
  step bill[1..*] : Bill;
  step charge[1] : Charge;
  step checkOut[0..1] : CheckOut;
  // A room service must be followed by a bill action
  first [0..1] provideRoomService then [1] bill;
  // A laundry service must be followed by a bill action
  first [0..1] provideLaundryService then [1] bill;
}

Notice that this action type definition includes the following constraints:

  1. The steps bookRoom and charge are executed exactly once.
  2. The steps checkIn and checkOut are executed at most once.
  3. The step bill is executed at least once.
  4. A provideRoomService action must be followed by a bill action.
  5. A provideLaundryService action must be followed by a bill action.

We need to define three more precedence constraints and two more combined follow-up/precedence constraints:

behavior RentHotelRoom {
  ...
  // A check-in must be preceded by a book room action
  first [1] bookRoom then [0..1] checkIn;
  // A room service must be preceded by a check-in action
  first [1] checkIn then [0..1] provideRoomService;
  // A laundry service must be preceded by a check-in action
  first [1] checkIn then [0..1] provideLaundryService;
  // A book room action must be followed by a charge action, and
  // a charge action must be preceded by a book room action
  first [1] bookRoom then [1] charge;
  // A check-in must be followed by a check-out, and
  // a check-out must be preceded by a check-in
  first [1] checkIn then [1] checkOut;
}

Modeling "Control Nodes" as Special Behavior Steps

In classical process modeling languages, such as UML Activity Diagrams or BPMN Process Diagrams, control nodes have been used for branching and merging the "control flow" of a process, that is, the flow of process events. In KerML, branching and merging within a Behavior is specified with the help of steps that are typed by special control behaviors predefined in the ControlPerformances library:

DecisionPerformance
A decision performance has a HappensBefore link as the value of its outgoingHBLink feature, representing the succession that has been selected from those, which have the decision performance behavior as their source. A step that is typed by a DecisionPerformance has values (performances) representing the earlierOccurrence of exactly one HappensBefore link of the successions going out of the step. Successions going out of such steps must have connector end multiplicities of 1 towards the step, and 0..1 away from it.

5.2. Functions and Expressions

Functions are Behaviors with one out parameter designated as the result parameter. Functions classify evaluations, which are kinds of performances that produce results as values of the result parameter. Like all Behaviors, Functions can change things, often referred to as "side effects". A pure Function is one that has no side effects and always produces the same results given the same input values, similarly to a function in the mathematical sense.

Expressions are steps typed by only a single Function, which means that their values are evaluations. An expression whose value is an evaluation with results is said to evaluate to those results. They can be steps in any behavior, but a Function, in particular, can designate one of its expression steps as the result expression that gives the value of its result parameter. Expressions can have their own nested parameters, to augment or redefine those of their Functions, including the result parameter. They can also own other expressions and designate a result expression, similarly to a Function.

The body of a Function may contain the declaration of a result expression at the end, as in the following example:

function Average {
  in scores[1..*] : Rational;
  return : Rational;
  // result expression
  sum(scores) / size(scores)
}

The result of the result expression is implicitly bound to the result parameter of the containing Function. Alternatively, a result expression can be explicitly bound to the result parameter like so:

function Average { 
  in scores[1..*] : Rational;
  return : Rational = sum(scores) / size(scores);
}

The KerML library Performances includes the predefined Function Evaluation, which is the most general Function in the sense that every other Function is a subtype of it. A Kernel-layer Function declaration made with the keyword "function" like the following one:

function MyFun;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined Function Evaluation:

classifier MyFun specializes Evaluation;

Expressions

An expression can be declared as a step using the keyword expr. As for a step, directed features declared in the body of an expression are considered to be parameters of the expression.

Example 1:

function UnaryFunction {in x : Anything; return: Anything;}
function apply {
  in expr fn : UnaryFunction;
  in value : Anything;
  return : Anything = fn( value);
}

Example 2 (shows how an expression can be invoked using a feature chain):

class Stats {
  feature vales[1..*] : Real;
  expr avg { sum(values)/size(values) }
}
feature myStats : Stats {
  redefines feature values = (1.0, 2.0, 3.0);
}
feature myAvg = myStats.avg();

5.3. Interactions

Interactions are behaviors that are also associations, classifying performances that are also links between occurrences. They specify how the linked participants affect each other and collaborate.

Transfers are interactions between two participants that carry items from one occurrence to another, with items optionally identified by output and input features of the source and target occurrence, respectively.

Item flows are steps that are also binary connectors, with values that are transfers. An item flow optionally ensures that items are transferred from an output feature of the connected source feature to an input feature of the target feature. Succession item flows are item flows that are also successions. They identify transfers that happen after their source (that is, after the end of the occurrence where the items come from) and before their target (that is, before the start of the occurrence where the items go to).

Example:

interaction Authorization {
  end feature client[*] : Computer;
  end feature server[*] : Computer;
  composite step login;
  composite step authorize;
  composite succession login then authorize;
}

The KerML library Transfers includes the predefined binary Interaction Transfer, which is the most general binary Interaction in the sense that every other binary Interaction is a subtype of it. A Kernel-layer binary Interaction declaration made with the keyword "interaction" like the following one:

interaction Authorization;

is equivalent to the following Core-layer classifier declaration made with the help of the predefined binary Interaction Transfer:

classifier Authorization specializes Transfer;

Item Flows

An item flow is similar to a binary connector. Unlike a regular binary connector declaration, though, an item flow declaration does not directly specify the related features for the item flow. Instead, the declaration gives the source output feature for the transfer after the keyword from and the target input feature for the transfer after the keyword to. The related features are then determined as the owning features of the features given in the item flow declaration.

In the following example, an item flow connects the out-parameter of an action step focus to the in-parameter of an action step shoot, allowing to transfer images obtained from focus actions as inputs to shoot actions.

behavior Focus { in scene: Scene; out image: Image; }
behavior Shoot { in image: Image; out picture: Picture; }
behavior TakePicture {
  in scene : Scene;
  out picture : Picture;
  binding focus.scene = scene;
  binding picture = shoot.picture;
  step focus : Focus;
  step shoot : Shoot;
  succession focus then shoot;
  flow focus.image to shoot.image;
}

Chapter 6. Predefined Elements

KerML comes with a set of libraries that include predefined classifiers and features, such as Anything, Occurrence, Object and Performance.

6.1. The Indexical Variables self, that and this

In a nested declaration, the special variable self always refers to the instances of the innermost nested element, which, in the example below, would be the evaluations of the constraint. For a feature nested in a containing element, the variable that refers to the instances of the containing element. Therefore, in the following example, the variable that refers to the instances of NegativeInteger such that the constraint requires all of them to be smaller than 0:

attribute def NegativeInteger specializes Integer {
  assert constraint { that < 0 }
}

For a behavioral feature (e.g., an action or constraint) directly or indirectly composed into a structural model, the variable this refers to the instances (items or parts) of the structural context for the behavior [as explained by Ed Seidewitz in a post on the Google Groups forum SysML v2 Release].

However, the variable this may not be aware of the features of its direct type and therefore should be casted to this type if needed, as in the following example:

part def Car {          // <--- "this"
  attribute velocity : Integer;
  action drive {        // <--- "that"
    constraint check {  // <--- "self"
      (this as Car).velocity < 100
    }
  }
}

The variable self is a feature that relates everything to itself. It is also the value of the nested that feature of all other things featured by this thing, as implied by declaring that self chains things.that.

// Kernel Base Libraray fragment
abstract classifier Anything {
  feature self : Anything subsets things chains things.that;
  abstract feature things[1..*] : Anything nonunique {
    feature that : Anything
  }
}

6.2. Occurrences

The predefined class Occurrence is specialized by Object and Performance, corresponding to the specialization of Class (OccurrenceType) by Structure (ObjectType) and Behavior.

Time slices are portions of occurrences that might have feature values and links to other things peculiar to their smaller period of time. The snapshots of occurrences are time slices that take no time. The earliest snapshot of an occurrence is its startShot, the latest is its endShot. All the others happen during its middleTimeSlice. Occurrences with a startShot the same as their endShot take no time and have no middleTimeSlice.

Occurrences are always portions of themselves. An occurrence that is only a portion of itself (a maximal portion) is an instance of the library class Life.

Figure 6-1. The library classes Occurrence, Object and Performance.
???

Other important features of Occurrence are:

snapshotOf[0..*]
The occurrences of which this occurrence is a snapshot.
timeSliceOf[1..*]
The occurrences of which this one is a time slice, including this one.
predecessors[0..*]
The occurrences that are completely separate from this one in time (not necessarily in space) and that happen before this one (end earlier than this one starts).
successors[0..*]
The occurrences that are completely separate from this one in time (not necessarily in space) and that happen after this one (start later than this one ends).
innerSpaceDimension
The number of variables needed to identify space points in this occurrence, from 0 to 3, without regard to higher dimensional spaces it might be embedded in. For example, the innerSpaceDimension of a curve is 1, even if it twists in three dimensions.
outerSpaceDimension
For an occurrence of innerSpaceDimension 1 or 2, the number of variables needed to identify their space points in higher dimensional spaces they might be embedded in, from the innerSpaceDimension to 3. For example , an outerSpaceDimension 3 for a curve indicates it twists in three dimensions. An outerSpaceDimension equal to innerSpaceDimension indicates the occurrence is spatially straight (innerSpaceDimension 1 embedded in 2 or 3 dimensions) or flat (innerSpaceDimension 2 embedded in 3 dimensions).
spaceSlices[1..*]
All portions of this occurrence that extend for exactly the same time and some or all the space, relative to spatial location of this occurrence. This means every occurrence is a spaceSlice of itself.
spaceShots[1..*]
All space slices of this occurrence that are of a lower innerSpaceDimension than it.
localClock
A local clock to be used as the corresponding time reference for this occurrence and, by default, all suboccurrences. By default this is the singleton Clocks::universalClock.
In KerML, an "individual" is a classifier that contains the life of a single occurrence and all of its portions as its basic instances. For instance, the "individual" classifier GerdWagner does not only have my life as an instance, but also any time slice of it, such as my childhood or me sleeping last night.

Part II. The Systems Modeling Language

The Systems Modeling Language (SysML) is a domain-independent systems modeling language, which is based on KerML and allows modeling not only digital software/hardware systems such as information systems, but also socio-cyber-physical systems such as spacecrafts or smart cities. SysML directly uses some elements of KerML, but most SysML elements are specializations of KerML elements.

The primary authors of the SysML v2 specification are: • Sanford Friedenthal, SAF Consulting • Ed Seidewitz, Model Driven Solutions • Roger Burkhart, Thematix Partners • Eran Gery, IBM • Hisashi Miyashita, Mgnite • Hans Peter de Koning, DEKonsult.

The "Definitions" and "Usages" Terminology

SysML2 defines a new terminology of "definitions and usages" for referring to the general pattern that features are "usages" of definitions (and may be named by the same name, typically in lowercase, as the classifier defined as their range). For instance, in the example model below, the part type definition Engine is called a "part definition" and the feature Vehicle::eng is called a "part usage" of this definition. Likewise, the data-valued feature Vehicle::drivingState is called an "attribute usage" of the (data type) definition DrivingState.

attribute def DrivingState {
  attribute gearSetting : Integer;
  attribute acceleratorPosition : Real;
}
part def Engine;
part def Vehicle {
  attribute drivingState : DrivingState;
  part eng : Engine;
}

In this new terminology, the term "usage" becomes a synonym of the term feature, and the term "definition" becomes a synonym of the term classifier, allowing to say that "an attribute usage a1 is defined by the attribute definition A1" instead of "an attribute a1 is typed by the data type A1".

The SysML2 spec claims that the "definitions and usages" terminology facilitates reuse in different contexts, thus improving the usability of SysML. But is this really the case?

It seems confusing to call the definition of a data type, like DrivingState, an "attribute definition". Rather, the term "attribute definition" normally refers to a definition of an attribute as a data-valued property within a class definition. So, what is normally considered an attribute definition, is called an "attribute usage" in SysML2, while what is called an "attribute definition", is normally considered a data type definition.

A poll about the question if the new terminology improves the usability of SysML was taken by 5 software engineers and 4 aerospace engineers (all of them professionals working for companies in the area of systems engineering, and no academics). Its result was 14 votes against, versus 4 in favor of the new terminology. For the software engineers, the picture is even more clear: they voted 9 to 1 against the new terminology, while the aerospace engineers voted 5 to 3 in favor of it (see this LinkedIn article).

As a consequence, I will not use the "definitions and usages" terminology in this book, but rather stick to the classical terminology of item type definitions versus item(-valued) properties/features, and, likewise, part/connection/action/etc type definitions versus part/connection/action/etc(-valued) properties/features.

Feature-Focused Modeling

A usage can also be contained directly in an owning package. In this case, the usage element is considered to be an implicit feature of the most general kernel type Anything. That is, a package-level usage is essentially a generic feature that can be applied in any context, or further specialized in specific contexts. [7.6.1]

This is illustrated by the following example where the feature eng implicitly defines a feature of the classifier Anything:

part def Engine;
part eng : Engine;

Chapter 7. Modeling the State Structure of a System

In SysML2, the state structure of a system is captured by modeling all types of items and parts the system consists of. This also includes modeling their attributes, subparts, ports and connections.

SysML's state structure modeling concepts include Attributes, Enumerations, Occurrences, Items, Parts, Ports, Connections, and Interfaces, as shown in the following diagram.

7.1. Attributes and Enumerations

In SysML v2, attributes (or, more precisely speaking, attribute usages) are data-valued features, corresponding to data-valued properties in OWL, as opposed to occurrence-valued features, such as item usages or part usages, corresponding to object-valued properties in OWL.

In the simplest case, an attribute is declared with a KerML data type as its range (such as the primitive data types String, Boolean, Integer, Natural, Rational, or Real), as in the following example:

item def Person {
  attribute name : String;
  attribute age : Natural;
}

What is called an attribute definition in SysML2 is, in fact, a data type definition (defining a set of data values). In the following example, an attribute definition is provided by constraining the values of the primitive KerML data type Integer:

attribute def NegativeInteger specializes Integer {
  assert constraint { that < 0 }
}

Notice that the keyword that has to be used here for referring to the instances of the containing definition of NegativeInteger in the constraint body (see also Section 6.1).

Quantity Types and Attributes

The ISQ package of the Quantities and Units Domain Library of SysML v2 provides a number of predefined generic quantity attributes (or, more precisely, attribute usages), like for instance,

attribute length : LengthValue;
attribute mass : MassValue;
attribute time : TimeValue;

Notice that the domain (or featuring type) of these predefined attributes is the classifier Anything, so they are inherited by any classifier whenever the ISQ package is imported in a system model. For more on quantities and units, see 10. Quantity Values and Quantity Types.

Enumerations

An enumeration definition is a kind of data type that defines a (typically small) set of names as its enumerated values, like the names "male" and "female" for the two biological sexes in the following example:

enum def Sex {
  enum male;
  enum female;
}

Since the body of an enumeration definition may only declare enumeration "usages", the declaration of an enumerated value may omit the enum keyword:

enum def Sex { male; female; }

An enumeration definition can be used for declaring an attribute the values of which are limited to the defined set of enumerated values. For instance, in the following example, an instance of the item definition Person must have either "male" or "female" as the value of its sex attribute:

item def Person {
  attribute name : String;
  attribute sex : Sex;
}
item def Female specializes Person {
  attribute redefines sex = Sex::female;
}

Notice how the attribute sex is bound to the specific value "female" by means of redefinition, effectively expressing the constraint that a female person is a person having the sex attribute value "female".

An enumeration definition may subclassify other attribute definitions or KerML data types. However, an enumeration definition must not subclassify another enumeration definition.

In the SysML spec, enumerations are considered as special kinds of variations and its enumerated values as its variants. However, there is no need for, and no gain of, such a treatment. It's preferable to simply stick to the classical view of an enumeration.

7.2. Items and Parts

SysML2 distinguishes between two kinds of objects:

  • An object that is neither a system nor a part of a system is an item.
  • A part is an item that is a system or a part of a system.

While parts are items that may perform actions, items that are not parts do not perform actions.

The term item is used as a synonym of the KerML term object. Consequently, an item definition, as a kind of occurrence type definition, actually defines an object type, while an item "usage" is an item-valued property.

Figure 7-1. The predefined classifier Item specializes the predefined classifier Object.
???

In the following example, there is an item definition Person and an item property driver:

item def Person;
part def Vehicle {
  attribute mass : Real;
  ref item driver : Person;
}

A system is modeled as a composite part, and its parts may themselves have further composite structure. Parts may have ports that define the connection points at which those parts may be interconnected for allowing flows of signals/messages or of physical substances. Parts may also perform actions and exhibit states.

Figure 7-2. The predefined classifier Part specializes the predefined classifier Item.
???

A part can represent any level of abstraction, such as a purely logical component, a physical component (with a part number), or some intermediate abstraction. Parts can also be used to represent different kinds of system components such as hardware components, software components, facilities, organizations, or users of a system.

In the following example, there are four part definitions (Engine, Wheel, Person and Vehicle), and there are three part usages (eng, wheels, and driver):

part def Engine;
part def Wheel;
part def Person;
part def Vehicle {
  attribute mass : Real;
  part eng : Engine;
  part wheels[4]: Wheel;
  ref part driver[0..1] : Person;
}

Notice that part usages, such as Vehicle::eng and Vehicle::wheels in the example above, are composite features by default, while the part usage Vehicle::driver is declared as a referential (non-composite) feature, which implies that the driver of a vehicle is not necessarily destroyed when the vehicle is destroyed.

7.3. Property Value Relationships

A property value relationship (called "feature value" in the spec) is a special kind of binding connector that binds a (possibly initial or default) value to a property.

An example of a bound property value relationship, stating that a property's value is always obtained as the result of the value expression, and in this sense derived:

derived attribute averageScore : Rational = sum(scores)/size(scores);

Notice that designating a bound property value relationship as derived is not required.

An example of an initial property value relationship, stating that a property's initial value is obtained as the result of the value expression (but may be changed subsequently):

attribute count : Natural := 0;

An example of a bound property default value relationship:

attribute cutoff : Integer default 0.75 * averageScore;

An example of an initial property default value relationship:

part engine : Engine default := standardEngine;

These different forms of property value relationships combine the definition of a property (structural feature) with different forms of bindings.

7.4. Ports

A port represents a connection point that can be connected to another port for enabling transfers (e.g., of signals or physical quantities) between systems or their parts. The features of a port specify what can be exchanged in such transfers.

Connected ports must conform: each feature of a port at one end of a connection must have a matching feature on a port at the other end of the connection. Two features match if they have conforming definitions and either both have no direction or they have conjugate directions. The conjugate of direction in is out and vice versa, while direction inout is its own conjugate. A transfer can occur from the out features of one port usage to the matching in features of connected port usages. Transfers can occur in both directions between matching inout features. [7.12.1]

A port definition is a KerML Structure and, consequently, a port usage, as a non-composite feature, references port objects.

The following example illustrates how the conjugated ports FuelOutPort and FuelInPort match by having the same features with the direction of directed features being reversed:

port def FuelOutPort {
  attribute temperature : Real;
  out item fuelSupply : Fuel;
}
port def FuelInPort {
  attribute temperature : Real;
  in item fuelSupply : Fuel;
}
part def FuelTankAssembly {
  port fuelTankPort : FuelOutPort;
}
part def Engine {
  port engineFuelPort : FuelInPort;
}

Every port definition also implicitly declares a conjugated port definition, which has the same features, except that any directed features have conjugated directions (i.e., in and out are reversed, with inout unchanged). The name of the conjugated port definition is always given by the name of the original port definition with the character ~ prepended, in the namespace of the original port definition. [7.12.3]

Thus, the example above can be rewritten in the following way:

port def FuelOutPort {
  attribute temperature : Real;
  out item fuelSupply : Fuel;
}
part def FuelTankAssembly {
  port fuelTankPort : FuelOutPort;
}
part def Engine {
  port engineFuelPort : ~FuelOutPort;
}

7.5. Connections, Bindings and Interfaces

A connection between two (or more) parts is itself a part in the form of a link object (an instance of an association structure). A connection definition is a part definition that is also a KerML association structure. The features of a connection definition that are not connection ends allow to characterize connections, as shown in the following example:

part def Hub {...}
part def Device {...}
connection def DeviceConnection {
  end [0..1] part hub : Hub;
  end [1..*] part device : Device;
  attribute bandwidth : Real;
}

A connection definition often represents logical connections that abstract away details of how the involved parts are connected. For example, plumbing that includes pipes and fittings may be used to connect a pump and a tank. It is sometimes desired to model the connection of the pump to the tank at a more abstract level without including the plumbing. This is viewed as a logical connection between the pump and the tank.

Alternatively, the plumbing can be modeled as a part where the pump connects to the plumbing, and the plumbing connects to the tank. As a part itself, a connection can contain the plumbing either as a composite feature, or as a reference to the plumbing that is owned by a higher level pump-tank system context. In this way, the logical connection without structure can be refined into a physical connection.

In the following example, a binary Mounting connection association allows connecting an axle to two wheels by requiring that its population includes exactly two links for each instance of Axle linking it to two different instances of Wheel:

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

Notice the special syntax for cross multiplicities: while connection ends always have the multiplicity 1, the cross multiplicity [2] of the end mountedWheel specifies that exactly 2 links involving the same axle but different wheels are required in the extent of the connection .

A connection property is a part property that is also a KerML connector.

A connection usage redefines the connection ends from its definition, associating those ends with the specific usage elements that are to be connected. For example, a connection definition could have connection ends that are part usages defined by part definitions Pump and Tank. A usage of this connection definition would then associate corresponding connection ends with specific pump and tank part usages. Supposing that the pump and tank part usages have multiplicity 1, then this means that the single value of the pump usage is to be connected to the single value of the tank usage.

A connection usage that connects parts is often a logical connection that abstracts away details of how the parts are connected. For example, plumbing that includes pipes and fittings may be used to connect a pump and a tank. It is sometimes desired to model the connection of the pump to the tank at a more abstract level without including the plumbing.

In the following example, the connection property mount, which is typed by the Mounting connection association defined above, requires having exactly two values, each one representing a connection between the WheelAssembly's axle and one of its wheels:

part def WheelAssembly {
  part axle : Axle;
  part wheels[2] : Wheel;
  connection mount[2] : Mounting {
    end part mountingAxle references axle;
    end part mountedWheel references wheels;
  }
}

This syntax also allows the declaration of ternary (or n-ary) connection properties:

connection def TwoWheelsMounting {
  end [1] part mountingAxle : Axle;
  end [1] part leftWheel : Wheel;
  end [1] part rightWheel : Wheel;
}
part def WheelAssembly {
  part axle : Axle;
  part leftWheel : Wheel;
  part rightWheel : Wheel;
  connection mount : TwoWheelsMounting {
    end part mountingAxle references axle;
    end part mountedLeftWheel references leftWheel;
    end part mountedRightWheel references rightWheel;
  }
}

There are two shorthand textual notations for connection properties.

  1. The related features of the connection property may be identified in a comma-separated list, between parentheses (...), preceded by the keyword connect:

    connection mount : TwoWheelsMounting 
      connect ( mountingAxle ::> axle, 
        mountedLeftWheel ::> leftWheel, 
        mountedRightWheel ::> rightWheel
    )

    Notice that, for brevity, the symbol ::> is used here instead of the keyword references. In the simple case of a single-valued connection property, an anonymous connection declaration (without a name and a type) can be expressed like so

    connect ( axle, leftWheel, rightWheel )
  2. If the connection property is typed by a binary connection association, then a further special notation may be used:

    connection mount[2] : Mounting 
      connect mountingAxle ::> axle to mountedWheel ::> wheels;

    In the special case of a single-valued binary connection property, an anonymous connection declaration (without a name and a type) can be expressed like so

    part def DeviceConfiguration {
      part hub : Hub;
      part device : Device;
      connect hub to device;
    }

Bindings

Bindings allow expressing value equalities between two different features. They have been defined in KerML as single-valued binary connectors that require their source and target features to have the same values on each instance of their domain.

part def Vehicle {
  part fuelTank {
    out fuelFlowOut : Fuel;
  }
  part engine {
    in fuelFlowIn : Fuel;
  }
  binding fuelFlowBinding
    bind fuelTank.fuelFlowOut = engine.fuelFlowIn;
}

In the SysML spec, bindings (and successions) are redefined as special kinds of connection "usages". However, there is no need for such a redefinition. It's preferable to simply keep the KerML concept of a binding as a special kind of connector.

Interfaces

An interface definition is a connection definition that connects ports (that is, all of its ends are ports). An interface property ("usage") is a connection property for connecting ports.

In the following example, an anonymous interface property of a DistributedSystem (without a specific type) connects a client port to a server port for allowing request-response signaling:

part def DistributedSystem {
  item def Request;
  item def Response; 
  part client {
    port clientPort;
    action clientBehavior {
      send Request() via clientPort;
      then accept Response via clientPort;
    }
  }
  part server {
    port serverPort;
    action serverBehavior {
      accept Request via serverPort;
      then send Response() via serverPort;
    }
  }
  interface client.clientPort to server.serverPort;
}

Chapter 8. Modeling the Dynamics of a System

In general, the dynamics of a system can be captured by modeling the types of events and processes (including actions and activities), occurring in the system. However, SysML does neither include an explicit concept of events (and event types), nor of processes (and process types). Rather, SysML's dynamics modeling is based on the concepts of actions and states, while the term "event" is only used in a very limited way in the technical keyword "event occurrence" (in the rather confused Section 7.9.5 of the spec), but not as a modeling concept defined in the metamodel.

Ontologically, events may be (1) instantaneous or have a duration, (2) atomic or composite, while activities are special processes, and we have to distinguish between ongoing and completed processes, see (Guarino and Guizzardi 2024). In this work, only completed activities and processes correspond to events, since events are required to have happened in the past. However, in systems modeling, we may choose using a concept of events that allows for ongoing and current events, such that both completed and ongoing processes and actions/activities are subsumed as events.

In SysML, the term "event" is only used in a technical sense for defining occurrence-valued features, typically in the context of modeling messaging interactions (as in UML sequence diagrams). The spec contains only the following statements using the term "event":

  1. In 7.9.5, it is stated that "An event occurrence usage [...] is related to another occurrence usage, representing the occurring event, by a reference subsetting relationship [...]. Or, if the event occurrence usage has no such reference subsetting, then the referenced event occurrence is the event occurrence usage itself."
  2. In 7.16.6, it is stated that "A perform action usage is a kind of event occurrence usage (see 7.9.5) for which the event occurrence is an action usage, known as the performed action".
  3. In 8.3.9.2, it is stated that "An EventOccurrenceUsage is an OccurrenceUsage that represents another OccurrenceUsage occurring as a suboccurrence of the containing occurrence of the EventOccurrenceUsage".
  4. In 8.4.5.3, it is stated that "An EventOccurrenceUsage is a kind of OccurrenceUsage that is required to always be referential by the validateEventOccurrenceUsageIsReference".

...

8.1. Action Types and Steps

An action (type) definition is a kind of KerML Behavior that classifies action performances. An action step ("usage") is a kind of KerML Step (a behavioral feature). Action definitions and action steps can be composed of subaction steps.

An action definition may declare properties with directions in, out or inout that act as the parameters of a corresponding action expression. If an action step has parameters, then it may also transform the values of its input parameters into values of its output parameters.

An action performance can generate effects on involved objects (items or parts), including their existence and relationships to other things.

Subaction steps can be sequenced and coordinated with the help of (possibly conditional) successions as well as fork/join and decision/merge control nodes, which are viewed as special types of action steps in SysML2. An output parameter of an action step may be bound to an input parameter of a follow-up action step. An input parameter of an action definition or step can also be bound to the input parameter of a nested action step, passing the values of the input parameter into the nested action, and an output parameter of a nested action step can be bound to an output parameter of a containing action definition or step, passing the values of the output parameter out.

The binding of action parameters, however, does not model the case when there is an actual transfer of items between actions that may itself take time or have other properties. Such a transfer can be more properly modeled using a flow connection between the two action steps, in which the transfer source output is an output parameter of the source action step and the transfer target input is the input parameter of the target action step.

Transfers can also be performed using send and accept action steps. In this case, the source and target of the transfer do not have to be explicitly connected with a flow. Instead, the source of the transfer is specified using a send action step contained in some some source part or action type, while the target is given by an accept action step in some destination part or action type (which may be the same as, or different than, the source). A send action step includes an expression that is evaluated to provide the values to be transferred, and it specifies the destination to which those values are to be sent (possibly delegated through a port and across an interface).

Both part types and action types can have perform action steps, which are always referential. In the case of a perform action step of a part type, the referenced action is performed by the containing part (as its performer) during its lifetime. In the case of a perform action step of an action type, the perform action step represents a "call" from the containing action to the performed action.

Timing Constraints

Timing constraints can be expressed within an action type definition like so:

private import Time::TimeOf;
action def A {
   first start;
   then action a1;
   then action a2;
   then done;
   assert constraint {  TimeOf( self.done) - TimeOf( self.start) < 10[s] }  
}

The constraint requires that any action of type A must be completed within 10 s.

8.1.1. Sequencing Action Steps with Successions

TBD

8.1.2. Control Nodes

Control nodes are viewed as special types of actions in SysML2.

fork node
(also called "AND-split") having one incoming succession and one or more outgoing successions, such that the actions connected to the outgoing successions cannot start until the action connected to the incoming succession has completed.
join node
(also called "AND-join") having one or more incoming successions and one outgoing succession, such that the action connected to the outgoing succession cannot start until all the actions connected to the incoming successions have completed.
decision node
(also called "OR-split") having one incoming succession and one or more outgoing successions, such that exactly one of the actions connected to an outgoing succession can start (controlled by placing guards on the outgoing successions) after the action connected to the incoming succession has completed.
merge node
(also called "OR-join") having one or more incoming successions and one outgoing succession, such that the action connected to the outgoing succession cannot start until any one of the actions connected to an incoming succession has completed.

8.2. States

T.B.D.

Chapter 9. Modeling System Variants with Variation Points

A system design model may include variation points, which allow specifying variants of a system.

In SysML2, a variation is a type that classifies a fixed number of instances, which are its variants. All features declared within the body of a variation definition (or a variation feature) are declared as variant features by placing the keyword variant at the beginning of their declarations. The semantics of variations restricts the allowable instances of a variation to values of its owned variant features.

For instance, we can define an EngineVariant part type that admits of the two engine variants fourCylEngine and sixCylEngine as a variation in the following way:

part def Cylinder;
part def Engine {
  part cylinder[2..*] : Cylinder;
}
variation part def EngineVariant :> Engine {
  variant part fourCylEngine : Engine {
    part redefines cylinder[4];
  }
  variant part sixCylEngine : Engine {
    part redefines cylinder[6];
  }
}

The variation EngineVariant can then be used for defining a variation point property in an abstract CarVariant part type definition:

part def Transmission;
abstract part def CarVariant {
  part engine : EngineVariant;  // variation point property
  part transmission : Transmission;
}

In addition to the engine, also the transmission can be turned into a variation point by defining the variants manualTransmission and automaticTransmission. In the following example code, these variants are defined by embedding them in a variation property definition:

part def Transmission;
abstract part def CarVariant {
  // variation point property
  part engine : EngineVariant;
  // variation part property with embedded variant definitions
  variation part transmission : Transmission {
    variant part manualTransmission : Transmission;
    variant part automaticTransmission : Transmission;
  }
}

An abstract part type defined with variation points, like CarVariant, subsumes a number of concrete part types obtained by choosing an admissible combination of variants for each variation point. The set of admissible combinations can be constrained like in the following example, where 4-cylinder cars can only have a manual transmission:

part def Transmission;
abstract part def CarVariant {
  // variation point property
  part engine : EngineVariant;
  // variation point property with embedded variant definitions
  variation part transmission : Transmission {
    variant part manualTransmission : Transmission;
    variant part automaticTransmission : Transmission;
  }
  assert constraint {
    engine == EngineVariant::fourCylEngine implies
     transmission == transmission::manualTransmission
  }
}

This constrained CarVariant part type subsumes three concrete part types:

part def Car4Cyl :> CarVariant {
  part redefines engine = engine::fourCylEngine;
  part redefines transmission = transmission::manualTransmission;
}
part def Car6CylManual :> CarVariant {
  part redefines engine = engine::sixCylEngine;
  part redefines transmission = transmission::manualTransmission;
}
part def Car6CylAuto :> CarVariant {
  part redefines engine = engine::sixCylEngine;
  part redefines transmission = transmission::automaticTransmission;
}

Chapter 10. Quantity Values and Quantity Types

System models need a way to represent quantities and their measurement references (units, scales, coordinate frames) based on established international standards, in particular the International System of Quantities (ISQ), the International System of Units (SI) and the US Customary Units.

ISQ defines seven base quantity types: Length, Mass, Time, Electric Current, Thermodynamic Temperature, Amount of Substance, and Luminous Intensity.

A quantity value is defined as an ordered pair of a numerical value and a measurement reference. In the simplest case, a measurement reference is a measurement unit. For example, a length value expressed as 15 mm has the same type (LengthValue) as a length value expressed as 0.015 m. An attribute can be bound to such a value in the following way:

attribute width : LengthValue = 0.015 [m];

In SysML v1, a quantity value property type combines a quantity type and a unit. Consequently, using different units of the same quantity types, such as gram and kilogram, requires defining different quantity types.

Existing quantity ontologies/schemas (such as QUDT or FIBO Quantities and Units) do not support measurement scales and have only limited support for quantity dimensions, vector/tensor quantities and coordinate frames, which are needed for quantifying vectors and tensors. Interval measurement scales are needed, e.g., for time instants and durations. An example of an ordinal measurement scale is the Rockwell C hardness scale. A logarithmic measurement scale is needed, e.g., for the sound pressure level measured in dB, and a cyclic measurement scale is needed, e.g., for the rotation angle measured in angular degrees.

The Quantities and Units Domain Library of SysML v2 defines a comprehensive set of quantity concepts including the ISQ and SI concepts, the most important of which are:

  1. LengthValue and LengthUnit,
  2. MassValue and MassUnit,
  3. TimeValue and TimeUnit,
  4. ElectricCurrentValue and ElectricCurrentUnit,
  5. ThermodynamicTemperatureValue and ThermodynamicTemperatureUnit.
Figure 10-1. A fragment of the Quantities and Units Domain Library showing Length and Mass concepts.
???

Defining Units

Units (such as mA for milliampere) that are not predefined in the standard library SI, have to be defined in a user model. Using unit prefixes (such as milli), which are predefined in the SI library, they can be defined like so:

private import SI::*;
private import ISQ::*;
attribute mA : ElectricCurrentUnit = milli * A;

Notice that for being able to use the predefined unit A and the predefined unit prefix milli, the standard library SI is imported first (with all its elements). Likewise, for being able to use the predefined data type ElectricCurrentUnit, the standard library ISQ is imported. In the sequel, for simplicity, these import statements will often be omitted.

Such a unit definition can then be used in the definition of a variable highLevel in the form of an attribute as follows:

attribute highLevel : ElectricCurrentValue = 20.0 [mA];

Example: Defining the Composition of Atoms

The following example is based on a model of a PWR nuclear power plant presented in the Google Group "SysML-v2-Release". It illustrates the use of units, quantity types and quantity values (and provides an example of a constraint).

// dalton (unified atomic mass unit)
attribute Da : MassUnit = 1.66054*10^-27 [kg];
// elementary charge
attribute e : ElectricChargeUnit = 1.6*10^-19 [C];
part def Particle {
  attribute mass : MassValue;
  attribute charge : ElectricChargeValue;
}
part def Proton specializes Particle {
  redefines mass = 1.0072766 [Da];
  redefines charge = 1[e];
}
part def Neutron specializes Particle {
  redefines mass = 1.008665 [Da];
  redefines charge = 0 [e];
}
part def Electron specializes Particle {
  redefines mass = 1/1837 [Da];
  redefines charge = -1 [e];
}
part def Atom {
  // an atom has up to 118 protons
  part proton[1..118] : Proton;
  // an atom has up to 176 neutrons
  part neutron[0..176] : Neutron;
  // an atom has up to 118 electrons
  part electron[1..118] : Electron;
  attribute mass : MassValue = proton.mass + neutron.mass + electron.mass;
  // an atom must have the same number of protons and electrons
  assert constraint PnE { size( proton) == size( electron) }
}

Chapter 11. Metadata

A metadata usage is a kind of annotating element that allows for the definition of structured metadata with modeler-specified attributes. This may be used, for example, to add tool-specific information to a model that can be relevant to the function of various kinds of tooling that may use or process a model, or domain-specific information relevant to a certain project or organization. A metadata usage is defined by a single metadata definition. If the definition has no nested features itself, then the metadata usage simply acts as a user-defined syntactic tag on the annotated element. If the definition does have features, then the metadata usage must provide value bindings for all of them, specifying metadata for the annotated element. [7.27.1]

After making a metadata definition with attributes, like so:

metadata def ApprovalAnnotation {
  attribute approved : Boolean;
  attribute approver : String;
}

it can be used for annotating elements with the help of the keyword about:

metadata ApprovalAnnotation about Design {
  approved = true;
  approver = "John Smith";
}

or by including it in the element to be annotated:

part def Design {
  @ApprovalAnnotation {
    approved = true;
    approver = "John Smith";
  }
}

Notice that the symbol @ is a shorthand for the keyword metadata.

Semantic Annotations with User-Defined Keywords

If a metadata definition specializes the KerML metaclass SemanticMetadata (from the Metaobjects model in the Kernel Semantic Library), then any annotated elements must be types (e.g., definitions or usages), and the inherited feature baseType must be bound to a KerML::Type, which is a generalization of SysML::Definition and SysML::Usage.

For instance, for the following occurrence type definition

occurrence def Event {
  attribute occTime : TimeValue;
}

we could define a semantic metadata (or annotation) element EventType and then annotate an event type definition like so:

metadata def EventType :> SemanticMetadata {
  :>> baseType = Event meta SysML::Definition;
}
occurrence def Arrival { @EventType;
  item arrivedCustomer : Customer;
}

The annotated definition of Arrival implicitly subclassifies the metadata element's base type Event and is, consequently, equivalent to

occurrence def Arrival specializes Event {
  item arrivedCustomer : Customer;
}

For making semantic annotations more readable, user-defined keywords can be declared in the semantic metadata definition like so:

metadata def <EventType> EventType :> SemanticMetadata {
  :>> baseType = Event meta SysML::Definition;
}

and then used (prefixed by the symbol #) like so:

#EventType def Arrival { 
  item arrivedCustomer : Customer;
}

Feature (or usage) declarations can be semantically annotated in a similar way.

Appendices

Appendix A. Previous Work on Which KerML is Built or That Influenced It

KerML is built upon the Unified Modeling Language (UML) and the Web Ontology Language (OWL), and it is strongly influenced by a number of previous works that we summarize and review in this section.

The Unified Modeling Language (UML 1997–2015)

The UML consists of a set of visual modeling languages for modeling software systems, the most important of which are

  1. Class Models/Diagrams for defining classes together with their attributes, operations and integrity constraints, as well as associations and specializations between classes. Classes define the (information) structure of the objects that instantiate them.
  2. Activity Diagrams for defining behaviors consisting of a succession of events and actions, possibly involving objects that participate in them.
  3. State Machine Diagrams for defining transitions between (object) states
  4. Sequence Diagrams for defining interactions as temporal orderings between message events.

While class models allow describing, or defining, the (information) structure of software systems in a coherent way, the models listed in items 2–4 are supposed to describe, or define, the behavior of software systems. Unlike for structural modeling (with Class Diagrams), UML does not have a common abstract syntax or semantics for its behavior modeling languages. Thus, with three overlapping, but non-integrated behavior modeling languages, UML does not allow coherent behavior modeling.

Since the dynamics of a system does not only consist of the system's actions and activities, but also of other types of events (such as system failures or message arrivals), UML's choice of the term 'behavior modeling' is unfortunate for denoting the modeling of the dynamics of a system. Wikipedia defines that "Behavior is the way a person or animal acts and reacts". In UML, the term 'Behavior' is only defined vaguely and its intended meaning seems to be that a 'Behavior' is an activity consisting of actions and reactions.

According to the UML metamodel, a Behavior is a special kind of Class that classifies behavior executions (or occurrences). In fact, Behavior is an umbrella concept subsuming activities and interactions. The UML spec states (in 13.2.3.1) that

A Behavior is a specification of events that may occur dynamically over time [...]. Every Behavior defines at least one event, the event of its invocation. [...] On each invocation, the subsequent actual sequence of event occurrences due to the invocation, consistent with the specification of the Behavior, is called an execution trace for the Behavior.

[...] an instance of a Behavior is known as a behavior execution. Invoking the Behavior corresponds to instantiating the Behavior, and there is a specific execution trace corresponding to each Behavior execution.

According to the spec (17.2.3.1), an Interaction is a Behavior that focuses on the passing of messages.

Events are not first-class citizens in UML since there is no element for classifying events (such as EventType). The UML spec states that "an Event can be considered a classification of its occurrences, though Events are not actually Classifiers in UML".

KerML has imported or adopted the following elements from UML:

  • Classifiers, Features and Specialization. However, in KerML, both Classifiers and Features are Types, which may have Features, while in UML, Classifiers have Features.
  • DataTypes, Classes and Associations as special Classifiers. Already in UML 2.5.1, the metaclass Class has been turned into an umbrella concept subsuming both object types and Behaviors (with the strange terminology that also the instances of Behavior classes, executions, are called "objects"). However, in KerML, the instances of a Class are no longer objects, but occurrences, and object types are now called "Structures".
  • Connectors as special features of StructuredClassifiers typed by an association allowing to represent interconnections between different parts of a system.
  • Behaviors as special Classes that classify behavior executions (called performances in KerML).
  • Interactions as special Behaviors.

Recommended reading/resources on UML:

The Web Ontology Language (OWL 2004–2012)

OWL is a language for

  1. defining vocabularies ("ontologies") consisting of (a) classes for classifying things, (b) properties for describing things and (c) integrity constraints for fine-tuning how things can be described;
  2. representing knowledge about things with the help of classification and attribution statements expressed in terms of the classes and properties defined in OWL vocabularies.

Basic knowledge about things is expressed in the form of classification statements and attribution (or object-property-value) statements, also called "triples", corresponding to atomic sentences in predicate logic, where classes and properties correspond to unary and binary predicates. OWL has two predefined classes, Thing and Nothing, corresponding to the class of all things and the empty class.

An OWL knowledge base, consisting of a vocabulary and a set of classification and object-property-value statements, corresponds to a set of predicate-logical sentences.

The formal semantics of OWL follows Tarski's model-theoretic semantics of predicate logic where the truth of a sentence is defined relative to an interpretation of its language (given by individual names and predicate names). A predicate-logical interpretation consists of

  1. A set of all things in the world (called universe). In OWL, the universe is partitioned into a set of data values D and a set of objects O.
  2. An interpretation function I that maps unary predicates to subsets of the universe (their extension) and n-ary predicates to n-ary relations over the universe. In OWL, data types are mapped to subsets of D and classes are mapped to subsets of O, while data-valued properties are mapped to subsets of the Cartesian product of O and D, and object-valued properties are mapped to subsets of the Cartesian product of O and O.

An interpretation satisfies an atomic sentence p(i) stating that p applies to i, where p is a unary predicate and i is an individual name, if I(i) ∈ I(p), that is, p applies to i if the thing denoted by i is in the extension of the predicate p.

An interpretation satisfies a negation (conjunction, disjunction) of a sentence S (and S'), if (1) it does not satisfy S, (2) it satisfies both S and S', (3) it satisfies S or S'.

Since a UML class model corresponds to an OWL vocabulary, we can check if a class model is consistent by checking if the corresponding set of predicate-logical sentences is satisfiable, that is, if there is an interpretation that satisfies all the sentences expressed by the class model.

KerML has imported or adopted the following elements from OWL:

  • KerML's predefined (most general) classifier Base::Anything corresponds to OWL's Thing and its predefined (most general) data type Base::DataValue corresponds to OWL's rdfs:Literal.
  • The separation of feature definitions from class(ifier) definitions.
  • Inspired by OWL, KerML adopts a model-theoretic semantics, remarkably not only for its structural modeling concepts, but also for its behavioral modeling concepts. However, since, unlike OWL, KerML has to support features/attributes with non-unique and ordered value sets, the interpretation of KerML features requires a more complicated approach compared to the interpretation of OWL properties.
Recommended reading/resources on predicate logic and OWL:
  • An introduction to predicate logic in CHAPTER 14 of "Foundations of Computer Science" by A. V. Aho and J. D. Ullman.
  • W3C's OWL primer.

Ontological Behavior Modeling (2011)

Bock, C. and Odell, J. 2011. Ontological Behavior Modeling, Journal of Object Technology, https://doi.org/10.5381/jot.2011.10.1.a3

This article first explains the idea that in a modeling language like UML, classes should be considered as classifiers that classify their instances, like in the Web Ontology Language OWL, as opposed to the common view that classes are factories for creating instances and encapsulating code. Then, for integrating the scattered behavior modeling sublanguages of UML, several new elements are proposed:

  • For capturing the behavioral components of UML Behaviors as special properties/features called 'steps', a new metaclass Step, specializing Property, is proposed. The range/type of a step property is a Behavior. For instance, a ChangeColor Behavior has two steps: step1 is of type Paint (its values are executions of the Behavior Paint ) and step2 is of type Dry.
  • For sequencing the steps of a Behavior, Succession connectors are proposed as special features of the Behavior, connecting its steps by defining temporal precedence constraints on the executions/occurrences admitted for it.
  • In addition, a predefined classifier BehaviorOccurrence is proposed to represent the most general Behavior. For BehaviorOccurrence, two self-associations, happensDuring and happensBefore, are proposed for capturing corresponding temporal constraints. An occurrence that is the value of a Behavior step (such as a Paint occurrence) is called a suboccurrence. It must hold for each suboccurrence of an occurrence that it happensDuring the occurrence.
  • For supporting the modeling concept of instantaneous events, a new metaclass EventType is proposed to be specialized from Class in the UML metamodel. Both behavior occurrences and event occurrences can be associated through the predefined associations happensDuring and happensBefore. By allowing the range/type of a step property to be an EventType or a Behavior, a Behavior may have both event steps and activity steps, corresponding to a (discrete) process. This also allows having the two predefined steps startEvent and endEvent for all Behaviors.
  • For supporting the modeling of object flows and message flows, a new predefined class Transfer is proposed to be specialized from BehaviorOccurrence for classifying occurrences that transfer things. It has three properties: source, target and transferredThing. While an object flow transfers objects between BehaviorOccurrences (for example, an object in a factory may flow from a painting occurrence to a drying occurrence), a message flow transfers messages between objects. A new metaclass Flow, specializing both Connector and Step, is supposed to capture types of transfers that can be sequenced via Successions.

The authors remark that their work is partially based on the Business Process Definition Metamodel from 2008, which already includes certain forms of the modeling concepts Behavior, BehaviorOccurrence, Step, Succession, and (Message) Flow.

KerML has adopted the following elements from this work:

  • Steps as behavior-typed features (e.g., for breaking down a composite Behavior into a number of steps).
  • Successions as special connector features of Behaviors for sequencing their steps.
  • The predefined associations HappensDuring and HappensBefore for defining the temporal semantics of occurrences.
  • Flows being both Connectors and Steps.

But why has the metaclass EventType not been adopted? A general concept of events is clearly needed for systems modeling.

Four-Dimensional Ontology (2019)

Bock, C. and Galey, C. 2019. Integrating four-dimensional ontology and systems requirements modelling, Journal of Engineering Design, https://doi.org/10.1080/09544828.2019.1642461

The article makes the following claims:

  • "The most basic kinds of things in systems are commonly taken to be objects and behaviours, where behaviours are changes to the objects involved in them." However, the more common term associated with changes of objects is "events", which subsumes actions as well as (completed) activities and processes.
  • "The phrase ‘occupy space’ is used with objects, and ‘involve objects’ with behaviours, but ultimately both occur in space". However, it is well-known in Ontology that behaviours/processes only indirectly occur in space via their involved objects, which do have spatial properties such as a location and a spatial extent.
  • Both objects and behaviours should be treated "as things occurring in both space and time [...] rather than specifying objects only in space and behaviour only in time", because treating "objects as existing in space and behaviours as existing in time, linking them together to provide time to objects and space to behaviours [...] complicates modelling and analysis with unnecessary linkages, such as one-to-one relations between objects and their histories". But why should a one-to-one association between objects and their histories complicate modelling and analysis? Rather, it seems that forcing systems modelers and developers to identify objects with their history, and not allowing them to consider these separately, is complicating modelling and analysis.

KerML has adopted the following elements from this work:

  • Occurrence as a general ontological category and library class that is specialized by the library classes Object and Performance. In UML 2.5.1, the term "occurrence" has already been used, but in a more limited way (as, e.g., in "event occurrence" and the umbrella meta-class "OccurrenceSpecification" for Interactions).

Using SysML for Physical Interaction and Signal Flow Simulation (2017)

Bock, C., Barbau, R., Matei, I. and Dadfarnia, M. 2017. An Extension of the Systems Modeling Language for Physical Interaction and Signal Flow Simulation, Systems Engineering, https://doi.org/10.1002/sys.21380

Systems modeling languages must be used in conjunction with analysis tools, in particular, with simulators for physical interaction and numeric signal flow based on ordinary and algebraic differential equation solvers. These kind of simulation tools are often used separately from system modeling tools, leading to inconsistencies that require additional work to eliminate, preventing multidisciplinary concerns from being reflected in the overall system design. As a result, there is an increasing need for integrating physical interaction and signal flow simulation tools and languages into system modeling under a single framework. In this article, we first present an abstraction of the constructs and semantics these simulation tools and languages have in common, based on earlier reviews. Then, we compare SysML to our simulation abstraction to find the parts of SysML closest to simulation modeling, and to identify simulation concepts missing from SysML. This leads to extensions of SysML to bridge the gaps, illustrated with an example application. Next, we address issues in translating extended SysML models to common simulation tools and languages, including the differences between them. Finally, we validate the approach by applying the extension to an example SysML model, automating the translations in software, and showing that the results execute the same way on different simulation platforms.

  • Simulation treats movement of physical substances as uninterrupted movement of their conserved characteristics, such as electric charge, momentum, and entropy, rather than individual movement of the substances themselves, such as electrons, steel, and steam. This makes rates of flow independent of the time interval over which flow rates are calculated.

Update of SysPhS for SysML2: https://github.com/usnistgov/saismo/releases/tag/sysphsv2-prerelease1

SysML Extension for Physical Interaction and Signal Flow Simulation (2021)

Bock, C., Barbau, R., Matei, I. and Dadfarnia, M. 2021. SysML Extension for Physical Interaction and Signal Flow Simulation. OMG Specification. https://www.omg.org/spec/SysPhS/1.1/PDF

Appendix B. Do Objects Persist or Happen over Time?

In their most spectacular change/innovation, KerML/SysML2 break with the established view (e.g., in UML) that objects are continuants, which persist over time, while events, actions/activities and processes are occurrences, which happen over time. For them, all things, including objects, are occurrences, which means that objects are identified with their histories/lifes. This new approach has far-reaching consequences, which don't seem to be well-understood yet.

In KerML/SysML2, objects are viewed as occurrences (or perdurants), so they happen over time by accumulating temporal parts, like processes, whereas in UML, objects are viewed as continuants (or endurants) that persist (and possibly change) over time while keeping their identity. The UML world view corresponds to a 3D ontology (referring to the three dimensions of the space, in which objects are extended), while the KerML/SysML2 world view corresponds to a 4D ontology, in which objects are extended in space and time.

We could ask the following questions:

  1. Which of these two world views is more common sense?
  2. Is one of these two world views philosophically (or scientifically) superior, and therefore preferable, or do both of them make sense similar to the wave theory and the corpuscular theory of light?
  3. Is one of these two world views computationally superior, and therefore preferable?
Figure B-1. In KerML, both objects and their performances are occurrences.
???

The Common Sense View

Normally, we do not think that objects (such as my car or the Mount Everest) happen over time. Rather, we think that objects persist over time. And it's their history (or life) that happens over time, like other processes do as well.

So, we normally distinguish between an object and its history/life, not only in our common sense, but also in object-oriented modeling of information systems with UML.

But in KerML/SysML2, objects are identified with their histories, so they are considered to be occurrences, which are 4-dimensional entities, like processes, instead of 3-dimensional entities. Is this a good choice? What are its pros and cons?

Notice that in philosophy, this question (if objects are processes/occurrences) is an old debate, and there are both 3D Ontologies (such as DOLCE, BFO and UFO) and 4D Ontologies (such as BORO).

The Philosophical Debate

T.B.D.

What is computationally preferable?

Ed Seidewitz (in an LI comment): "for modeling temporal constraints, the 4D approach has a lot of formal advantages". Which ones?

T.B.D.

An Alternative To KerML's 4D Orthodoxy

Figure B-2. Allowing both 3D objects and 4D objects to co-exist.
???

Appendix C. Frequently Asked Questions (FAQ)

  1. What's new or different in KerML/SysML2 compared to UML2?
  2. What is the new terminology of "definitions and usages" about?

  3. What Is the Temporal Semantics of Multiplicities?
  4. Do objects persist or happen over time?

  5. Why do KerML/SysML2 not support a general concept of events?
  6. Is a predicate-logical semantics preferable over an operational one?
  7. Why does a feature specialize its range?
  8. Is the childhood of a person a person?

1. What's new or different in KerML/SysML2 compared to UML2?

This question is answered in Section 1.2.

2. What is the new terminology of "definitions and usages" about?

SysML2 defines a new terminology of "definitions and usages" for referring to the general pattern that features may be named by the same name (typically in lowercase) as the classifier defined as their range. For instance, the feature engine : Engine is considered a usage of the definition of the classifier Engine. In this way, the term usage becomes a synonym of the term feature, and the term definition becomes a synonym of the term classifier (allowing to say that "a part usage p1 is defined by the part definition P1" instead of "a part feature p1 is typed by the part type P1").

New Definition/Usages TerminologyClassical Terminology
attribute definitiondata type definition
attribute usageattribute definition
defined bytyped by
item (part/action/etc.) definitionitem (part/action/etc.) class/type definition
item (part/action/etc.) usageitem (part/action/etc.) property/feature definition

For instance, in the following example, we have an attribute def DrivingState, declaring a complex data type to be used as the range of one or more attributes, and a part def Engine, both used in the attribute usage attribute drivingState and the part usage part eng within the part def Vehicle:

attribute def DrivingState {
  attribute gearSetting : Integer;
  attribute acceleratorPosition : Real;
}
part def Engine;
part def Vehicle {
  attribute drivingState : DrivingState;
  part eng : Engine;
}

The SysML2 spec claims that the "definitions and usages" terminology facilitates reuse in different contexts. The goal of introducing this new terminology is to improve the usability of SysML. But is this really the case?

It seems confusing, at least for software engineers, to call the definition of a (complex) data type, like DrivingState, an "attribute definition". Rather, the term "attribute definition" normally refers to a definition of an attribute as a data-valued property within a class definition. So, what is normally considered an attribute definition, is called an "attribute usage" in SysML2, while what is called an "attribute definition" in SysML2, is normally considered a data type definition.

For item (or part/action/etc.) type definitions, it seems to make sense, and to improve usability, calling them simply "item (part/action/etc.) definitions" But then, does this also hold for calling an item (part/action/etc.) property definition an "item (part/action/etc.) usage"? An while speaking of a property of a property (or a feature of a feature) is still intelligible, does this also hold for "a usage of a usage"?

There may be an issue of having different backgrounds in different engineering communities. While for software engineers, the terms "type/class definition" and "property definition", as well as the concept that a property/feature is typed by a data type or class, are quite familiar, this may not be the case for other kinds of engineers. Possibly, the goal of the SysML submission team for introducing the "definitions and usages" terminology was to improve the usability of SysML for non-software (such as aerospace/automotive/etc.) engineers. But it can be doubted if this goal has been achieved.

3. What Is the Temporal Semantics of Multiplicities?

KerML multiplicities are special features of types. In the case of classifiers, they allow constraining their number of basic instances. In the case of features, they allow constraining the number of their values, as stated in [KerML 8.4.4.12.1]:

For a Feature, the cardinality is the number of values of the Feature for any specific featuring instance (where duplicate features are included in the count, if the Feature is non-unique).

However, the KerML spec does not state if these cardinalities (the number of basic classifier instances or the number of feature values) are taken at a time, in the sense of snapshot cardinalities, or over time, in the sense of history cardinalities. This distinction, which is also discussed in the section Participation Associations of the book Object Event Modeling and Simulation, has been proposed by (Tauzovich 1991). It has also been raised as an issue for KerML by Conrad Bock [KERML-306].

In the following Object Event class model from OEM&S, a library user participates in (1) zero or more book lending activities over time, and (2) at most one book lending activity at a time.

Figure C-1. A history multiplicity and a snapshot multiplicity shown at the activity type end of a participation association.

We'll discuss the issue here only for feature multiplicities. But our discussion and its conclusions also apply to multiplicities of classifiers.

It seems that, by default, the multiplicities of object type features should be interpreted as snapshot multiplicities, while the multiplicities of action type features should be interpreted as history multiplicities. Consider the following example models that illustrate this insight.

Our first example model declares an object type (or "structure") Hotel with two attributes (or data-valued features) and one action step (or action-valued feature):

struct Hotel {
  feature name[1]: String;
  feature rooms[1..*]: Room;
  step rentHotelRoom[*] : RentHotelRoom;
}

What is the intended meaning of the multiplicities 1 and 1..* specified for the features Hotel::name and Hotel::rooms? Do they constrain the cardinalities of the features' value sets at a time, that is, their snapshot cardinality, or rather the cardinality of the features' value sets over time, that is, their history cardinality? In the first case, a hotel must have exactly one name and at least one room at a time. In the second case, a hotel must have exactly one name and at least one room over time, implying that it must not change its name over time and may have no name and no rooms at certain time instants.

For an attribute like Hotel::name, it seems to be clear that the intended meaning of its multiplicity is that it constrains its snapshot cardinality. The same holds for the object-valued feature Hotel::rooms.

But what about the action-valued feature Hotel::rentHotelRoom? For this feature it's not as obvious as for the others if its multiplicity is intended to refer to snapshot or to history cardinalities. Both readings make sense: (1) a hotel may perform zero or many rentHotelRoom actions at a time; (2) a hotel may perform zero or many rentHotelRoom actions over time.

The ambiguity could be resolved by stipulating the snapshot interpretation as the default reading and introduce a new notation (e.g., by prefixing them with "H") for designating history multiplicities, assuming the multiplicity zero-or-more (*) as the default history multiplicity.

Unfortunately, it turns out that a default interpretation would have to be context-dependent, as it would have to be snapshot multiplicities for features of object types, as in the case of Hotel above, and history multiplicities for features of action types, as in the following example of a RentHotelRoom action type (or "behavior") with four action steps:

behavior RentHotelRoom {
  step bookRoom[1] : BookRoom;
  step checkIn[0..1] : CheckIn;
  step charge[1] : Charge;
  step checkOut[0..1] : CheckOut;
}

Here, unlike in the case of object types, the intended meaning is that the action steps' multiplicities constrain the history cardinality, and not the snapshot cardinality, of the step concerned. For instance, a rent-hotel-room action hast exactly one bookRoom step and at most one checkIn step over (its life-) time.

What about data- and object-valued features of action types, e.g., if RentHotelRoom would have an attribute rentalNo and an object-valued feature customer, both with a multiplicity of exactly-one? Is it again not obvious if the multiplicity of these features is intended to refer to snapshot or to history cardinalities? Clearly, the intended reading is that a rent-hotel-room action has exactly one rentalNo and exactly one customer at a time, and not over time. So, unlike for object types, for action types it holds that while multiplicities for action steps suggest a default reading as history multiplicities, multiplicities for data- and object-valued features suggest a default reading as snapshot multiplicities.

Consequently,

  1. KerML needs to be extended by adding the conceptual distinction between snapshot multiplicities and history multiplicities (and a suitable syntax for designating these different kinds of multiplicities).
  2. It has to be decided if a context-dependent default reading, as discussed above, can be supported for allowing a simpler (undesignated) notation.

4. Do objects persist or happen over time?

This question is answered in Appendix B.

5. Why do KerML/SysML2 not support a general concept of events?

T.B.D.

6. Is a predicate-logical semantics preferable over an operational one?

The formal semantics of KerML's core concepts (types, classifiers and features) is defined in the form of an OWL-style (Tarskian) model-theoretic semantics. Since all other KerML and SysML2 concepts are defined in terms of KerML's core concepts and predefined library elements, the model-theoretic semantics is extended to all of them. For instance, a SysML "action" is defined as a feature the range of which specializes the predefined classifier Performance, and, consequently, also behavors/processes do have a model-theoretic semantics (and not an operational one).

Relative to a given interpretation, classifiers are essentially interpreted, like unary predicates, as a set of individuals from the universe of the interpretation, while features are essentially interpreted, like binary predicates, as binary relations that subset the Cartesian product of their domain and their range. In fact, due to KerML's support of ordered and non-unique features, and due to its adoption of the (puzzling) semantic postulate that features specialize their range, the formal semantics is more complicated.

T.B.D.

7. Why does a feature specialize its range?

KerML/SysML2 allow for nested feature/attribute definitions (features of features) with a contextualized semantics that requires that a feature specializes its range. E.g., the feature Person::income, the extent of which are all ordered pairs (p,i) where p denotes a person and i denotes a positive integer representing the income of p, would be a subtype of Integer, such that any pair (p,i) would be an instance of Integer.

Explanation by Jim Rhyne (Thematix Partners LLC):

In the example used in the document I referenced, "Car" has an owned feature "rollsOn" with co-domain "Wheel". "Wheel" has an owned feature "rotateAround" with co-comain "Hub". "Hub" has owned feature "rimFix" with co-domain "LockLugBolt".  Because this is a composition, the co-domain of "rimFix" is not the set of all "LockLugBolts" but the set of "LockLugBolts" "rimFixed" by "Hubs" that "Wheels" "rotateAround" where "Wheels" are "rolledOn" by "Cars".

This can be represented in a logic language like OWL by defining restriction classes based on the owned feature chain. So, the restriction class "LockLBHub" is the set of "Hubs" whose "rimFix" is some "LockLugBolt". Then "LockLBWheel" is the set of "Wheels" whose "rotateAround" is some "LockLBHub". Finally "LockLBCar" is the set of "Cars" that "rollsOn" some "LockLBWheel".

Think about duplicating this kind of structure for all of the parts of a car and you begin to see the problem about expressiveness.

These subassemblies are reusable. "LockLBWheel" can be reused for "Truck".

But throw variants into this kind of representation and there is a combinatorial explosion of such restriction classes in multiple part hierarchies.

The invention was to transform the M0 model from individuals to sequences of individuals, e.g. (car, wheel, hub, lock lug bolt) is an individual in the co-domain of "rimFixed". Semantically, the co-domain is all of the composition paths that lead to some "LockLugBolt". But, for technical reasons, the co-domain also includes (lock lug bolt) for those individual lock lug bolts in the 1-tail of the sequences beginning with car.

This transformation of the interpretation function eliminates the need to define restriction classes in the syntax; they are logically implied by the owned feature structure. A classifier program might elect to undo this transformation and use DL resolution to determine consistency and establish classifications. But in 2019 Conrad Bock and colleagues at NIST used a "satisfiability modulo theory" solver to demonstrate classification and consistency directly for a subset of KerML.

The transformation also allows the KerML model to add owned features to an owned feature without causing a ripple that updates the definitions of the restriction classes. For example, one might add a "torqueSpecification" owned feature to the "rimFix" owned feature. At the M0 level, this merely adds a number value to the end of the sequences for "rimFix: and these new sequences become the interpretation of "torqueSpecification".

Because "rimFix" has this interpretation, it is also a "Classifier" because it classifies these sequences. Under the interpretation function, model elements that are Classifiers become sequences of length 1, where Features are always interpreted as sequences of length > 1. Thus "rimFix" classifies a subset of "LockLugBolt" because its interpretation contains some of the length 1 sequences that are in the interpretation of "LockLugBolt".

The result is that the semantics of KerML corresponds more directly to the abstract and concrete syntax of the language and does not require the generation of a large number of restriction classes to enable a conventional satisfiability technique.

Appendix D. Questionnaire on the "Definitions and Usages" Terminology of SysML v2

The purpose of this questionnaire is to collect anecdotal evidence in favor or against the new "definitions and usages" terminology of SysML v2 by contrasting it with an alternative, more classical terminology. Please try to answer it without being biased in any way.

The following table provides an overview of the two terminologies:

Definitions/Usages TerminologyClassical Terminology
item (part/action/etc.) definitionitem (part/action/etc.) class
item (part/action/etc.) usageitem (part/action/etc.) property
attribute definitiondata type
attribute usageattribute
defined bytyped by

Question 1

Consider the following model sketch about car wheels being composed of a rim and a tire having a size and a load index attribute where the size of a tire is described with the help of three parameters: (rim) diameter, width and height.

???

Which of the following two model descriptions do you find more readable/comprehensible/usable?

Question 2

Consider the following fragments A-C extracted from the SysML2 specification in their original form in item 1 and in their alternative formulation in item 2.

  1. From Section 7.11.2 on parts.

    1. Original: Because the base usage of a part usage is the part usage parts defined by the base part definition Part, every part usage is always directly or indirectly defined by at least one part definition, implicitly if not explicitly, in addition to any other item definitions.
    2. Alternative: Because the base property of a part property is the part property parts typed by the base part class Part, every part property is always directly or indirectly typed by at least one part class, implicitly if not explicitly, in addition to any other item class.
  2. From Section 7.12.1 on ports.

    1. Original: A port usage is a kind of occurrence usage definition that is a usage of a port definition.
    2. Alternative: A port property is a kind of occurrence property that is typed by a port class.
  3. From Section 7.12.1 on ports.

    1. Original: The features of the port usages (whether inherited from its definition or declared locally for the usage) specify what can be exchanged in such interactions. Since ports are themselves kinds of occurrences, port definitions and usages can contain nested port usages.
    2. Alternative: The features of the port properties (whether inherited from its class or declared locally for the property) specify what can be exchanged in such interactions. Since ports are themselves kinds of occurrences, port classes and properties can contain nested port properties.

Which of the two formulations of fragments A-C is more readable/comprehensible?

Area of Expertise

Which is your main area of expertise?

Submit

Appendix E. Excerpts

From the SysML section 7.9.1 Occurrences Overview

Occurrences

The extent of an occurrence in time is known as its lifetime, which covers the period in time from the occurrence's creation to its destruction. An occurrence maintains its identity over its lifetime, while the values of its features may change over time. The lifetime of an occurrence begins when the identity of the occurrence is established, and the lifetime ends when the occurrence loses its identity. For example, the lifetime of a car could begin when it leaves the production-line, or when a vehicle identification number is assigned to the car. Similarly, the lifetime of a car could end when the car is disassembled or demolished.

Time Slices and Snapshots

The lifetime of an occurrence can be partitioned into time slices which correspond to some duration of time. These time slices represent periods or phases of a lifetime, such as the deployment or operational phase. Time slices can be further partitioned into other time slices. For example, the lifetime of a car might be divided into time slices corresponding to its assembly, being in inventory before being sold, and then sequential periods of ownership with different owners. A time slice with zero duration is a snapshot. Start, end and intermediate snapshots can be defined for any time slice to represent particular instants of time in an occurrence's lifetime. For example, the start snapshot of each ownership time slice of a car corresponds to the sale of the car to a new owner, which happens at the same time as the end snapshot of the previous ownership (or inventory) time slice.

Individuals

The lifetime of an individual and any of its time slices can be actual or projected. For example, the individual car Car1 may be purchased as a used car. Car1 has had an actual lifetime up to that time. A mechanic may perform diagnostics and obtain some measurements, and may estimate the remaining life of the car or its parts based on the measurements. For example, the mechanic may estimate the remaining lifetime of the tires, based on the tread measurements and the estimated tire wear rate. At a given point in time, the condition of an individual (sometimes called its "state", which should not be confused with a behavioral state usage, as described in 7.17) can be specified by the values of its attributes. As an example, the condition of car1inOperation at different points in time can be specified in terms of its acceleration, velocity, and position. The condition of the car can continue to change over its lifetime, and can be specified as a function of discrete and/or continuous time.

The Kernel Semantic Library Class Life classifies all Occurrences that are maximal portions, that is, those Occurrences that are not a portion of any other Occurrence. Every Occurrence is a portion of some Life (possibly itself) [...]. An individual Occurrence is modeled as the subclass that includes a single Life and all possible portions (in time and space) of that Life. Colloquially, a Life represents the "identity" of an individual and the totality of its existence in space and time. The required Specializations and sufficiency of a LifeClass mean that it is the subclass of all Lives that are also instances of the owning OccurrenceDefinition.

The zeroOrOne multiplicity of the LifeClass then asserts that the LifeClass has at most a single instance, meaning that there is at most one instance of the owning OccurrenceDefinition that is a Life. If this instance exists, then all other instances of the OccurrenceDefinition will be portions of it, and the OccurrenceDefinition will then model exactly a single individual, as described above. If the instance does not exist, then the extent of OccurrenceDefinition will be empty, meaning no such individual exits. (The optional multiplicity on a LifeClass thus provides for the ability to model counterfactual situations in which a certain individual is asserted not to exist.)

Bibliography

  • Guarino, N., and G. Guizzardi. 2024. Processes as variable embodiments. Synthese vol. 203, article no. 104. https://doi.org/10.1007/s11229-024-04505-2
  • Tauzovich, B. 1991. Toward Temporal extensions of the Entity-Relationship Model. Proceedings of the 10th International Conference on Entity Relationship Approach, San Mateo, California: E-R Institute, pp. 136-179.

Index