SysML v2 Deep Dive 4 min read

Lesson 9: The Power of Conjugation

The Magic Tilde ~

In SysML v1, conjugation was already a defined concept. Originally, it relied on a UML boolean property (isConjugated=true). Later, SysML v1.6 introduced the formally defined ~InterfaceBlock stereotype (pronounced "conjugated interface block") to explicitly reverse the direction of FlowProperties and DirectedFeatures without requiring manual duplication.

However, because SysML v1 was a profile built on top of UML, this was achieved via constraints that mandated tools to automatically generate these inverted features via stereotypes.

SysML v2 elevates conjugation from a profile stereotype to a native component of the language's abstract syntax and formal semantics. Instead of using FlowProperties inside an InterfaceBlock, SysML v2 utilizes standard Directed Features (features marked as in, out, or inout) directly inside a port def.

Textual Notation

Let's build a High-Voltage Charging System. Notice we only write the ChargingPort definition once.

package ChargingSystem {
    // 1. Import the standard International System of Quantities library
    import ISQ::*;

    // Define the data payload
    item def PaymentData;

    // 2. Define a specific port purely for electrical power
    port def PowerPort {
        // Using the standard ISQ library for the quantity kind
        out attribute transferredEnergy : EnergyValue;
    }

    // 3. Define a specific port purely for communication
    port def DataPort {
        in item paymentInfo : PaymentData;
    }

    // 4. Combine them into a composite port (representing the physical plug)
    port def ChargingPort {
        port powerPin : PowerPort;
        port dataPin  : DataPort;
    }

    // 5. System Usage
    part def SuperCharger {
        port plug : ChargingPort;
    }

    part def ElectricVehicle {
        // Conjugating the composite port automatically flips
        // the directions for BOTH the powerPin and dataPin!
        port socket : ~ChargingPort;
    }
}

Graphical Notation

lesson-9

Understanding the Textual Notation

From the charger’s perspective, electrical energy flows out, and payment authorization data flows in.

The charger then uses the port exactly as defined:

part def SuperCharger { port plug : ChargingPort; }

However, from the vehicle’s perspective, the electrical energy flows in, and the payment data flows out.

So the vehicle uses the conjugated form:

part def ElectricVehicle { port socket : ~ChargingPort; }

For the vehicle, the exact same nested ports and directed features are present, but their directions are mathematically reversed. Energy comes into the socket's power pin, and payment information goes out of the data pin.

We did not create a second port definition. We used one definition from two complementary perspectives.

Deep Dive: The Abstract Syntax of Conjugation

  • In SysML v2, you do not just visually tag a port as conjugated; the language dynamically constructs the conjugated type in the mathematical background.
  • According to the SysML v2 abstract syntax, every port def implicitly declares a single, nested ConjugatedPortDefinition. This generated definition inherits all the features of the original port, but its directed features are mathematically reversed via a PortConjugation relationship: in becomes out, and out becomes in. (The direction inout is its own conjugate and remains unchanged).
  • The name of this generated definition is exactly the name of the original port with a tilde (~) prepended. For example, if you define a port named ChargingPort, the SysML v2 tool automatically builds a conjugated definition uniquely identified as ChargingPort::'~ChargingPort'.
  • When you type a usage with a tilde (e.g., port socket : ~ChargingPort), it is a concrete syntax shorthand that binds the usage directly to this generated, inverted ConjugatedPortDefinition.

V1 vs. V2 Cheat Sheet

ConceptSysML v1SysML v2
Conjugation MechanismUsed the ~InterfaceBlock stereotype, which applied constraints to reverse the feature directions of the original block. (The older UML isConjugated=true property on ports was deprecated).A native PortConjugation relationship in the abstract syntax. Every port def automatically contains a ConjugatedPortDefinition.
Flow SemanticsHandled using FlowProperty elements (with in, out, inout directions) owned by Blocks or Interface Blocks.Handled using standard Directed Features. Any usage (attributes, items, parts) can be preceded by in, out, or inout keywords.

Next Lesson

In the next lesson, we will look at the connection itself. In SysML v2, the "wire" between ports is a first-class structural definition. We will explore how an interface def acts as a blueprint, allowing you to specify connection ends and give the connection medium its own physical attributes.

SysML v2

SysModeler Team

Engineering & Product