Skip to content
SysML v2 (structure) templates

Teaching Case — What a Library This Engine Does Not Carry Looks Like

The most important template in this set, and nothing in it is wrong. Every real SysML v2 model opens with `import ISQ::*`, and the quantity kinds it brings live in a model library shipped with the standard that this engine does not carry. So `ISQ::MassValue` is reported as a GAP with the reason — not as an error against a type that is perfectly correct, and not as a pass on a name that was never checked. Delete the import line and the same names become hard findings, because then nothing could have supplied them. Same model, two honest answers, and collapsing them in either direction is how a checking tool gets switched off in an afternoon.

Template previewSysML v2 (structure)
PowertraininterconnectionDrivelineinteriorTorquemotor: Motoroutputgearbox: GearboxinputoutputwheelEndEvery one of the 8 checks that had something to run on came back clean, over 5 definitions, 11features and 2 connections. The other 5 found nothing to examine — that is silence, not a pass.GAP`Powertrain::Motor::mass` is an attribute typed `ISQ::MassValue`: `ISQ::MassValue` is qualified by`ISQ`, which this document does not declare and this engine does not carry, so whether that definitionexists was not decided. That type is unchecked, not confirmed — and so is everything downstream of it.GAP`Powertrain::Motor::peakPower` is an attribute typed `ISQ::PowerValue`: `ISQ::PowerValue` is qualifiedby `ISQ`, which this document does not declare and this engine does not carry, so whether thatdefinition exists was not decided. That type is unchecked, not confirmed — and so is everythingdownstream of it.GAP`Powertrain::Gearbox::mass` is an attribute typed `ISQ::MassValue`: `ISQ::MassValue` is qualified by`ISQ`, which this document does not declare and this engine does not carry, so whether that definitionexists was not decided. That type is unchecked, not confirmed — and so is everything downstream of it.GAP`Powertrain::Gearbox::ratio` is an attribute typed `Real`: `Real` is not declared here, and wildcardimports of ISQ, SI may supply it — this engine carries no model of them, so whether that definitionexists was not decided. That type is unchecked, not confirmed — and so is everything downstream of it.GAPNo connection joins two related port definitions that share a directed feature, so there was no directionto compare.GAPNo connection here names a definition with declared ends, so there was no end order or arity to check.GAPNo composite part here declares a boundary port that accepts anything, so there was no arrival toroute.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 7 declared types resolve to a definition in this document, so every check below had the definition itneeded to read.OKAll 4 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 no directionto get backwards. Connections between ports of DIFFERENT definitions are the next check's business,not this one's.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 4 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. Referenceswere excluded, correctly: a reference cycle is an ordinary bidirectional association.+1 further row is in the analysis and not drawn here; the figure shows the 16 most severe.

Make it your own.

package Powertrain {

  // Shipped with the standard. Not carried here, and said so rather than
  // guessed at in either direction.
  import ISQ::*;
  import SI::*;

  item def Torque;

  port def DriveShaft {
    out item torque : Torque;
  }

  part def Motor {
    port output : DriveShaft;
    attribute mass       : ISQ::MassValue;
    attribute peakPower  : ISQ::PowerValue;
  }

  part def Gearbox {
    port input  : ~DriveShaft;
    port output : DriveShaft;
    attribute mass  : ISQ::MassValue;
    attribute ratio : Real;
  }

  part def Driveline {
    port wheelEnd : DriveShaft;

    part motor   : Motor;
    part gearbox : Gearbox;

    connect motor.output to gearbox.input;
    flow of Torque from gearbox.output.torque to wheelEnd.torque;
  }
}