Skip to content
This repository has been archived by the owner. It is now read-only.

Does connections function return {connection} or [connection]? #136

Closed
reteprelief opened this issue May 30, 2018 · 1 comment
Closed

Does connections function return {connection} or [connection]? #136

reteprelief opened this issue May 30, 2018 · 1 comment
Labels

Comments

@reteprelief
Copy link
Contributor

@reteprelief reteprelief commented May 30, 2018

As part of the let assignment Resolute thinks the value is to be {connection}
As part of the comparison the value is [connection]
In the example below we get an error message when defining the variable type for list 2 as [connection]

In the comparison comparing against {} returns false while comparing against [] returns true, i.e., the value is a list.

package myresolutelib2
public
	system top
		
	end top;
	
	system implementation top.i
		subcomponents
			s1: system s;
		annex Resolute {**
			prove hasConnections(this)
		**};
	end top.i;
	
	system s
		
	end s;
	annex Resolute {**
	hasConnections (comp : component) <=
	** "Component " comp " has connections" **
 		let set1 : {connection}= connections(comp); -- 
--		let list2 :[connection]= connections(); -- error msg: connections returns set
--		set1 <> {}  -- this condition returns false because set1 value is [] and is compared to {}
		set1 <> []  -- this condition returns true
	**};
end myresolutelib2;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants