Skip to content

Comments

ST6RI-872 Library models have inherited member name collisions (KERML11-76, SYSML21-322)#679

Merged
seidewitz merged 8 commits intomasterfrom
ST6RI-872
Jul 30, 2025
Merged

ST6RI-872 Library models have inherited member name collisions (KERML11-76, SYSML21-322)#679
seidewitz merged 8 commits intomasterfrom
ST6RI-872

Conversation

@seidewitz
Copy link
Member

@seidewitz seidewitz commented Jul 26, 2025

This PR resolves diamond inheritance problems that cause name collisions between inherited members of types in several library models. It proactively resolve the following KerML and SysML issues, even though the RTFs have not voted on resolutions yet.

  • KERML11-76 Library models have inherited member name collisions
  • SYSML21-322 Library models have inherited member name collisions

Validation

  • KerMLValidator
    • checkNamespace – Previously, the implementation of checkNamespaceMembershipDistinguishibility did not include checking memberships inherited from different supertypes. It was necessary to implement this checking in order to detect the sort of distinguishibility problems in the library models from KERML11-76 and SYSML21-322 and then to show that they were corrected.

Library Models

Kernel Semantic Library

  • FeatureReferencingPerformances – Added owned redefining features to:

    • BooleanEvaluationResultMonitorPerformance::onOccurrence::monitoredOccurrence
    • BooleanEvaluationResultToMonitorPerformance::monitor1::endWhen (end features)
    • BooleanEvaluationResultToMonitorPerformance::monitor2::endWhen (end features)
  • Objects – Added the following structures nested in StructuredSpaceObject, each with an appropriate owned redefinition of innerSpaceDimension, and used them to type, respectively, StructuredSpaceObject::faces, edges and vertices.

    • StructuredSurface specializes StructuredSpaceObject, Surface
    • StructuredCurve specializes StructuredSpaceObject, Curve
    • StructuredPoint specializes StructuredSpaceObject, Point

    When one of the features faces, edges or vertices is the related element on an end of a connector that has an owned cross feature, one of these structures becomes the type of the cross feature. This ensures that the innerSpaceDimension redefinition is applied in the cross feature.

  • Observation – Added a redefinition of end feature target to step ObserveChange::transfer.

  • Occurrences – Replaced the redefinition of Occurrence::spaceBoundary::isClosed binding it to true with an invariant asserting that it is true. This avoids a name collision in cases when a subset or redefinition of spaceBoundary is typed with a shape that already redefines isClosed.

  • Transfers – Changed the order of specializations of the interaction FlowTransferBefore from FlowTransfer, TransferBefore to TransferBefore, FlowTransfer. This ensures that FlowTransferBefore::self properly resolves to TransferBefore::self, due to the current dependency of name resolution in the Pilot Implementation on the order of specializations.

Kernel Function Library

  • VectorFunctions – Added a redefinition of dimension in the result parameter of CartesianThreeVectorOf.

Systems Library

  • Actions – Added redefinitions of payload in
    • AcceptMessageAction::acceptedMessage
    • SendAction::sentMessage
    • TransitionAction::acceptedMessage
  • Connections– Changed the order of specializations of the connection definition BinaryConnction from Connection, BinaryLinkObject to BinaryLinkObject, Connection. This ensures that BinaryConnection::participant properly resolves to BinaryLinkObject::participant, due to the current dependency of name resolution in the Pilot Implementation on the order of specializations.
  • Flows – Added a redefinition of self in SuccessionFlow.
  • Items
    • Replaced the redefinition of Item::envelopingShapes::innerSpaceDimension binding it to a computed value with an invariant asserting that it equal to that value. This avoids a name collision in cases when a subset or redefinition of envelopingShapes is typed with a shape that already redefines innerSpaceDimension.
    • Made Item::boundingShapes::faces and edges private, so they are not inherited. This avoids name collisions when boundingShapes is redefined and typed with a shape that already redefines faces and/or edges.
    • Made redefinitions of self within Item::boundingShapes referential.
    • Added a redefinition of incomingTransferSort within Items::subitems, but made it private, avoiding name collisions in subsets or redefinitions of subitems (particularly when such subsetting is implied).
  • Metadata – Added a redefinition of self in Metadata::MetadataItem.
  • Parts – Changed the redfinition of this in Part::ownedActions to explicitly redefine both Action::this and ownedPerformances::this.
  • Ports – Redefined the end features source and target in Port::outgoingTransfrsFromSelf.
  • SysML – Added "subsets Metadata::metadataItems" to all item usages. This ensures that the redefinition of self added to Metadata::MetadataItem applies, even if the item usage is typed by KerML Metaobject, rather than MetadataItem.
  • Views – Added a redefinition of this to View::viewpointConformance::viewpointSatisfactions. (But see also SYSML21-323).

