Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Are lazy rules 'evaluated' first than other rules?
[ATL] Are lazy rules 'evaluated' first than other rules? [message #14114] Wed, 31 January 2007 11:36 Go to next message
Eclipse UserFriend
Originally posted by: jairson.gmail.com

Hi All,

I thought I would share with you the following experiment:

I have a helper like this:

helper context CHR!CHRProgram def : generateVars :
Sequence(CHR!VariableSymbol) = self.constantSymbols->collect(e |
thisModule.resolveTemp(e, 'vo'))->union(self.allRepeatedVars->collect(e
|thisModule.repeatedVariableSymbol2newVariableSymbol(e))).de bug('generateVars');

When I inspect the value 'generateVars' I always get the value from the
lazy rule already instantiated whereas the other rule gave me no value
at this point.

Is it then the case that lazy rules are evaluated earlier? If this is
true, are there any implications when trying to stick to the declarative
approach in ATL?


Thanks a lot,

Jairson Vitorino
Re: [ATL] Are lazy rules 'evaluated' first than other rules? [message #14132 is a reply to message #14114] Wed, 31 January 2007 11:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rchevrel.sodius.com

Hi Jairson,

The lazy rules are not evaluated earlier but when you ask them to be
evaluated.

But your helper look like false because you use collect on collection,
so you probably obtain collection of collections, not collection of
CHR!VariableSymbol.

Use "->flatten()" keyword to transform a collection of collections into
a collection. (e.g. {{a, b}, {c, d}}->flatten() = {a, b, c, d})

If your problem persist, please send all concerned parts of your ATL
file (notably your lazy rule, the rule witch matched the "e" element and
the helper call).

Best regards,


Régis CHEVREL


SODIUS
6, rue Cornouaille
44319 Nantes - France

Phone: +33 (0)2 28 23 54 34

www.mdworkbench.com
Draw more value from your model




Jairson a écrit :
> Hi All,
>
> I thought I would share with you the following experiment:
>
> I have a helper like this:
>
> helper context CHR!CHRProgram def : generateVars :
> Sequence(CHR!VariableSymbol) = self.constantSymbols->collect(e |
> thisModule.resolveTemp(e, 'vo'))->union(self.allRepeatedVars->collect(e
> |thisModule.repeatedVariableSymbol2newVariableSymbol(e))).de bug('generateVars');
>
>
> When I inspect the value 'generateVars' I always get the value from the
> lazy rule already instantiated whereas the other rule gave me no value
> at this point.
>
> Is it then the case that lazy rules are evaluated earlier? If this is
> true, are there any implications when trying to stick to the declarative
> approach in ATL?
>
>
> Thanks a lot,
>
> Jairson Vitorino
Re: [ATL] Are lazy rules 'evaluated' first than other rules? [message #14167 is a reply to message #14132] Wed, 31 January 2007 20:24 Go to previous message
Eclipse UserFriend
Originally posted by: jairson.gmail.com

Thank you Régis,

I used the debug tool and could find out what I was doing wrong.

regards,

Jairson Vitorino

Régis wrote:
> Hi Jairson,
>
> The lazy rules are not evaluated earlier but when you ask them to be
> evaluated.
>
> But your helper look like false because you use collect on collection,
> so you probably obtain collection of collections, not collection of
> CHR!VariableSymbol.
>
> Use "->flatten()" keyword to transform a collection of collections into
> a collection. (e.g. {{a, b}, {c, d}}->flatten() = {a, b, c, d})
>
> If your problem persist, please send all concerned parts of your ATL
> file (notably your lazy rule, the rule witch matched the "e" element and
> the helper call).
>
> Best regards,
>
>
> Régis CHEVREL
>
>
> SODIUS
> 6, rue Cornouaille
> 44319 Nantes - France
>
> Phone: +33 (0)2 28 23 54 34
>
> www.mdworkbench.com
> Draw more value from your model
>
>
>
>
> Jairson a écrit :
>> Hi All,
>>
>> I thought I would share with you the following experiment:
>>
>> I have a helper like this:
>>
>> helper context CHR!CHRProgram def : generateVars :
>> Sequence(CHR!VariableSymbol) = self.constantSymbols->collect(e |
>> thisModule.resolveTemp(e,
>> 'vo'))->union(self.allRepeatedVars->collect(e
>> |thisModule.repeatedVariableSymbol2newVariableSymbol(e))).de bug('generateVars');
>>
>>
>> When I inspect the value 'generateVars' I always get the value from
>> the lazy rule already instantiated whereas the other rule gave me no
>> value at this point.
>>
>> Is it then the case that lazy rules are evaluated earlier? If this is
>> true, are there any implications when trying to stick to the
>> declarative approach in ATL?
>>
>>
>> Thanks a lot,
>>
>> Jairson Vitorino
Previous Topic:[ATL] PackageMerge + couple of questions
Next Topic:[ATL] Creation of the section "ATL Use Cases"
Goto Forum:
  


Current Time: Tue Mar 19 02:21:11 GMT 2024

Powered by FUDForum. Page generated in 0.01926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top