Skip to content

Subsetting uniqueness conformance is not checked for an implicit subsetting #726

Description

@someshSandbox

validateSubsettingUniquenessConformance is checked for a subsetting written in the source (:>, subsets), but not for one the feature gets implicitly.

package N {
    action def A {
        action b[*] nonunique;
    }
}

b is a composite action owned by an action definition, so it implicitly subsets Actions::Action::subactions (checkActionUsageSubactionSpecialization). subactions is declared Action[0..*] with no nonunique (Systems Library/Actions.sysml:57), so it is unique, and a nonunique b cannot subset it.

model sysml -validate (develop d9a97d6d8) expected (validateSubsettingUniquenessConformance)
action b[*] nonunique; no errors the same error, at b: its implicit subsetting of subactions breaks the constraint
action b[*] nonunique :> subactions; 3:34: error: Subsetting/redefining feature cannot be nonunique if subsetted/redefined feature is unique this error
action b[*]; no errors no errors

The constraint is on the Subsetting, and an implied Subsetting is one too. Model.ConformanceViolations (internal/semantic/semantics/redefinition_conformance.go) walks only the written RelSubsets/RelRedefines relationships, plus the positional parameter counterparts for direction. validation-constraints.md lists the constraint as faithful, with only the written case (xpect/p04-nonunique-subsets-unique.kerml).

Other implicit subsettings of a unique library feature would be missed the same way. Examples are the other subactions-style features in Actions.sysml and Transfer::payload (Anything[1..*]) for a flow's payload.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions