SysML v2 Deep Dive 5 min read

Lesson 13: Specialization vs. Redefinition

Specialization vs. Redefinition

In SysML v1, a Generalization relationship could establish that one Block inherited from another. To make a local change to an inherited property, modelers used UML property strings like {redefines engine} or {subsets engine}. While effective, these were textual tags appended to UML properties.

SysML v2 streamlines this by elevating these concepts to primary mathematical operators, rather than relying on UML profile string tags. By mastering how to say ‘an element is typed by a definition (:)’, ‘specializes a definition (:>)’, or ‘redefines an inherited feature (:>>)’, we can accurately capture the exact engineering intent.

The Concept: Type (:) vs. Inherit (:>) vs. Replace (:>>)

  1. : (Defined By): "I am defined by X." This establishes Feature Typing. It is used to type a usage element by a definition (e.g., part myEngine : Engine).
  2. :> (Specializes/Subsets): "I am a specific kind of X." This symbol covers Subclassification (for Definitions) and Subsetting (for Usages). The specific element inherits features and constraints from the general element.
  3. :>> (Redefines): "I am replacing and narrowing the inherited feature X." This is Redefinition. It allows a feature to replace an inherited one, narrowing its multiplicity or type within the new context.

The Code: Evolution of the Engine

Let's define a generic engine, then evolve it into a high-performance V8 using these operators.

package AutomotiveDesign {
    private import ISQ::*; // Standard Units
    private import ScalarValues::*; // Base datatypes (Integer)
    private import SI::*; // Base measurement units (W, kW)

    // 1. The Base Definition
    part def Engine {
        // A generic engine has unspecified horsepower and cylinder count
        attribute horsepower : PowerValue;
        attribute cylinderCount : Integer;

        // A constraint definition usage serving as a structural invariant.
        // We declare a constraint stating that power must be positive.
        constraint validPower { horsepower > 0[W] }
    }

    // 2. Specialization (:>)
    // V8_Engine INHERITS everything from Engine.
    // Note: ':>' is used between Definitions (Classifiers).
    part def V8_Engine :> Engine {

        // 3. Redefinition (:>>)
        // We don't create a random new attribute named cylinderCount.
        // We REDEFINE the one we inherited to lock it to 8.
        attribute :>> cylinderCount = 8;

        // We add a new constraint specific to this subclass.
        constraint highPerformance { horsepower >= 300 [kW] } // (using SI units for precision)
    }
}

Graphical Notation

12.sysml (1)

Deep Dive: Redefinition Semantics (:>>)

  1. Local Modification, Global Integrity: When you write attribute :>> cylinderCount, you are creating a redefining feature usage within V8_Engine. Crucially, this does not mutate the parent Engine definition globally. The generic Engine remains unchanged; the restriction only exists within the scope of the V8_Engine.
  2. Specialization (:>) vs. Subsetting (subsets): It is vital to distinguish how this symbol behaves in different contexts:
  3. Consistency Required: Redefinition requires the new definition to be consistent with the parent (e.g., narrowing the range of values). You cannot redefine cylinderCount to be a String if the parent defined it as an Integer; that would violate the underlying typing rules of KerML.

Recursive Parts Tree Subsetting & Reuse

One of the most powerful and unique features of SysML v2 is that nested usages can be recursively redefined. This enables us to clone and modify complex parts-tree assemblies without constantly declaring entirely new decomposition trees from scratch.

Suppose we have a baseline system definition called Vehicle which instantiates a composite gearbox of type Transmission.

We can declare a specialized system definition, SportUtilityVehicle :> Vehicle. By specializing the parent definition, SportUtilityVehicle automatically inherits the entire physical decomposition tree of the base Vehicle (including the inherited gearbox and the curbWeight attribute).

Instead of accepting the baseline powertrain as is, we can recursively reach into the inherited structure to redefine nested components. We do this by declaring part :>> gearbox : DualClutchTransmission, which overrides the baseline gearbox with a specialized transmission type. Inside this nested scope, we further refine inherited parameters—such as binding the maximum torque limit directly to 450.0 ['N*m'].

This multi-level chain of specialization and redefinition provides an incredibly robust, type-safe mechanism for modeling complex product variant configurations.

package DrivetrainProductLine {
    private import ISQ::*;
    private import SI::*;
    private import ScalarValues::*;

    part def GearSet {
        attribute mass : MassValue;
        attribute gearRatio : Real[1..*];
    }

    part def Transmission {
        attribute dryMass : MassValue;
        attribute maxTorqueRating : TorqueValue;

        // Baseline composite feature
        part internalGears : GearSet;
    }

    // DualClutchTransmission subclasses and inherits from Transmission
    part def DualClutchTransmission :> Transmission {
        attribute clutchPlateCount : Integer = 2;

        // Redefining the inherited 'internalGears' to restrict its type and parameters
        part :>> internalGears : DualClutchGearSet {
            // Constraining the inherited gear ratio array size to exactly 7
            attribute :>> gearRatio : Real[7];
        }
    }

    // Specialized GearSet subclassing the baseline GearSet
    part def DualClutchGearSet :> GearSet {
        attribute dualShaftSyncTime : TimeValue = 0.015 ['s'];
    }

    part def Vehicle {
        attribute curbWeight : MassValue;

        // Base vehicle instantiates a standard transmission
        part gearbox : Transmission;
    }

    // Specialized vehicle definition subclassing Vehicle
    part def SportUtilityVehicle :> Vehicle {
        // Redefining the inherited gearbox usage to utilize the DualClutchTransmission definition
        part :>> gearbox : DualClutchTransmission {
            // Locally binding and refining the inherited torque ratings
            attribute :>> maxTorqueRating = 450.0 [N*m];
        }
    }
}

V1 vs. V2 Cheat Sheet

ConceptSysML v1SysML v2
Definition inheritanceGeneralization relationship between Blocks.Specialization with :> between definitions.
Changing inherited featureAppending a {redefines <propertyName>} string to a property, which acted as a property modifier.Explicit local redefinition using :>> operator.
Specific typed elementA Part Property (or Reference Property) typed by a Block.Usage typed directly with :, such as part myEngine : Engine.

The main lesson is simple: : (Feature Typing) binds a usage to a definition, giving it its type. :> (Specialization/Subsetting) says a definition specializes another definition, or a usage subsets another usage. :>> (Redefinition) says an inherited feature is being redefined in a compatible, more specific context.

Next Lesson

We will tackle Multiplicity & Cardinality. How do we handle arrays (e.g., wheels) and optional components (e.g., driver[0..1]) directly in the text string?

SysML v2

SysModeler Team

Engineering & Product