Information flow between graph transformation rules and their precondition and postcondition patterns is carried out by parameter passing.
Like in case of ASM rules, formal parameters of graph transformation rules can be grouped into three categories. Note that this categorization is independent from the fact whether a given parameter is bound or unbound when applying a GT rule.
in: The values of input parameters passed to a graph transformation rule will be restored after applying the rule, i.e. if a new value is assigned to an input variable during the application of a GT rule, this value will no longer be visible after rule application. Its typical usage is that an initial match of a GT rule is assigned this way.
It is a run-time error if an input parameter is unbound when calling a GT rule.
out: The values of output parameters passed to a graph transformation rule will be ignored when initiating pattern matching for the precondition pattern, i.e. these parameters are treated during pattern matching as if they were unbound. However, these values are passed back to the caller environment to make the new values accessible.
inout: The values of inout parameters of a graph transformation rule are passed to a graph pattern matching engine (as in case of input parameters), and they are also passed back to the caller environment (as in case of output parameters).
It is a run-time error if an input parameter is unbound when calling a GT rule.
Note that this interpretation of input and output variables is a change from previous release, where input and output parameters of a GT rule were interpreted after the pattern matching phase.
As illustrated by Figure 2.2, “Relations of parameters of the parts of a GT rule”, a parameter of a graph transformation rule can be used (i) in the precondition pattern, (ii) in the postcondition pattern, or in the action part (or in any combination of these) provided that they are listed in the parameter list(s) of the corresponding patterns. In case of the action part, all parameters of the GT rule itself of the precondition and postcondition patterns can be used (i.e. all these variables are part of an implicit parameter list of the action part).
Bound parameters of the precondition pattern are called input parameters of the precondition, while unbound parameters of the postcondition are called output parameters of the precondition. Input parameters are either parameters of the precondition pattern, or they are input or inout parameters of the GT rule itself.
Bound parameters of the postcondition pattern are called input parameters of the postcondition, while unbound parameters of the postcondition are called output parameters of the precondition. Input parameters are input or inout parameters of the GT rule itself.
In the rare case when values are assigned multiple times to the same output parameter, assignments in the precondition pattern are overridden by assignments defined by the postcondition pattern, which, in turn, are overridden by assignments in the action part.