Community
Participate
Working Groups
The following facilities currently fall somewhere between OCL and QVT, but could significantly facilitate Model Transformations in general and could allow the OCL execution engine to be regarded as a Transformation Virtual Machine. a) Type Constructors (Bug 293622) reuse Tuple syntax as in Date{day:1,month:5,year:2000}. b) Multi-dimensional Collection::product allows a model pattern search space to be specified as the Cartesian products of the instances. A::allInstances->product(B::allInstances(), A::allInstances(), D::allInstances()). (In practice must be supported by lazy branch and bound iterators.) c) Pattern iteration someAs->pattern(a1:A, a2:A; b:B, c:C, d:D | constraint1, constraint2, constraint3) returns the set of all {A, A, B, C, D} matches that satisfy the three constraints. It is naively just someAs->product(A::allInstances(), B::allInstances(), C::allInstances(), D::allInstances)->select(constraint1)->select(constraint2)->select(constraint3) with additional let support to unpack the set of matches for access by each constraint select. In practice the navigation operations within each constraint can be examined to dramatically improve the cost of naive multi-dimensional allInstances and total match. ------ Use of type constructors can express pattern constraints more compactly. Use of separate 'input' and 'output' patterns can establish the mapping candidates with eventual pairing of input-side and output-side pattern tuples establishing the traceability.
At the MODELs OCL workshop, patterns were recognized as a generalized solution to a few specific problems. Looking at it practically, we just migrate the QVTt patterns into OCL. The ewillink/ocl25 branch demonstrates the necessary grammar chnges.