Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Semantics of multi-object creation in a rule

Hi Christian,

thanks a lot for the detail response. This really made things clear for me. I also think that multi-rules make sense, when there are some multi-objects in the LHS and the <<create*>> is carried out in the context of this multi-object in LHS.

Just one last question: the example you gave where you create a class in each of the EPackages, my question again will be about the links created.  A link will be created from one EPackage to only one EClass or will there be a link between every possible pair of EPackage and EClass? From our earlier discussion, I understood there will be a cartesian product in this case, but as i see there is a requirement for a 1 to 1 link. What are your thoughts on this.

best,
Zille

On 3/12/2014 7:56 PM, Christian Krause wrote:
Hi Zille,

2014-03-10 10:11 GMT+01:00 Zille Huma <zille.huma@xxxxxx>:
Hi Christian,

thanks for the detailed response.  The general rule that you specified is a bit confusing for me.

Can you please explain how will the following example work: If we have a rule with a node c:C with <<preserve>> and two nodes a:A and b:B both with <<create*>>. Additionally we have two links: one between a:A and b:B and second between a:A and c:C both with <<create*>>. What will be the result of the application of this rule.


I would expect that one a:A and one b:B node is created, and exactly the two links that are specified in the rule.

In general, multi-rules make real sense only if their LHS is non-empty, i.e., if you have at least one object with action <<preserve*>> or <<delete*>>. Let me give you an example where <<create*>> can be useful. Let's assume that you specify a transformation on the Ecore model. Say, you have a bunch of EPackages and in each of these packages you want to create some special class (maybe something like a registry). To achieve this you can match the EPackages using <<preserve*>> and have a node of type EClass with action <<create*>> (this will be the special registry class) and a corresponding edge from the EPackage to the EClass. In this case, <<create*>> would be useful. But note that here you first match some other node with <<preserve*>>.

Hope this helps,
Christian

thanks in advance.

best,
Zille


On 3/7/2014 6:26 PM, Christian Krause wrote:
Hi Zille,

it depends on the specific example. For instance if you match two nodes a:A and b:B both with <<preserve*>> and then draw a link between them with <<create*>> it will create for every pair of a's and b' such a link. In this case, it is indeed the Cartesian product.

In general it is like this: the multi-rule is applied for every found match. If you have a rule with a single node of action <<create*>> (and nothing else) in the underlying model you have an empty LHS. There is exactly one match for this LHS, i.e. the empty match. Therefore, I would expect that the application of this rule will create exactly one object (though I have not tested it).

Hope this helps.

Cheers,
Christian




2014-03-06 10:50 GMT+01:00 Zille Huma <zille.huma@xxxxxx>:
Hi all,

During my work with the rules with multi-objects, I came across this problem and I would highly appreciate if someone could explain how this is handled in henshin. It is about the multi-object (universal quantified) in a rule.

As far as i understand, if a rule specifies deletion or preservation of multi-objects, it can be applied through the concept of parallel transformations in henshin. But how does henshin handle the case, if the rule specifies creation of multi-objects. What is the semantic interpretation of such a creation? the creation of a  link for the newly created multi-object means a link to every object in the set or to the whole as a collection? How are the links between multiple multi-objects interpreted? is it a single link or a cartesian product of the objects in the both the sets are linked with each other?

Best,
Zille

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev


-- 
Zille Huma
Database and Information Systems
Institute of Computer Science
University of Paderborn
Zukunftsmeile 1
33102 Paderborn, Germany

Tel : +49(0)5251/60-3355
Fax : +49(0)5251/60-3431

Email: zille.huma@xxxxxx

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev




_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev


-- 
Zille Huma
Database and Information Systems
Institute of Computer Science
University of Paderborn
Zukunftsmeile 1
33102 Paderborn, Germany

Tel : +49(0)5251/60-3355
Fax : +49(0)5251/60-3431

Email: zille.huma@xxxxxx

Back to the top