Issue 18363: Undefined semantics for unsatisfied "when" and "where" in inherited mapping (qvt-rtf) Source: (, ) Nature: Clarification Severity: Minor Summary: In operational QVT, it is not clear what happens when the "when" or "where" clause of an inherited mapping does not hold. Suggestion: Considering inheritance is a type (or, maybe, a synonym) of generalization, it would be expected that the semantics of inheritance mimics the semantics of generalization in MOF. The UML, which defines generalization used by CMOF and EMOF, states: "... features specified for instances of the general classifier are implicitly specified for instances of the specific classifier. Any constraint applying to instances of the general classifier also applies to instances of the specific classifier." (UML Infrastructure 2.4.1, p.51). If the "when" and "where" clauses are considered as features of a mapping, the clauses of the inherited mapping should be implicitly specified. Similarly, if they are considered as constraints applying to a mapping, the clauses defined in the inherited mapping should apply to the inheriting mapping. Therefore, a possible solution in both situations is to consider that the "when" and "where" clauses must hold in the inheriting mapping. Commentary: An interesting discussion is if something similar to the Liskov substitution principle should be applied in this situation. Resolution: Undefined semantics for unsatisfied "when" and "where" in inherited mapping In operational QVT, it is not clear what happens when the "when" or "where" clause of an inherited mapping does not hold. Suggestion: Considering inheritance is a type (or, maybe, a synonym) of generalization, it would be expected that the semantics of inheritance mimics the semantics of generalization in MOF. The UML, which defines generalization used by CMOF and EMOF, states: "... features specified for instances of the general classifier are implicitly specified for instances of the specific classifier. Any constraint applying to instances of the general classifier also applies to instances of the specific classifier." (UML Infrastructure 2.4.1, p.51). If the "when" and "where" clauses are considered as features of a mapping, the clauses of the inherited mapping should be implicitly specified. Similarly, if they are considered as constraints applying to a mapping, the clauses defined in the inherited mapping should apply to the inheriting mapping. Therefore, a possible solution in both situations is to consider that the "when" and "where" clauses must hold in the inheriting mapping. Commentary: An interesting discussion is if something similar to the Liskov substitution principle should be applied in this situation. Discussion The suggestions regarding constraint inheritance and LSP are appropriate for a declarative language; they are not appropriate for a pragmatic imperative language such as QVTo. Each mapping can be independently specified. It can be made clearer that pre and post conditions are assertions that fail accordingly. Comparison of QVTr/QVTo when and where highlights the fallacy that a QVTo mapping is a refinement of QVTr relation. In QVTo, failure of a where post-condition is a catastrophic assertion failure, whereas a QVTr where clause is a corrollary to be attempted afterwards and ignored if it fails/fails to match. The claim in 8.1.4 that the QVTo when and where clauses are owned by QVTr is untrue; QVTo owns its own when and where clauses and works very well without any QVTr objects. Revised Text: In 8.1.4 correct A mapping operation is syntactically described by a signature, a guard (a when clause) or precondition, a mapping body, and a postcondition (a where clause). Even if it is not explicitly notated in the concrete syntax, a mapping operation is always a refinement of an implicit relation that is the owner of the when and where clauses. in 8.1.4 append In strict invocation mode, a precondition (a when clause) is executed as an assertion before any other execution. Failure of the assertion causes a fatal execution failure. A postcondition (a where clause) is similarly executed as an assertion after all other execution has completed. In 8.2.1.15 following The when clause acts either as a pre-condition or as a guard, depending on the invocation mode of the mapping operation. The where clause always acts as a post-condition for the mapping operation. append pre-conditions and post-conditions are assertions; any execution failure is fatal. Actions taken: January 4, 2013: received issue December 22, 2015: Resolved March 29, 2016: closed issue Discussion: Yes. This is a very fundamental principle that should form part of the philosophical underpining in the first couple of paragraphs of the QVTo language exposition. (ditto QVTc, QVTr). It is disgraceful that the specification of transformation extension and rule refinement is so poor. For QVTc and QVTr I favour a principle that extension provides extension not replacement. But that may be too restricting. QVTo is more permissive and practical so a pure principle may be inappropriate. Research needed. Disposition: Deferred End of Annotations:===== m: webmaster@omg.org Date: 04 Jan 2013 07:32:42 -0500 To: Subject: Issue/Bug Report X-Brightmail-Tracker: AAAAAA== X-Brightmail-Tracker: AAAAAA== ******************************************************************************* Name: Fáo Levy Siqueira Employer: mailFrom: levy.siqueira@gmail.com Terms_Agreement: I agree Specification: Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification Section: 8.2.1.15 FormalNumber: formal/2011-01-01 Version: 1.1 Doc_Year: 2011 Doc_Month: January Doc_Day: Day Page: 93 Title: Undefined semantics for unsatisfied "when" and "where" in inherited mapping Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Description: In operational QVT, it is not clear what happens when the "when" or "where" clause of an inherited mapping does not hold. Suggestion: Considering inheritance is a type (or, maybe, a synonym) of generalization, it would be expected that the semantics of inheritance mimics the semantics of generalization in MOF. The UML, which defines generalization used by CMOF and EMOF, states: "... features specified for instances of the general classifier are implicitly specified for instances of the specific classifier. Any constraint applying to instances of the general classifier also applies to instances of the specific classifier." (UML Infrastructure 2.4.1, p.51). If the "when" and "where" clauses are considered as features of a mapping, the clauses of the inherited mapping should be implicitly specified. Similarly, if they are considered as constraints applying to a mapping, the clauses defined in the inherited mapping should apply to the inheriting mapping. Therefore, a possible solution in both situations is to consider that the "when" and "where" clauses must hold in the inheriting mapping. Commentary: An interesting discussion is if something similar to the Liskov substitution principle should be applied in this situation.