Hi
On 20/03/2013 14:09, Horacio Hoyos
Rodriguez wrote:
Hi Ed,
Involving mapping calls I have two questions regarding the
binding of variables. The first one is regarding the case
where the ReferredMapping variables are assigned a set value.
In the HSVtoHLS example we have a mapping call:
map HSV2MiddleRecursion { -- recursive call to
visit children
hsvNode
:= hsvRoot.children;
middleParent
:= middleRoot;
}
In Java-like code this is an invocation of HSV2MiddleRecursion
(hsvNode, middleParent)
for (X anX: hsvRoot.children)
HSV2MiddleRecursion(anX, middleRoot)
If the second assignment had an _expression_ in
the right side that also was a set, something like
(although not correct for the example):
map HSV2MiddleRecursion { -- recursive call to
visit children
hsvNode
:= hsvRoot.children;
middleParent
:= middleRoot.children;
}
This is similarly
for (X anX: hsvRoot.children)
for (Y aY: middleRoot.children)
HSV2MiddleRecursion(anX, aY)
which you can call a Cartesian product if you really want to but to
do so seems to be making something very simple rather complicated.
Wouldn't it be necessary to invoke the
referredMapping for the Cartesian product of bindings of the
two sets? This is due that at design time the number of
assignments to a set will be unknown. There is the
possibility that mapping calls can be restricted to
use maximum 1 set assignment.
I expect the QVTm to QVTi to plan the schedule carefully so there
will only be one Collection, but there is liottle difficulty in the
implementation handling multiple dimensions.
The second question is regarding GuardPattern
predicates of the ReferredMapping. Can mappings being used
for MappingCalls have predicates in the guard patterns of
their domains and bottom pattern? If so, this
is something missing in the current implementation.
I think QVTi only needs guard pattern predicates, since the bottom
introduces no new free variables.
Regards
Ed
|