Skip to content
SysML v2 (structure) templates

Teaching Case — An Arrow Carrying the Wrong Thing

A flow declares what it carries and the feature it arrives at declares what it accepts, and the arrow is identical whether or not those agree. Here coolant is routed into a port that accepts fuel. Conformance is decided by the `:>` declarations in the document and by nothing else — not by the names looking alike, not by the two types having similar features — so `Petrol` reaching a `Fuel` port passes because the document says `Petrol :> Fuel`, and `Coolant` reaching the same port does not.

Template previewSysML v2 (structure)
ThermalinterconnectionBayinteriorPetrolCoolantCoolantpetrolPump: PetrolPumpoutletcoolantPump: CoolantPumpoutletburner: Burnerinletsump: Sumpinlet1 statement in this model contradicts another — over 11 definitions, 10 features and 3connections. 6 of the 13 checks had nothing to run on.ERRORThe flow on line 30 carries `Coolant` to `burner.inlet.charge`, which accepts `Fuel`, and nothingin this document declares that `Coolant` specializes it. The arrow is identical either way and thepayload label is small type beside a line.GAPNo connection here joins two ports of one definition, so there was no conjugation to check.GAPNo connection joins two related port definitions that share a directed feature, so there was nodirection to compare.GAPNo connection here names a definition with declared ends, so there was no end order or arity tocheck.GAPNo composite part here declares a boundary port that accepts anything, so there was no arrivalto route.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 13 declared types resolve to a definition in this document, so every check below had thedefinition it needed to read.OKAll 6 connection ends resolve to a feature that exists, so every line drawn lands on something thedocument declares.OKAll 3 flows leave a feature that can emit and arrive at one that can accept, conjugation included.OKAll 4 ports are named by a connection, interface or flow.OKThe composition tree over 5 part definitions is acyclic, so every definition here can be built.References were excluded, correctly: a reference cycle is an ordinary bidirectional association.OKEvery line was read and no cap bit: the 11 definitions above are the whole document, so thecounts are totals rather than floors.

Make it your own.

package Thermal {

  item def Fluid;
  item def Fuel    :> Fluid;
  item def Petrol  :> Fuel;
  item def Coolant :> Fluid;

  port def FuelInlet    { in item charge : Fuel; }
  port def GenericInlet { in item charge : Fluid; }

  part def PetrolPump  { port outlet : ~FuelInlet; }
  part def CoolantPump { port outlet : ~FuelInlet; }
  part def Burner      { port inlet  : FuelInlet; }
  part def Sump        { port inlet  : GenericInlet; }

  part def Bay {
    part petrolPump  : PetrolPump;
    part coolantPump : CoolantPump;
    part burner      : Burner;
    part sump        : Sump;

    // Correct: the document declares Petrol :> Fuel.
    flow of Petrol from petrolPump.outlet.charge to burner.inlet.charge;

    // Correct: Coolant :> Fluid, and the sump accepts Fluid.
    flow of Coolant from coolantPump.outlet.charge to sump.inlet.charge;

    // Wrong, and drawn identically: the burner accepts Fuel, and nothing
    // declares that Coolant specializes it.
    flow of Coolant from coolantPump.outlet.charge to burner.inlet.charge;
  }
}