Skip to content

Count inherited return parameters in the result-parameter rules - #22

Open
mbrunnen wants to merge 1 commit into
Open-MBEE:mainfrom
mbrunnen:inherited-return-parameters
Open

mbrunnen wants to merge 1 commit into
Open-MBEE:mainfrom
mbrunnen:inherited-return-parameters

Conversation

@mbrunnen

@mbrunnen mbrunnen commented Nov 7, 2026

Copy link
Copy Markdown

Fixes #21.

validateFunctionResultParameterMembership and
validateExpressionResultParameterMembership now count the return
parameters of the most specific owners in the closure of the type, not only
the owned ones. An owned return parameter redefines those of the general
types, so function K :> F, H { return t; } stays valid.

How to test

$ cargo test -p sysmlv2-model --lib inherited_return_parameters_count
$ cargo test -p sysmlv2-parser --test integration opensysml::

Look closely at

  • Owners in the library are left out. The check facts hold no implied
    specializations, so two library bases look unrelated: checked as user
    files, the Systems Library gives 13 false findings in Requirements.sysml,
    VerificationCases.sysml and Views.sysml. As a result,
    function G :> LibF, H, with a return in a library function and in a user
    function, is still missed. A full fix needs the implied supertypes in the
    facts.
  • The opensysml baselines gain one finding on
    probes/validateCalculationUsageType.sysml: calc c : C1, C2; inherits a
    return parameter from each type. The corpus findings
    (spec-refs/SysML-v2-Release, apollo-11-sysml-v2) do not change.
  • The CHANGELOG.md entry is under a new Unreleased heading. Move or drop
    it as you prefer.

KerML 8.3.4.7.3 and 8.3.4.7.4 count the owned and the inherited return
parameters, so `function G :> F, H;` with a return in each general
violates validateFunctionResultParameterMembership. Only the most
specific owners count, because an owned return parameter redefines those
of the general types. Owners in the library are left out: the checks do
not read the implied specializations to library bases, and without them
two library bases look unrelated.

The opensysml baselines gain the new finding on `calc c : C1, C2;`, which
inherits a return parameter from each type.
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.

check misses inherited return parameters (validateFunctionResultParameterMembership, validateExpressionResultParameterMembership)

1 participant