Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] superimposition question
[ATL] superimposition question [message #17692] Thu, 22 February 2007 12:39 Go to next message
Eclipse UserFriend
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de

Hi,

I read in the corresponding bug report that it is now possible to use a
feature called superimposition. Is a superimposed module aware of the
module it is superimposing? Or more concretely, is it possible to access
rules of the root module from a superimposed module? How can this be done?

Thanks in advance.

Markus
Re: [ATL] superimposition question [message #17745 is a reply to message #17692] Thu, 22 February 2007 17:35 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Markus Herrmannsdoerfer schreef:
> Hi,

Hi Markus,

>
> I read in the corresponding bug report that it is now possible to use a
> feature called superimposition. Is a superimposed module aware of the
> module it is superimposing? Or more concretely, is it possible to access
> rules of the root module from a superimposed module? How can this be done?
>
> Thanks in advance.
>
> Markus

Modules are not at all aware of any superimposition going on.
Superimposition is done at load-time. Access includes invocation of
called rules and helper methods, as well as helper attributes. I have
not tested rule inheritance yet, so I don't know what will happen ;-).

You can actually access any module in the same run, whether it is
superimposing or superimposed upon. It is of course bad practice to
introduce references from the root module to any of the superimposed
modules, so you'll probably want to reference downward only.

The safest (and original) use of superimposition is to mask matched
rules from the root module. Any matched rule in a superimposed module
with the same _name_ as a matched rule in the root module will replace
it (it masks the old rule).

Coming back to your previous post: you can use the rule masking feature
to redefine rules of the root copying transformation. You cannot reuse
parts of a masked out rule, however. Hence, masking rules is only
interesting when redefining relatively few rules.

Kind regards,
Dennis Wagelaar
Re: [ATL] superimposition question [message #18495 is a reply to message #17745] Fri, 23 February 2007 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de

Hi,

thanks for your answers. I have some more questions ;-) (see below)


Dennis Wagelaar wrote:
> Markus Herrmannsdoerfer schreef:
>> Hi,
>
> Hi Markus,
>
>>
>> I read in the corresponding bug report that it is now possible to use
>> a feature called superimposition. Is a superimposed module aware of
>> the module it is superimposing? Or more concretely, is it possible to
>> access rules of the root module from a superimposed module? How can
>> this be done?
>>
>> Thanks in advance.
>>
>> Markus
>
> Modules are not at all aware of any superimposition going on.
> Superimposition is done at load-time. Access includes invocation of
> called rules and helper methods, as well as helper attributes. I have
> not tested rule inheritance yet, so I don't know what will happen ;-).
>
> You can actually access any module in the same run, whether it is
> superimposing or superimposed upon. It is of course bad practice to
> introduce references from the root module to any of the superimposed
> modules, so you'll probably want to reference downward only.

Do I have to use the "uses" statement in order to be able to access a
rule from another module?

>
> The safest (and original) use of superimposition is to mask matched
> rules from the root module. Any matched rule in a superimposed module
> with the same _name_ as a matched rule in the root module will replace
> it (it masks the old rule).
>
> Coming back to your previous post: you can use the rule masking feature
> to redefine rules of the root copying transformation. You cannot reuse
> parts of a masked out rule, however. Hence, masking rules is only
> interesting when redefining relatively few rules.

Assume I have the following rules in the root module:

rule A {
...
}

rule B extends A {
...
}

1. Is it possible to mask B in another module and still extending A from
the root module?
2. If I mask A in another module, will B in the root module then extend
the new A?

>
> Kind regards,
> Dennis Wagelaar

Kind regards,

Markus Herrmannsdörfer
Re: [ATL] superimposition question [message #18503 is a reply to message #17745] Fri, 23 February 2007 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de

Hi,

thanks for your answers. I have some more questions ;-) (see below)


Dennis Wagelaar wrote:
> Markus Herrmannsdoerfer schreef:
>> Hi,
>
> Hi Markus,
>
>>
>> I read in the corresponding bug report that it is now possible to use
>> a feature called superimposition. Is a superimposed module aware of
>> the module it is superimposing? Or more concretely, is it possible to
>> access rules of the root module from a superimposed module? How can
>> this be done?
>>
>> Thanks in advance.
>>
>> Markus
>
> Modules are not at all aware of any superimposition going on.
> Superimposition is done at load-time. Access includes invocation of
> called rules and helper methods, as well as helper attributes. I have
> not tested rule inheritance yet, so I don't know what will happen ;-).
>
> You can actually access any module in the same run, whether it is
> superimposing or superimposed upon. It is of course bad practice to
> introduce references from the root module to any of the superimposed
> modules, so you'll probably want to reference downward only.

Do I have to use the "uses" statement in order to be able to access a
rule from another module?

>
> The safest (and original) use of superimposition is to mask matched
> rules from the root module. Any matched rule in a superimposed module
> with the same _name_ as a matched rule in the root module will replace
> it (it masks the old rule).
>
> Coming back to your previous post: you can use the rule masking feature
> to redefine rules of the root copying transformation. You cannot reuse
> parts of a masked out rule, however. Hence, masking rules is only
> interesting when redefining relatively few rules.

Assume I have the following rules in the root module:

rule A {
...
}

rule B extends A {
...
}

1. Is it possible to mask B in another module and still extending A from
the root module?
2. If I mask A in another module, will B in the root module then extend
the new A?

>
> Kind regards,
> Dennis Wagelaar

Kind regards,

Markus Herrmannsdörfer
Re: [ATL] superimposition question [message #19420 is a reply to message #18503] Wed, 28 February 2007 08:50 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Markus Herrmannsdoerfer schreef:
> Hi,
>
> thanks for your answers. I have some more questions ;-) (see below)
>

Hi Markus,

I'll try to answer them ;-).

>
> Dennis Wagelaar wrote:
>> Markus Herrmannsdoerfer schreef:
>>> Hi,
>>
>> Hi Markus,
>>
>>>
>>> I read in the corresponding bug report that it is now possible to use
>>> a feature called superimposition. Is a superimposed module aware of
>>> the module it is superimposing? Or more concretely, is it possible to
>>> access rules of the root module from a superimposed module? How can
>>> this be done?
>>>
>>> Thanks in advance.
>>>
>>> Markus
>>
>> Modules are not at all aware of any superimposition going on.
>> Superimposition is done at load-time. Access includes invocation of
>> called rules and helper methods, as well as helper attributes. I have
>> not tested rule inheritance yet, so I don't know what will happen ;-).
>>
>> You can actually access any module in the same run, whether it is
>> superimposing or superimposed upon. It is of course bad practice to
>> introduce references from the root module to any of the superimposed
>> modules, so you'll probably want to reference downward only.
>
> Do I have to use the "uses" statement in order to be able to access a
> rule from another module?

No, this is not strictly necessary. Then again, I believe it is also not
necessary when accessing library helpers. Currently, the "uses"
statement does nothing as far as I know...

On the other hand, it doesn't hurt to add a "uses" statement. It adds
more clarity and may even become a future requirement ;-).

I've tried it out for my transformations: commenting in and out a "uses"
statement makes no difference in the .asm file.

>
>>
>> The safest (and original) use of superimposition is to mask matched
>> rules from the root module. Any matched rule in a superimposed module
>> with the same _name_ as a matched rule in the root module will replace
>> it (it masks the old rule).
>>
>> Coming back to your previous post: you can use the rule masking
>> feature to redefine rules of the root copying transformation. You
>> cannot reuse parts of a masked out rule, however. Hence, masking rules
>> is only interesting when redefining relatively few rules.
>
> Assume I have the following rules in the root module:
>
> rule A {
> ...
> }
>
> rule B extends A {
> ...
> }
>
> 1. Is it possible to mask B in another module and still extending A from
> the root module?

No, this is not possible. The "extends" statement is a compile-time
construction. At compile-time (i.e. .atl to .asm), only single modules
are considered. Superimposition is a load-time costruction, that links
the .asm files just before running them.

A possible solution here is to make "A" a called rule, which is then
called from matched rule "B". In a superimposing module, it is then
possible to mask "B" with a new rule that still calls rule "A".

> 2. If I mask A in another module, will B in the root module then extend
> the new A?

No, the "extends" statement is compiled in such a way that rule "A" is
simply in-lined in rule "B". No relationship between "A" and "B" exists
in the .asm file.

Again, if "A" were a called rule, it would be masked by any newly
defined called rule "A". Rule "B" then indeed invokes the new rule "A".

>
>>
>> Kind regards,
>> Dennis Wagelaar
>
> Kind regards,
>
> Markus Herrmannsdörfer
>
Previous Topic:[TCS] Examples that convert .tcs file to model
Next Topic:[ATL] short circuit and operation
Goto Forum:
  


Current Time: Tue Mar 19 05:02:10 GMT 2024

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

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

Back to the top