Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
114 stars 23 forks source link

ST6RI-685 Update KerML validation based on normative validation constraints #486

Closed seidewitz closed 11 months ago

seidewitz commented 11 months ago

This pull request implements validation constraints that are in the KerML 1.0 Beta 1 abstract syntax, but which were not previously implemented in the pilot implementation. In addition, the org.omg.kerml.xtext.KerMLValidator.xtend class has been reorganized so that there is one check method per metclass, with each validation constraint for the metaclass checked within that method. Further, the normative constraint names are now used as the error codes for the corresponding validation checks.

The following newly implemented constraints could potentially result in errors being flagged in models where they had not been before.

  1. validateSpecializationSpecificNotConjugated
  2. validateTypeAtMostOneConjugator
  3. validateTypeDifferencingTypesNotSelf
  4. validateTypeIntersectingTypesNotSelf
  5. validateTypeUnioningTypesNotSelf
  6. validateFeatureChainingFeaturesNotSelf
  7. validateDataTypeSpecialization
  8. validateClassSpecialization
  9. validateAssociationBinarySpecialization
  10. validateBindingConnectorIsBinary
  11. validateConnectorBinarySpecialization
  12. validateExpressionResultParameterMembership
  13. validateFunctionResultParameterMembership
  14. validateMultiplicityRangeBoundResultTypes

The following constraints are automatically satisfied by models parsed from the textual notation. However, they have been implemented anyway, because it is possible that they might be violated due to modifications made directly on the abstract syntax representation of a model.

  1. validateElementIsImpliedIncluded
  2. validateClassifierMultiplicityDomain
  3. validateFeatureMultiplicityDomain
  4. validateParameterMembershipOwningType
  5. validateResultExpressionMembershipOwningType
  6. validateReturnParameterMembershipOwningType
  7. validateItemFlowItemFeature
  8. validateItemFlowEndNestedFeature
  9. validateItemFlowEndOwningType

There are also validation checks that are implemented in the pilot implementation but are not currently in the Beta 1 specification. Certain of these have been proposed to the KerML Finalization Task Force for inclusion in the final specification (see KERML-20). They are identified in the validator code with TODO: Add... comments (meaning to be "added" to the specification).