Skip to content

Feature direction is not checked when a feature group is refined to a specific feature group sub-feature in a flow implementation #1991

Description

@AaronGreenhouse

Summary

When a feature group is used as the end point of a flow specification we allow a flow implementation of that spec to replace the feature group with a specific sub-feature of that feature group. Two things

  1. I don't see in the AADL Specification where there is explicitly allowed.
  2. When we do this, the direction of that sub-feature is not checked to be make sure it is compatible with the direction of the flow.

Expected and Current Behavior

I expect an error message on the flow feature specification indicating that the direction of the feature is wrong. This error is currently produced for non-feature group features in flow specifications. (The feature group is checked to see that contains at least one feature in the correct direction in the flow specification). There is no similar check in the flow implementation for the feature group features.

Steps to Reproduce

Consider the package TEST below:

package TEST
public
	thread T1
		features
			outPort: out event port;
			inPort: in event port;
		flows
			fsrc1: flow source outPort;
			fsrc2: flow source inPort; -- WRONG
			
			fsnk1: flow sink outPort; -- WRONG
			fsnk2: flow sink inPort;
			
			fpath1: flow path inPort -> outPort;
			fpath2: flow path outPort -> inPort; -- WRONG
	end T1;



	
    feature group FG
    	features
	    	outPort: out event port;
	    	inPort: in event port;
    end FG;

	feature group FG_inverse inverse of FG
	end FG_inverse;



    thread T2
    	features
    		fg: feature group FG;
    		fg_inv: feature group FG_inverse;
    	flows
    		fsrc1a: flow source fg.outPort;
    		fsrc1b: flow source fg.inPort; -- WRONG
    		fsrc2a: flow source fg_outPort; -- WRONG
    		fsrc2b: flow source fg_inv.inPort;

    		fsnk1a: flow sink fg.outPort; -- WRONG
    		fsnk1b: flow sink fg.inPort;
    		fsnk2a: flow sink fg_inv.outPort;
    		fsnk2b: flow sink fg_inv.inPort; -- WRONG

    		fpath1a: flow path fg.inPort -> fg_inv.inPort;
    		fpath1b: flow path fg.outPort -> fg_inv.outPort; -- WRONG
    		fpath2a: flow path fg_inv.inPort -> fg.inPort; -- WRONG
    		fpath2b: flow path fg_inv.outPort -> fg.outPort;
    end T2;



    thread T3
    	features
    		fg: feature group FG;
    		fg_inv: feature group FG_inverse;
    	flows
    		fsrc1: flow source fg;
    		fsrc2: flow source fg_inv;

    		fsnk1: flow sink fg;
    		fsnk2: flow sink fg_inv;

    		fpath1: flow path fg -> fg_inv;
    		fpath2: flow path fg_inv -> fg;
    end T3;
    
    thread implementation T3.rightWay
    	flows
    		-- ALL OF THESE ARE CORRECT
    		fsrc1: flow source fg.outPort;
    		fsrc2: flow source fg_inv.inPort;
    		
    		fsnk1: flow sink fg.inPort;
    		fsnk2: flow sink fg_inv.outPort;
    		
    		fpath1: flow path fg.inPort -> fg_inv.inPort;
    		fpath2: flow path fg_inv.outPort -> fg.outPort;
    end T3.rightWay;
    
    thread implementation T3.wrongWay
    	flows
    		-- ALL OF THESE ARE WRONG
    		fsrc1: flow source fg.inPort;
    		fsrc2: flow source fg_inv.outPort;
    		
    		fsnk1: flow sink fg.outPort;
    		fsnk2: flow sink fg_inv.inPort; 

                fpath1: flow path fg.outPort -> fg_inv.outPort;
    		fpath2: flow path fg_inv.inPort -> fg.inPort;
    end T3.wrongWay;
end TEST;

Currently, there are error messages on

  • fsrc2, fsnk2, and fpath2 in thread T1. These is expected because they name features that have the wrong direction. These are errors on flow specifications.
  • fsrc1b, fsrc2a, fsnk1a, fsnk2b, fpath1b, and fpath2a In thread T2 because they name feature group sub-features that have the wrong direction. These are errors on flow specifications.

I expect, but do not have, errors on all the flow implementations in T3.wrongWay.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions