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.
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;
}
}