Skip to content
SysML v2 (structure) templates

Teaching Case — An Interface Bound the Wrong Way Round

A drawn line has no ends. `connect pump.inlet to tank.outlet` and `connect tank.outlet to pump.inlet` are the same segment between the same two squares, and the definition that says which port belongs at which end is on another page. The engine evaluates the conformance predicate twice — in declared order and reversed — so it can say specifically that the ends are swapped and that exchanging them fixes it, rather than only that something does not conform.

Template previewSysML v2 (structure)
HydraulicsinterconnectionRiginteriorsupplyactuator: Actuatorfeedreservoir: Reservoiroutlet1 statement in this model contradicts another — over 6 definitions, 8 features and 1connection. 6 of the 13 checks had nothing to run on.ERROR`supply` binds its ends the wrong way round: `SupplyLine` declares `source : SupplyPort` and`sink : ~SupplyPort` in that order, and swapping the two paths in this usage makes every endconform. The drawn line is the same segment between the same two squares either way.GAPNo connection joins two related port definitions that share a directed feature, so there was nodirection to compare.GAPNo flow is declared here, so there was no direction to check.GAPNo flow here declares a payload, so there was nothing to compare against a destination.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 9 declared types resolve to a definition in this document, so every check below had thedefinition it needed to read.OKAll 2 connection ends resolve to a feature that exists, so every line drawn lands on something thedocument declares.OKThe one connection between two ports of one definition opposes them, or joins a port with nodirection to get backwards. Connections between ports of DIFFERENT definitions are the nextcheck's business, not this one's.OKAll 2 ports are named by a connection, interface or flow.OKThe composition tree over 3 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 6 definitions above are the whole document, so thecounts are totals rather than floors.

Make it your own.

package Hydraulics {

  item def Fluid;

  port def SupplyPort {
    out item flowOut : Fluid;
    in  item retIn   : Fluid;
  }

  interface def SupplyLine {
    end source : SupplyPort;
    end sink   : ~SupplyPort;
  }

  part def Reservoir { port outlet : SupplyPort; }
  part def Actuator  { port feed   : ~SupplyPort; }

  part def Rig {
    part reservoir : Reservoir;
    part actuator  : Actuator;

    // Swapped. The definition declares source first; this binds the sink
    // there. The line drawn is identical either way.
    interface supply : SupplyLine connect actuator.feed to reservoir.outlet;
  }
}