Skip to main content



      Home
Home » Modeling » ATL » Redefinitions in an extending rule
Redefinitions in an extending rule [message #1838157] Wed, 17 February 2021 12:48 Go to next message
Eclipse UserFriend
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
Re: Redefinitions in an extending rule [message #1838161 is a reply to message #1838157] Wed, 17 February 2021 15:43 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Redefinitions in an extending rule [message #1839213 is a reply to message #1838161] Wed, 17 March 2021 11:23 Go to previous message
Eclipse UserFriend
Hi Dennis,

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

Thanks!

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


Current Time: Tue Jul 29 11:36:51 EDT 2025

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

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

Back to the top