saeaadl / aadlv2.2

SAE AADL core language, version 2.2
1 stars 0 forks source link

Flow specifications cannot connect to a feature in an array #43

Open lwrage opened 4 years ago

lwrage commented 4 years ago

The syntax rule flow_feature_identifier doesn't allow array indices. There is also no property that would allow declaration of a flow spec pattern (exists for connections only).

yoogx commented 4 years ago

As discussed in Toulouse, editorial, please propose an update to the grammar.

lwrage commented 4 years ago

The current rule is

flow_feature_identifier ::=
    feature_identifier 
    | feature_group_identifier
    | feature_group_identifier . feature_identifier
    | feature_group_identifier . feature_group_identifier 
    | subprogram_access_identifier . parameter_identifier 

There's a comment in Peter's document version that the parameter identifier should be optional, and for #29 it needs to be changed, too:

flow_feature_identifier ::=
      { feature_group_identifier . }* feature_identifier
    | { feature_group_identifier . }* feature_group_identifier 
    | subprogram_access_identifier [ . parameter_identifier ] 

Adding array indices

On each level there can be (one dimensional) arrays of features. To reach into an array we need to be able to optionally specify an array index.

flow_feature_identifier ::=
      { feature_group_identifier [ array_dimension ] . }* 
          ( feature_identifier | feature_group_identifier) [ array_dimension ]
    | subprogram_access_identifier [ array_dimension ] 
          [ . parameter_identifier [ array_dimension ] ]

This is different from connections, where array indices are given as property values.

~Making properties Connection_Pattern and Connection_Set applicable to flows and using these properties to select the indices does not work because flow implementations cannot have property associations.~ The previous sentence is not relevant as it only necessary to allow array indices in flow specifications.

jjhugues commented 4 years ago

Proposed resolution

lwrage commented 3 years ago

I have completed a prototype implementation.

Example model

package P1
public

    feature group fgt1
        features
            fg2: feature group fgt2;
    end fgt1;

    feature group fgt2
        features
            f3: in feature;
    end fgt2;

    system S
    end S;

    system implementation S.i
        subcomponents
            p: system producer;
            sub: system S1;
            c: system consumer;
        connections
            c1: feature group p.fg1 -> sub.fg1;
            c2: feature group p.fg2 -> sub.fg2;
            c3: feature p.f3 -> sub.f3;
            c4: port sub.fo -> c.fi; 
        flows
            e1: end to end flow p -> c3 -> sub.fp3 -> c4 -> c;
    end S.i;

    system S1
        features
            fg1: feature group fgt1;
            fg2: feature group fgt2[3];
            f3: in feature; 
            fo: out data port[3];
        flows
            fp1: flow path f3 -> fo[1];
            fp2: flow path fg2[2].f3 -> fo[2];
            fp3: flow path fg1.fg2.f3 -> fo[3];
    end S1;

    system producer
        features
            fg1: feature group inverse of fgt1;
            fg2: feature group inverse of fgt2[3];
            f3: out feature; 
    end producer;

    system consumer
        features
            fi: in data port[3];
    end consumer;
end P1;

However, with the proposal above, flow specifications would be the only place in AADL outside of property associations where we use indices directly to refer too array elements. (In OSATE this would require significant changes to the graphical editor.)

For consistency it would be preferable to specify array indices using properties, similar to how it is done for connections. This is possible because it is sufficient to allow array indices for flow specifications in leaf elements and flow specifications can have property associations.

jjhugues commented 3 years ago

[ ] Document the approach with a property in the standard

Evaluate impact on OSATE and document whether this is supported or not in the flow latency analysis

jjhugues commented 3 years ago

Such change would break the graphical editor.

jjhugues commented 2 years ago

Option to use properties has been added to the document by Lutz