Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AaronGreenhouse opened this issue Sep 13, 2019 · 3 comments · Fixed by #2404
Assignees
Milestone

Comments

@AaronGreenhouse
Copy link
Contributor

AaronGreenhouse commented Sep 13, 2019

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.

@lwrage
Copy link
Contributor

lwrage commented Sep 15, 2019

Is this about error messages in the AADL text editor?
Do you get errors on the instance model in these cases?

@AaronGreenhouse
Copy link
Contributor Author

AaronGreenhouse commented Sep 16, 2019

These are errors in the Text editor on the declarative model.

@lwrage lwrage added this to the 2.9.0 milestone Jul 22, 2020
@keh181
Copy link
Contributor

keh181 commented Aug 3, 2020

I am a bit confused why the flow path fpath1b in thread T2 is wrong but the flow path fpath1 in T3.rightway is supposed to be correct, when they appear to be the same.

Edit: fixed "Steps to Reproduce" to correct this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants