ftsrg / gamma

An Eclipse-based modeling framework for the component-based design and analysis of reactive systems
http://gamma.inf.mit.bme.hu
30 stars 25 forks source link

Deep hierarchical sync components generate multiple local variables with the same name #125

Closed arminzavada closed 2 years ago

arminzavada commented 2 years ago

If two components from different leaves of the composition tree communicate with each other through port bindings and channels the XSTS ort transformer creates multiple local variables.

Kép1

The reason: in the above case the 2 statecharts are transformed, then their containing component. Said component will also merge the ort actions, creating local variables. This step concludes by writing back the value of the local variable to the global one.

local var _p1_ : ...
local var _p2_ : ...
...
p1 := _p1_
p2 := _p2_

When the root sync component is transformed, it finds the local->global write, and assumes we need a new local variable, since it is accessed. Thus, it creates a new local version of the global variable.

arminzavada commented 2 years ago

Fixed in 148a3798c6fd39f7ee14b36fbada921830ede3ce