[ATL] How to discard source elements or translate them to 'nothing'? [message #514049] |
Fri, 12 February 2010 09:56 |
Dennis Hendriks Messages: 74 Registered: January 2010 Location: The Netherlands |
Member |
|
|
Hello all,
In my ATL transformation I use matched rules for all source elements. I assign source element features to target element features, which are automatically matched by matched rules by ATL. However, some source element features (references to other source elements) are to be discarded. I simply don't assign them to target element features. However, since they are source elements, ATL automatically matches them using the matched rules, and generates target elements that end up in the root of the output. This is valid ATL behavior, but I need a way to exclude those elements from the output.
I don't think it is possible to remove such elements after they are created (within the same ATL transformation), so I need a way to make sure they are not created in the first place. Is there a way to inform ATL that certain elements from the input should be discarded (not matched by matched rules)?
I tried manually translating them to nothing (so that they are already matched, but there is no output, or they are matched and the output is something like an empty string that I add to some other feature to get rid of it), but couldn't figure out how to do that using lazy rules, called rules, or something like that...
Does anyone know a way to do this in ATL? Any help would be greatly appreciated!
Dennis
|
|
|
|
|
|
|
|
|
|
Re: [ATL] How to discard source elements or translate them to 'nothing'? [message #515272 is a reply to message #515266] |
Thu, 18 February 2010 10:32 |
Dennis Hendriks Messages: 74 Registered: January 2010 Location: The Netherlands |
Member |
|
|
Let me rephrase my problem:
a rule like :
{{{
rule RULE1 {
from s : XX!YY
to ...
}
}}}
is required to copy all XX!YY instances, except for a few instances.
Then I have another rule:
{{{
rule SOMERULE {
from s : XX!ZZ
to t : AA!BB(
a <- s.a,
b <- s.b,
...
y <- Sequence{})
}
}}}
where the instances of XX!YY are not assigned to t.y. So, almost all XX!YY instances must be matched by the top level rule, except the XX!YY instances from SOMERULE s.y, which are discarded and not added to t.y. I would like to specify that they should not be translated, in the SOMERULE rule. Instead, I could come up with a filter to apply to the RULE1 rule, but it would be complicated, and I would rather have it localized to the SOMERULE rule.
My question is whether it is possible using some kind of lazy rule, or whatever, to translate the XX!YY instances of s.y such that they are already translated and are no longer matched by the RULE1 rule, as ATL no longer tries to match them (they are already matched)?
Hope this makes the question clearer?
Dennis
|
|
|
Re: [ATL] How to discard source elements or translate them to 'nothing'? [message #515279 is a reply to message #515272] |
Thu, 18 February 2010 10:47 |
Vincent MAHE Messages: 129 Registered: July 2009 |
Senior Member |
|
|
D. Hendriks (Dennis) a écrit :
> Let me rephrase my problem:
>
> a rule like :
> {{{
> rule RULE1 {
> from s : XX!YY
> to ...
> }
> }}}
>
> is required to copy all XX!YY instances, except for a few instances.
>
> Then I have another rule:
> {{{
> rule SOMERULE {
> from s : XX!ZZ
> to t : AA!BB(
> a <- s.a,
> b <- s.b,
> ...
> y <- Sequence{})
> }
> }}}
>
> where the instances of XX!YY are not assigned to t.y. So, almost all
> XX!YY instances must be matched by the top level rule, except the XX!YY
> instances from SOMERULE s.y, which are discarded and not added to t.y. I
> would like to specify that they should not be translated, in the
> SOMERULE rule. Instead, I could come up with a filter to apply to the
> RULE1 rule, but it would be complicated, and I would rather have it
> localized to the SOMERULE rule.
>
> My question is whether it is possible using some kind of lazy rule, or
> whatever, to translate the XX!YY instances of s.y such that they are
> already translated and are no longer matched by the RULE1 rule, as ATL
> no longer tries to match them (they are already matched)?
>
> Hope this makes the question clearer?
>
> Dennis
You should try to define your need on a white board using mathematical
sets (areas) to see which filters (boolean expressions) go with each rule.
--
Cordialement
Vincent MAHÉ
Ingénieur plate-forme - Cesar/Artemisia - Équipe Espresso
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 71 00, Fax: +33 (0) 2 99 84 71 71
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03947 seconds