Open eclipse-qvtd-bot opened 14 hours ago
By Ed Willink on Feb 16, 2018 10:29
The default EMF execution of cannot create abstract type is not that bad if allowed to happen. However the CG synthesizes "createAbstractClass()" which is a missing operation. Need to synthesize "create(...Literals.ABSTRACT_CLASS)".\ But if we're clever enough to vary the create text, we can synthesize a better throw InvalidValueException.
Anyway, we need three domains of support.
a) Analysis/WFRs to detect abstract hazards
b) Tool chain can ignore the "abstract" qualifier
c) CG/evaluator can generate a nice message for create-abstract.
| --- | --- | | Bugzilla Link | 529060 | | Status | NEW | | Importance | P3 normal | | Reported | Dec 21, 2017 04:27 EDT | | Modified | Feb 16, 2018 10:29 EDT | | Blocks | 515236 | | Reporter | Ed Willink |
Description
A polymorphic family of relations/mappings requires a root that is typically not executed since all possible derived input classes have corresponding derived mappings/relations. 'all possible' may be provable for a closed class hierarchy, but it is unprovable in an open class hierarchy.
What happens when an abstract relation/mapping executes?
We could crash like a C++ pure virtual - not very helpful or diagnostic.
We could 'make a noise' - currently there is no ability to 'make a noise'.
We could execute in some minimal fashion - create no output.
A minimal execution has diagnostic value, the trace can be analyzed, and does produce at least a partial output.
The trace will be invalid, since the missing output will be null violating a [1] multiplicity. Rather than change the multiplicity to [?] making all derived from abstract mappings less precise, we could regard the null violation as a good thing. The ill-formed execution produces a usefully ill-formed trace model with validation errors identifying the partial execution failures. No 'noise' needed.
Therefore:
a) QVTc synthesis - no output element realization for abstract
b) WFR - an abstract relation has no when clause - it needs no further inhibition on 'not' execution
c) WFR - an abstract relation has no where clause - there can be no corrolary of 'not' execution
d) WFR - no patterns more more complex than root variables - no guarding/creation is needed
e) diagnosis - derived relations that could drop through to abstract should give warnings on the abstract relation
f) diagnosis - derived classes that have no derived relations should be warnings on the abstract relation
g) refined WFR - an abstract mapping does not have to assign all trace elements
h) execution - must give a suitable failure status if any abstract mapping executed