I think we don't need to use multiple input/output rules.
One rule block seems to be enough for the cases we are dealing with, and simplifies the generated code.
Also, the current semantic adaptation framework does not cope with this well because it can create duplicate of the rules for execution (executing too many rules redundantly).
I guess we have to check whether the rule already exists or not in line 231.
Other than that, I am trying to write up particularly when the mapIn rules and mapOut rules should be run, such that they can be called correctly.