Skip to content
This repository has been archived by the owner on Jun 4, 2019. 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

Comments

@reteprelief
Copy link
Contributor

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;
@kfhoech
Copy link
Contributor

kfhoech commented Jun 14, 2018

Fixed by Pull Request 140.

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

No branches or pull requests

2 participants