Skip to content

ST6TI-981 Move feature-chain source-target creation from derived queries to explicit model preparation - #822

Open
adaussy wants to merge 4 commits into
masterfrom
ST6RI-981
Open

adaussy wants to merge 4 commits into
masterfrom
ST6RI-981

Conversation

@adaussy

@adaussy adaussy commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Similarly to changes made in PRs #815 and #818, this PR moves functionality for completing the abstract syntax of a FeatureChainExpression from its transformation adapter to its parse post-processor.

Background

A FeatureChainExpression has the form src.f.g.h, where src is an expression and f.g.h is a feature chain that is applied to the result of src. Semantically, an expression of this form is equivalently to

expr : ControlFunctions::'.' subsets Performances::evaluations {
    feature redefines ControlFunctions::'.'::source = src {
        feature redefines ControlFunctions::'.'::source::target
            redefines tgt;
    }
    feature tgt chains f.g.h;
    return subsets source.tgt;
}

(see KerML, 8.4.4.9.6 Operator Expressions/Control Functions). Previously, this structure was created for a FeatureChainExpression in roughly three steps:

  1. Parse the textual into the outer expression containing an empty owned feature bound to the src expression and a feature for the tgt feature chain.
  2. During transformation, create (via FeatureChainExpressionAdapter.addAdditionalMembers) a nested feature under the expression’s source parameter when none exists.
  3. Add all the implied specializations (as shown above).

The problem is that creation of the sourceTarget feature created in step 2 can also be triggered indirectly by a derived-property query, if the addAdditionalMembers mechanism is to be used, which is to be avoided.

Objectives

  • Preserve feature-chain semantics.
  • Make structural preparation explicit.
  • Keep derived queries free of structural mutations.

Change

  • The computation of the sourceTarget feature (step 2 above) has been moved from FeatureChainExpressionAdapter to FeatureChainExpressionParserPostProcessing.

@AxelRICHARD AxelRICHARD added this to the 2026-10 milestone Oct 27, 2026
@AxelRICHARD
AxelRICHARD requested a review from seidewitz October 28, 2026 15:08
@seidewitz seidewitz self-assigned this Nov 2, 2026
- Following abstract syntax class hierarchy, extends
InstantiationExpressionParserPostProcessor and is extended by
FeatureChainExpressionParserPostProcessor.

- Also reverted ExpressionParserPostProcessor to previous version.

@seidewitz seidewitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added two more commits. Tests still pass. Please review.

@adaussy adaussy left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a small problem on headers.

/*******************************************************************************
* SysML 2 Pilot Implementation
* Copyright (c) 2026 Model Driven Solutions, Inc.
* Copyright (c) 2026 Obeo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this copyright ?

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.

3 participants