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
123 stars 24 forks source link

ST6RI-686 Update SysML validation based on normative validation constraints #487

Closed seidewitz closed 1 year ago

seidewitz commented 1 year ago

This pull request implements validation constraints that are in the SysML 2.0 Beta 1 abstract syntax, but which were not previously implemented in the pilot implementation. In addition, the org.omg.sysml.xtext.SysMLValidator.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. validateDefinitionVariationSpecialization
  2. validateUsageVariationSpecialization
  3. validateEventOccurrenceUsageReference
  4. validateOccurrenceUsageIndividualDefinition
  5. validatePortDefinitionOwnedUsagesNotComposite
  6. validatePortUsageNestedUsagesNotComposite
  7. validatePerformActionUsageReference
  8. validateTransitionFeatureMembershipGuardExpression
  9. validateRequirementDefinitionSubjectParameterPosition
  10. validateRequirementUsageSubjectParameterPosition
  11. validateCaseDefinitionSubjectParameterPosition
  12. validateCaseUsageSubjectParameterPosition

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. validateOccurrenceDefinitionLifeClass
  2. validatePortDefinitionConjugatedPortDefinition
  3. validateConjugatedPortDefinitionConjugatedPortDefinition
  4. validateConjugatedPortDefinitionOriginalPortDefinition
  5. validateAcceptActionUsageParameters
  6. validateControlNodeOwningType
  7. validateSendActionUsageParameters
  8. validateStateSubactionMembershipOwningType
  9. validateTransitionFeatureMembershipEffectAction
  10. validateTransitionFeatureMembershipTriggerAction
  11. validateTransitionFeatureMembershipOwningType
  12. validateTransitionUsageParameters
  13. validateTransitionUsageSuccession
  14. validateActorMembershipOwningType
  15. validateFramedConcernMembershipConstraintKind
  16. validateRequirementConstraintMembershipIsComposite
  17. validateRequirementConstraintMembershipOwningType
  18. validateSubjectMembershipOwningType
  19. validateObjectiveIsComposite
  20. validateObjectiveMembershipOwningType
  21. validateRequirementVerificationMembershipOwningType
  22. validateExposeOwningNamespace
  23. validateViewRenderingMembershipOwningType

The following constraints have not been implemented, either for implementation reasons or because there are outstanding specification issues related to them.

  1. validateDefinitionNonVariationMembership (see SYSML2-300)
  2. validateUsageNonVariationMembership (see SYSML2-300)
  3. validateUsageOwningType (see SYSML2-301)
  4. validateAttributeDefinitionFeatures (pending KERML-4)
  5. validateAttributeUsageFeatures (pending KERML-4)
  6. validateControlNodeIncomingSuccessions
  7. validateControlNodeOutgoingSuccessions
  8. validateDecisionNodeIncomingSuccessions
  9. validateDecisionNodeOutgoingSuccessions
  10. validateForkNodeIncomingSuccessions
  11. validateJoinNodeOutgoingSuccessions
  12. validateMergeNodeIncomingSuccessions
  13. validateMergeNodeOutgoingSuccessions
  14. validateStateDefinitionIsParallelGeneralization (see SYSML2-306)
  15. validateStateUsageIsParallelGeneralization (see SYSML2-306)

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 SysML v2 Finalization Task Force for inclusion in the final specification (see SYSML2-28). They are identified in the validator code with TODO: Add... comments (meaning to be "added" to the specification).

The PR also includes the following changes necessary to avoid problems with the new validations:

  1. Updated LifeClassImpl so isSufficient() always returns true.
  2. Updated UsageAdapter to add a subject parameter as the first, rather than last, parameter.
  3. In the standard library model Connections, updated the end features of MessageConnection, FlowConnection and SuccessionFlowConnection to be occurrence usages (see also SYSML2-305).