Bug 495327 - [qvtm...] Need an ability to specify that one mapping supersedes another
Summary: [qvtm...] Need an ability to specify that one mapping supersedes another
Status: NEW
Alias: None
Product: QVTd
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 12:50 EDT by Ed Willink CLA
Modified: 2016-06-03 03:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2016-06-02 12:50:38 EDT
In QVTu mapping refinement can ensure that a derived mapping hides a base mapping.

QVTu2QVTm flattens refinement, but discards the priority and exclusion so that all matches happen.

...

Ultimately this means that QVTi execution must be able to make an appropriate dispatch choice amongst a polymorphic group of candidates.
Comment 1 Ed Willink CLA 2016-06-03 03:35:42 EDT
Normal Semantics: naively, all object permutations are passed to all mappings.

Refined semantics: Every mapping has a refined predicate for each of the direct refinements of the mapping. The refined predicate passes if any predicate of the refining mapping fails.

i.e for B refines A1, B refines A2, C1 refines B, C2 refines B.

For a given permutation of objects (C1 and/or C2) or B or (A1 and/or A2) or nothing executes. e.g. if C1 executes, C2 is unaffected, B, A1, A2 are suppressed.

WFR: Refinement relationships form an acyclic directed graph.

---

Consider a stupid refinement of the Ecore metamodel. Mapping A consumes an EReference, Mapping B refines Mapping A and consumes an EAttribute. Mapping B is invoked normally for all EAttributes. Mapping A is invoked for each EReference and the has-Mapping-B-passed predicate is evaluated. Mapping B cannot consume an EReference, so the predicate might pass if Mapping B processed any EAttribute - unhelpful.

WFR: A refining mapping must consume all the inputs of the refined mapping. 

? are same inputs identified by same guard variable name / type / position?

- type doesn't work if two inputs have same type
- position doesn't work for multiple refinement
- name may be very restricting for multiple refinement 
=> name for now (? refinement binding may be needed for flexibility)

---

QVTu2QVTm: the refinement mappings are flattened. The refinement relationship are retained as supersedes relationships.

QVTm2QVTp: the supersedes are retained by the primary partitioned mappings (secondaries have no failing predicates).

QVTp2QVTs: each leaf supersedes is scheduled (e.g. C1 and C2) as supercession of the possibilities e.g. C1,B,A1,A2 or C2,B,A1,A2. The supercession may be pruned by static analysis.

QVTs2QVTi: supersedes relationships are synthesized.

Execution: naively each refinement predicate could just block awaiting the verdict of the refining invocation. More efficiently each refined invocation can be triggered by the failure of its refining mapping before blocking on further refining mappings. Typically a 1:1 direct connection with no overheads.