Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Redefinitions in an extending rule
Redefinitions in an extending rule [message #1838157] Wed, 17 February 2021 17:48 Go to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Is there any mean to actually redefine the computation of an attribute of the target object in an extending rule?

As I can observe it in my ATL transformation, if an attribute of the target object has a computation formula in both the base and the extended rule each of those computation formula will be executed.

This is not a issue when the computed value is a scalar but when it results from a non unique lazy or called ruled, it is. I was expecting that only the "last" version (i.e. that from the most specialized rule) of the value assignment will be executed.

This clearly reduce the interest of the inheritance mechanism. Is there any workaround?

Thanks,
Yves


Yves
Re: Redefinitions in an extending rule [message #1838161 is a reply to message #1838157] Wed, 17 February 2021 20:43 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

This is a limitation caused by dynamic rule linking in EMFTVM, combined with monolithic "apply" code blocks: all bindings of a rule are compiled into a single "apply" code block:


  • The compiler cannot inline the super-rule apply code, because super-rules are linked dynamically
  • The EMFTVM runtime can no longer (safely) distinguish single bindings in an "apply" code block and skip them


A work-around is to refactor your rule hierarchy to split off another sub-rule with the bindings that you want to suppress. You can use a guard expression in the "from" part of the new sub-rule to match everything that the other sub-rule does not match.


Cheers,
Dennis
Re: Redefinitions in an extending rule [message #1839213 is a reply to message #1838161] Wed, 17 March 2021 15:23 Go to previous message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Hi Dennis,

Yes, I succeeded in managing it using the guard expression.

Thanks!



Yves
Previous Topic:Set Real to NaN
Next Topic:Potential bug with resolveTemp()
Goto Forum:
  


Current Time: Thu Apr 25 19:55:38 GMT 2024

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

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

Back to the top