Issue 15417: Rule Overriding in QVTr (qvt-rtf) Source: NASA (Dr. Maged Elaasar, Maged.E.Elaasar(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: Summary: The abstract syntax of QVTr allows a rule to be an override of another rule. Rule::overrides: Rule [0..1] The rule that this rule overrides. The concrete syntax of QVT allows it too: <relation> ::= ['top'] 'relation' <identifier> ['overrides' <identifier>] '{' .... '}' However, the only semantics I can see for 'overrides' is in clause 7.11.1.4 that says: "A rule may conditionally override another rule. The overriding rule is executed in place of the overridden rule when the overriding conditions are satisfied. The exact semantics of overriding are subclass specific. " Questions: 1- Whtat are the overriding conditions? are they implied or specified and if so how? 2- I have not seen any other discussion of overrding in a subclass or Rule so not sure what is meant by "The exact semantics of overriding are subclass specific"? 3- I have not seen any example of using 'overrides' what so ever in the spec, shouldn't there be one? 4 - What is the semantics of overriding? is it related to inheritance in the OO sense ? I think QVTr needs a good "inheritance" model where you can relations can be called polymorphically. Resolution: Rule Overriding in QVTr The abstract syntax of QVTr allows a rule to be an override of another rule. Rule::overrides: Rule [0..1] The rule that this rule overrides. The concrete syntax of QVT allows it too: <relation> ::= ['top'] 'relation' <identifier> ['overrides' <identifier>] '{' .... '} ' However, the only semantics I can see for 'overrides' is in clause 7.11.1.4 that says: "A rule may conditionally override another rule. The overriding rule is executed in place of the overridden rule when the overriding conditions are satisfied. The exact semantics of overriding are subclass specific. " Questions: 1- What are the overriding conditions? are they implied or specified and if so how? 2- I have not seen any other discussion of overriding in a subclass or Rule so not sure what is meant by "The exact semantics of overriding are subclass specific"? 3- I have not seen any example of using 'overrides' what so ever in the spec, shouldn't there be one? 4 - What is the semantics of overriding? is it related to inheritance in the OO sense ? I think QVTr needs a good "inheritance" model where you can relations can be called polymorphically. Discussion This now a much better understood field: M. Wimmer, G. Kappel, A. Kusel, W. Retschitzegger, J. Schönböck, W. Schwinger, D. Kolovos, R. Paige, M. Lauder, A. Schürr, D. Wagelaar. Surveying Rule Inheritance in Model-to-Model Transformation Languages. In Journal of Object Technology, vol. 11, no. 2, 2012, pages 3:1?46. doi:10.5381/jot.2012.11.2.a3 QVTBase currently imposes single overriding which is unnecessary, and causes a problem for an application that needs to extend when B1 overrides A and B2 overrides A. The extending mapping needs C to override both B1 and B2 to ensure that C occludes both B1 and B2. Therefore we need multi-overrides. Oops. A QVTc Mapping::refines is an alternative concept that competes without comment with the inherited Rule::overrides. relToCore completely ignores the semantics of overrides translation. Relation::overrides should probably map across unchanged to Mapping::overrides. QVTc and QVTr semantics are unchanged. Fixing this textually without a prototype is too much of change. Revised Text: Actions taken: August 13, 2010: received issue December 22, 2015: Deferred March 29, 2016: closed issue Discussion: [Comments from inadvertently raised Issue 15524] You have reached the edge of the specification as written. 1: Yes 2: Yes 3: Yes 4: Yes I gave some consideration to this for UMLX. I felt that an abstract 'rule' could define a 'subrule' obligation, which would require an identical match signature, since if the override was narrower it would not fulfill the obligation and if it was wider the additional width would not be permitted by the invocation of the abstract 'rule'. I felt that all concrete rules should always be matched to ensure that addition of extended functionality did not change previous behaviour. This complies with UMLX's all maximal matches philosophy. Keys in QVTr, Evolution Ids in UMLX can ensure that derived rules reuse inherited matches. I think a transformation being both a package and a class introduces some difficult compatibility issues to be studied. Transformation extension is also poorly defined giving additional imprecision when considering the combination of transformation extension and rule override. QVT 1.2 RTF Report Page 180 of 190 Object Management Group RTF/FTF Report My ideas for UMLX were not complete but I think that they may be sounder than QVTr's. [If Transformation is just a Class, one area for study vanishes.] Disposition: Deferred End of Annotations:===== ubject: Rule Overriding in QVTr To: qvt-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Fri, 13 Aug 2010 12:31:38 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 08/13/2010 12:31:39 Hi, The abstract syntax of QVTr allows a rule to be an override of another rule. Rule::overrides: Rule [0..1] The rule that this rule overrides. The concrete syntax of QVT allows it too: ::= ['top'] 'relation' ['overrides' ] '{' .... '}' However, the only semantics I can see for 'overrides' is in clause 7.11.1.4 that says: "A rule may conditionally override another rule. The overriding rule is executed in place of the overridden rule when the overriding conditions are satisfied. The exact semantics of overriding are subclass specific. " Questions: 1- Whtat are the overriding conditions? are they implied or specified and if so how? 2- I have not seen any other discussion of overrding in a subclass or Rule so not sure what is meant by "The exact semantics of overriding are subclass specific"? 3- I have not seen any example of using 'overrides' what so ever in the spec, shouldn't there be one? 4 - What is the semantics of overriding? is it related to inheritance in the OO sense ? I think QVTr needs a good "inheritance" model where you can relations can be called polymorphically. Thanks, Maged X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAH8dZUxUXebj/2dsb2JhbACfUWdxv2qFOgQ Date: Fri, 13 Aug 2010 18:28:17 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: Maged Elaasar CC: qvt-rtf@omg.org Subject: Re: Rule Overriding in QVTr Hi Maged [Juergen: Another Issue] You have reached the edge of the specification as written. 1: Yes 2: Yes 3: Yes 4: Yes I gave some consideration to this for UMLX. I felt that an abstract 'rule' could define a 'subrule' obligation, which would require an identical match signature, since if the override was narrower it would not fulfill the obligation and if it was wider the additional width would not be permitted by the invocation of the abstract 'rule'. I felt that all concrete rules should always be matched to ensure that addition of extended functionality did not change previous behaviour. This complies with UMLX's all maximal matches philosophy. Keys in QVTr, Evolution Ids in UMLX can ensure that derived rules reuse inherited matches. I think a transformation being both a package and a class introduces some difficult compatibility issues to be studied. Transformation extension is also poorly defined giving additional imprecision when considering the combination of transformation extension and rule override. My ideas for UMLX were not complete but I think that they may be sounder than QVTr's. Ed On 13/08/2010 17:31, Maged Elaasar wrote: Hi, The abstract syntax of QVTr allows a rule to be an override of another rule. Rule::overrides: Rule [0..1] The rule that this rule overrides. The concrete syntax of QVT allows it too: ::= ['top'] 'relation' ['overrides' ] '{' .... '}' However, the only semantics I can see for 'overrides' is in clause 7.11.1.4 that says: "A rule may conditionally override another rule. The overriding rule is executed in place of the overridden rule when the overriding conditions are satisfied. The exact semantics of overriding are subclass specific. " Questions: 1- Whtat are the overriding conditions? are they implied or specified and if so how? 2- I have not seen any other discussion of overrding in a subclass or Rule so not sure what is meant by "The exact semantics of overriding are subclass specific"? 3- I have not seen any example of using 'overrides' what so ever in the spec, shouldn't there be one? 4 - What is the semantics of overriding? is it related to inheritance in the OO sense ? I think QVTr needs a good "inheritance" model where you can relations can be called polymorphically. Thanks, Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.851 / Virus Database: 271.1.1/3067 - Release Date: 08/12/10 19:34:00