Geometry Domain Library

  • ShapeItems
    • Changed the specializations of Path from StructuredSpaceObject, Curve to StructuredSpaceObjct::StructuredCurve.
    • Changed the specializations of Shell from StructuredSpaceObject, Surface to StructuredSpaceObjct::StructuredSurface.
    • Added redefinitions throughout, as necessary.
  • SpatialItems
    • Added the following features to SpatialItem, each with an appropriate owned redefinition of localClock.
      • item subSpatialItems : SpatialItem[1..*] :> subitems
      • part subSpatialParts : SpatialItem[1..*] :> subSpatialItems, subparts
      • part componentParts : SpatialItem[1..*] :> componentItems, subSpatialParts
    • Changed the specialization of componentItems from subitems to subSpatialItems.

Quantities and Units Domain Library

  • SI – Added redefinitions of quantityDimensions to:
    • henry
    • kelvin
    • newton metre
  • USCustomaryUnits - Added redefinition of quantityDimension to:
    • degree Rankine

Requirement Derivation Domain Library

  • DerivationConnections – Removed the redefinition of participant in Derivation to avoid name collision when Derivation is used to type a binary connection, since BinaryConnection already redefines participant.

Backward Incompatibilities

  1. Validation. Existing models may now get distinguishibility warnings that were not previously generated. For example, the following model previously did not cause a warning, but now it does as indicated.
    part def Vehicle {
        part wheels [2..*] : Wheel;
    }
    part def Car :> Vehicle {
        part :>> wheels [3..4];
    }
    part def Truck :> Vehicle {
        part :>> wheels [4..18];
    }
    part def SUV :> Car, Truck; // Warning: Duplicate of inherited member name 'wheel'
    
    The warning can be removed by redefining both Vehicle::wheels and Truck::wheels within SUV:
    part def SUV :> Car, Truck {
        part :>> Car::wheels, Truck::wheels;
    }
    
  2. Spatial items. The item definition SpatialItems::SpatialItem from the Geometry Model Library redefines the feature localClock so that it is typed by Time::Clock from the Quantities and Units Domain Library. However, localClock is also redefined in Occurrences::Occurrence::suboccurrences, which is indirectly specialized by Items::Item::subitems. As a result, declaring a subitem that is a SpatialItem within another SpatialItem now results in a warning.
    item def SpacialItemWithSubitem :> SpatialItem {
        // Warning: Duplicate of inherited name 'localClock' from SpatialItem, suboccurrences
        item aSubItem : SpatialItem; // implied subsetting of subitems
    }
    
    In order to avoid having to further redefine localClock within every such subitem declaration, additional features have been added to SpatialItem:
    • subSpatialItems – Subset this for subitems that are SpatialItems.
    • subSpatialParts – Subset this for subparts that are SpatialItems.
    • componentParts – Subset this for component items that are parts (instead of subsetting componentItems).
    item def SpacialItemWithSubSpacialItems :> SpatialItem {
        item aSubSpaitalItem :> subSpatialItem;
        part aSubSpaitalPart :> subSpatialPart;
    }
    item def SpacitalItemWithComponents :> SpatialItem {
        item aComponentItem :> componentItems; // Per specification
        part aComponentPart :> componentParts;
    }
    

Kernel Semantic Library
- FeatureReferencePerformances
- Objects
- Observation

Kernel Function Library
- VectorFunctions
Mostly, this involved just adding appropriate explicit redefinitions.
But:

- Flows was fixed in part by updating Connections::BinaryConnection and
Transfers::FlowTransferBefore to re-order specializations.

- Usages typed by metadata definitions in SysML were mostly fixed by the
fix to Metadata. However, this did not fix usages typed by KerML
metaobjects. To consistently resolve all problems, "subsets
Metadata::metadataItems" was added to all metadata/metaobject item
usages.

- Views was fixed by adding a redefinition of "this" to
View::viewpointConformance::viewpointSatisfactions, but with a default
of "that.that" (which is basically the default value of "this" for
View::viewpointSatisfactions; but see also SYSML21-323).
Geometry Library
- ShapeItems (also required an update to Objects::StructuredSpaceObject
from the Kernel Semantic Library).

Quantities and Units Library
- SI
- USCustomaryUnits
Also needed to make changes in:
- Occurrences
- Items
- Parts
- SpatialItems
- DerivationConnections
@seidewitz seidewitz self-assigned this Jul 26, 2025
@seidewitz seidewitz added this to the 2025-07 milestone Jul 26, 2025
@seidewitz seidewitz merged commit 55712ce into master Jul 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants