Skip to content
SysML v2 (structure) templates

Teaching Case — One Character, Every Direction Reversed

The same fuel system with a single `~` deleted from the pump's inlet. The connection list is byte-identical, the figure is pixel-identical, and every direction in the joint has reversed: `feed` is now `out` at both ends and `spill` is `in` at both, so there are two suppliers, two consumers and nothing transferable. This is the commonest error in hand-written SysML v2 and it is invisible at any zoom. Open it beside the template above.

Template previewSysML v2 (structure)
FuelSysteminterconnectionVehicleinteriortankToPumppumpToEngineFueltank: TankoutletfillPointpump: Pumpinletoutletbaseengine: Engineinletfootfill2 statements in this model contradict others — over 8 definitions, 15 features and 4 connections. 3 of the 13 checks had nothing torun on.ERROR`tankToPump` joins `tank.outlet` to `pump.inlet`, both typed `FuelPort`, and neither end conjugates it. Every directed feature therefore meets its owndirection — `feed` is `out` at both, `spill` is `in` at both — so nothing can move along this line. One end needs `~FuelPort`; the figure looks identicaleither way.ERROR`tankToPump` binds ports that do not conform to `FuelLine`'s ends in either order. The definition declares `supplier : FuelPort` and `consumer :~FuelPort`; this usage binds `tank.outlet` and `pump.inlet`. Reversing them does not help, so this is the wrong connection definition or the wrongports.GAPNo connection joins two related port definitions that share a directed feature, so there was no direction to compare.GAPNothing here redefines anything, so there was no replacement to verify.GAPNothing here redefines a feature a supertype declares, so there was no narrowing to verify.OKAll 17 declared types resolve to a definition in this document, so every check below had the definition it needed to read.OKAll 8 connection ends resolve to a feature that exists, so every line drawn lands on something the document declares.OKThe one flow leaves a feature that can emit and arrives at one that can accept, conjugation included.OKThe one payload conforms to what its destination accepts, by a specialization this document declares.OKAll 8 ports are named by a connection, interface or flow.OKThe one inbound item at a composite part's boundary continues to something inside.OKThe composition tree over 4 part definitions is acyclic, so every definition here can be built. References were excluded, correctly: a reference cycle isan ordinary bidirectional association.OKEvery line was read and no cap bit: the 8 definitions above are the whole document, so the counts are totals rather than floors.

Make it your own.

package FuelSystem {

  item def Fuel;
  port def MountPoint;

  port def FuelPort {
    out item feed  : Fuel;
    in  item spill : Fuel;
  }

  interface def FuelLine {
    end supplier : FuelPort;
    end consumer : ~FuelPort;
  }

  part def Tank {
    port outlet    : FuelPort;
    port fillPoint : ~FuelPort;
  }

  part def Pump {
    // The defect, and the whole of it: this should read `~FuelPort`.
    port inlet  : FuelPort;
    port outlet : FuelPort;
    port base   : MountPoint;
  }

  part def Engine {
    port inlet : ~FuelPort;
    port foot  : MountPoint;
  }

  part def Vehicle {
    port fill : ~FuelPort;

    part tank   : Tank;
    part pump   : Pump;
    part engine : Engine;

    interface tankToPump   : FuelLine connect tank.outlet  to pump.inlet;
    interface pumpToEngine : FuelLine connect pump.outlet  to engine.inlet;

    connect pump.base to engine.foot;

    flow of Fuel from fill.feed to tank.fillPoint.feed;
  }
}