KerML 1.0b4 FTF Avatar
  1. OMG Issue

KERML_ — CheckFeatureChainExpressionResultSpecialization constraint needs to be defined

  • Key: KERML_-99
  • Status: closed  
  • Source: Dassault Systemes ( Mr. Andrius Armonas)
  • Summary:

    The pilot implementation creates a Subsetting from FeatureChainExpression.result to FeatureChainExpression.targetFeature in this example:

    package Q {
      part def F {
           part a : A;
      }
      
      part f : F;
      
      part def A {
        part g = f.a;
      }
    }
    

    The line part g = f.a parses into:

    This is very similar to CheckFeatureResultSpecialization, but there is no CheckFeatureChainExpressionResultSpecialization constraint in the specification defined which would cover this case.

  • Reported: KerML 1.0b2 — Tue, 30 Jul 2024 12:15 GMT
  • Disposition: Resolved — KerML 1.0b4
  • Disposition Summary:

    Add semantic constraint checkFeatureChainExpressionResultSpecialization

    It is agreed that there should be a semantic constraint for the purpose described in the issue. The similar existing constraint is actually checkFeatureFeatureReferenceResultSpecialization, which is a constraint on Feature. But it makes more sense for the new constraint to be directly on FeatureChainExpression, rather than being another constraint on the Core metaclass Feature that, nevertheless, supports Kernel semantics. Indeed, it also makes sense to move checkFeatureFeatureReferenceResultSpecialization from Feature to FeatureReferenceExpression.

    So, this resolution does the following:

    1. Replaces the existing constraint checkFeatureFeatureReferenceResultSpecialization on Feature with the constraint checkFeatureReferenceExpressionResultSpecialization on FeatureReferenceExpression.
    2. Adds the new constraint checkFeatureChainExpressionResultSpecialization on FeatureChainExpression. However, this constraint cannot simply require that the result of a FeatureChainExpression specialize the targetFeature of the FeatureChainExpression, because that would not have the correct FeaturingType. Instead, it must specialize the specialized feature chain evaluated by the FeatureChainExpression, which is the chain of the first input parameter (the source parameter) of the FeatureChainExpression and the ownedFeature of that parameter (as returned by the operation FeatureChainExpression::sourceTarget()).
    3. Adds the missing constraint validateFeatureChainExpressionOperator, requiring that the operator of a FeatureChainExpression always be '.'.
  • Updated: Sat, 19 Jul 2025 18:58 GMT
  • Attachments:
    • p.png 294 kB (image/png)