feature-cross-feature-specialization

Available in: KerML, SysML

This checks that cross features specialize cross features of the redefined features of the crossing features.

Specification

If this Feature has a cross_feature, then, for any Feature that is redefined by this Feature, the cross_feature must specialize the cross_feature of the redefined end Feature, if this exists.

Example

attribute def C;
a {
    end [1] attribute b : C;
    end [1] attribute c : C;
}
b :> a {
    end [1] attribute b { attribute c : C; }
    end attribute c : C => b.c; // error
}

Because cross subsettings must chain exactly two features, it is impossible to satisfy all the constraints by using explicit cross subsettings. Instead, use owned cross features that will create implicit cross subsettings:

attribute def C;
a {
    end [1] attribute b : C;
    end [1] attribute c : C;
}
b :> a {
    end [1] attribute b { attribute c : C; }
    end [1] attribute c : C; // ok
}