eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[scheduler] Use discriminator to support non-unique types #165

Open eclipse-qvtd-bot opened 1 week ago

eclipse-qvtd-bot commented 1 week ago

| --- | --- | | Bugzilla Link | 488647 | | Status | NEW | | Importance | P3 normal | | Reported | Feb 28, 2016 09:05 EDT | | Modified | Nov 07, 2018 04:07 EDT | | Blocks | 515236 | | Reporter | Ed Willink |

Description

The original HSV2HLS example used a single HSVNode2HLSNode for both root and recursion mappings. This violates the requirements that the middle type instance provides a unique invocation identity and so causes the early merge to malfunction by merging secondaries into the wrong primary mapping.

Fixed, by a diagnosis of non-uniqueness and a change to have distinct middle types in HSV2HLS.

The old HSV2HLS demnstrates tht the uniqueness requirement is a bit strong; the null/not-null parent can discriminate.

This could be accommodated by a bit of pattern matching to identify the minimum enlarged predicate to distinguish the two cases.

However it is against QVTc philosophy. QVTr should certainly generate distinct middle classes. The QVTc specification is less clear. Anyway just a low priority enhancement.

eclipse-qvtd-bot commented 1 week ago

By Ed Willink on Feb 28, 2016 11:07

Unfortunately this doesn't hold up for the UML2RDBMS QVTc example where the removal of nested mappings results in multiple mappings sharing the same middle type.

eclipse-qvtd-bot commented 1 week ago

By Ed Willink on Feb 29, 2016 07:17

A relatively simple algorithm examining the PropertyAssignments to the middle type that occur in each of the ambiguous mappings, and then selecting the PropertyAssignment with mutually non-conformant values is adequate to discriminate HSL2HLS and UML2RDBMS.

This will often work, but sometimes a deeper search for discriminateable patterns may be required. In the worst case, perhaps the guaranteed fall-back, we may need to have a separate mapping-to-id lookup where the patterns are not discriminateable or are too complex to discriminate efficiently.

Bug remains open pending the guaranteed solution. For now the simple solution works and there is a thrown exception for a discrimination failure.

eclipse-qvtd-bot commented 1 week ago

By Ed Willink on Nov 07, 2018 04:07

Inverse ATL2QVTr provides another use case for discrimination.

OclModel is overloaded to support 'OclMetamodel' and since the two are created in separate relations the two usages appear to create a cycle triggering extra complexities.

The two uses can be discriminated by a null/non-null OclModel.metamodel eliminating the 'cycle'.

Unfortunately the current discrimination code is only used by QVTc and then only for middle classes.


Suggest for QVTr, if there is a Relation cycle, invite all middle/output classes in the cycle to provide a property-discrimination. The cycle analysis can then be reprated on the discrimated classes.