Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MMT/QVT Declarative Languages"

< MMT
m (New page: Image:http://www.eclipse.org/modeling/m2m/qvtd/documents/LanguageRelationships.png == TxVM == The Transformation Virtual Machine executes the compiled form of a transformation to perf...)
 
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Image:http://www.eclipse.org/modeling/m2m/qvtd/documents/LanguageRelationships.png]]
+
== Example ==
== TxVM ==
+
  
The Transformation Virtual Machine executes the compiled form of a transformation to perform a model to model transformation.
+
A manually transformed example demonstrating these ideas may be found at
  
Plan: The QVTd project will initially use the ATC Virtual Machine from Open Canarias.
+
* host: umlx.cvs.sourceforge.net
 +
* repository: /cvsroot/umlx
 +
* project: examples/org.eclipse.qvt.declarative.examples.qvtcore.uml2rdbms
  
Future: If a more optimised TxVM becomes available QVTd will migrate to use it, otherwise QVTd will evolve the ATC Virtual Machine.
+
or
  
== QVTi ==
+
* [http://umlx.cvs.sourceforge.net/viewvc/umlx/examples/org.eclipse.qvt.declarative.examples.qvtcore.uml2rdbms/qvtcsrc/uml2rdbms.qvtc UML2RDBMS in QVTc]
 +
* [http://umlx.cvs.sourceforge.net/viewvc/umlx/examples/org.eclipse.qvt.declarative.examples.qvtcore.uml2rdbms/qvtcsrc/uml2rdbms.qvtu.qvtc UML2RDBMS in QVTu]
 +
* [http://umlx.cvs.sourceforge.net/viewvc/umlx/examples/org.eclipse.qvt.declarative.examples.qvtcore.uml2rdbms/qvtcsrc/uml2rdbms.qvti.qvtc UML2RDBMS in QVTi]
  
QVTi is a very small unidirectional imperative transformation language that is syntactically a subset of QVTm, QVTu and QVTc.
+
[[Image:QVTdLanguageRelationships.png|right|500px]]
  
QVTi is intended  to be simple to transform to the  representation required by a particular Transformation Viritual Machine.
+
== Imperative OCL VM and OCL VM ==
  
Plan: The QVTd project will develop a QVTi to ATC transformation using QVTo.
+
The OCL Virtual Machine supports declarative evaluation of OCL expressions on models.  
  
=== Imperative Semantics ===
+
The Imperative OCL Virtual Machine adds imperative facilities to support execution of the compiled form of a transformation to perform a model to model transformation.
  
A QVTi transformation is a tree of composed unidirectional mappings without refinement. Each mapping introduces exactly one unbound variable. All output guard patterns are empty.
+
Plan: The QVTd project will initially exploit the direct AST interpretation of the Eclipse OCL pivot evaluator. Debugging will
 +
be provided using the QVTo project's enhancement of the Eclipse OCL ecore evaluator.
  
A QVTi transformation is executed by a single pass depth first traversal of the mapping composition tree.
+
Future: the direct OCL to Java capabilities and optimised dispatch tbaales evolving for use with the Eclipse OCL pivot evaluator will be used to give substantially enhanced performance. Transformation composition and optimisation should provide further performance enhancements.
  
At each node, a new unbound variable is introduced by one of the input or middle guard patterns. The set of bindings for this variable are determined by evaluating all the guard patterns in the context of the binding of each of the parent nodes. For each possible binding, the input, middle and output bottom patterns are evaluated and a sequential traversal of the composed mappings is performed.
+
== QVTi  ==
  
Imperative semantics are imposed by the depth first search with a defined ordering of siblings.
+
QVTi is a very small unidirectional imperative transformation language that is syntactically a subset of QVTm, QVTu and QVTc.  
  
Note that evaluation of middle pattern may create trace model instances, and that evaluation of the output bottom pattern may create or delete instances. An update transformation may therefore use early mappings to identify the required changes and late mappings to impose them without needing to re-access the 'input' model while in a transitional state.
+
QVTi is intended to be simple to transform to the representation required by a particular Transformation Viritual Machine.  
  
== QVTm ==
+
Plan: The QVTd project will enhance the Eclipse OCL evaluator to support direct interpretation of QVTi.
  
QVTm is a very small unidirectional declarative transformation language that is syntactically and semantically a subset of QVTu and QVTc.
+
=== Imperative Semantics  ===
  
QVTm is intended  to be provide an interchange point at which transformations originating from a variety of transformation languages can be brought together to produce efficient composed transformation chains.
+
In addition to the [[#Minimal_Semantics|Minimal Semantics]].  
  
Plan: The QVTd project will develop a QVTm to QVTi transformation using QVTi.
+
A QVTi transformation is a tree of composed unidirectional mappings without refinement. Each mapping introduces exactly one unbound variable.  
  
Future: A QVTi to QVTm transformation could support legacy rescue of QVTo transformations allowing them to be contribute to efficient composed transformation chains.
+
A QVTi transformation is executed by a single pass depth first traversal of the mapping composition tree.  
  
== QVTu ==
+
At each node, a new unbound variable is introduced by one of the input or middle guard patterns. The set of bindings for this variable are determined by evaluating all the guard patterns in the context of the binding of each of the parent nodes. For each possible binding, the input, middle and output bottom patterns are evaluated and a sequential traversal of the composed mappings is performed.
  
QVTu is a simple unidirectional declarative transformation language that is syntactically and semantically a subset of QVTc.
+
Imperative semantics are imposed by the depth first search with a defined ordering of siblings.  
  
QVTu is intended to be a practical programming language for those applications that do not require the full multi-directionality capbilities of QVTc.
+
Note that evaluation of middle pattern may create trace model instances, and that evaluation of the output bottom pattern may create or delete instances. An update transformation may therefore use early mappings to identify the required changes and late mappings to impose them without needing to re-access the 'input' model while in a transitional state.  
  
Plan: The QVTd project will develop a QVTu to QVTm transformation using QVTm
+
==== Validation  ====
 +
<pre>context Mapping
 +
inv: self.oclAsType(Area)-&gt;union(domain).guardPattern.variable-&gt;size() = 1
 +
</pre>
  
== QVTc ==
+
== QVTm  ==
 +
 
 +
QVTm is a minimal unidirectional declarative transformation language that is syntactically and semantically a subset of QVTu and QVTc.
 +
 
 +
QVTm is intended to provide an interchange point at which transformations originating from a variety of transformation languages can be brought together to produce efficient composed transformation chains.
 +
 
 +
Plan: The QVTd project will develop a QVTm to QVTi transformation using QVTi.
 +
 
 +
Future: A QVTi to QVTm transformation could support legacy rescue of QVTo transformations allowing them to be contribute to efficient composed transformation chains.
 +
 
 +
=== Minimal Semantics  ===
 +
 
 +
In addition to the [[#Unidirectional_Semantics|Unidirectional Semantics]]:
 +
 
 +
Refined mappings are flattened.
 +
 
 +
==== Validation  ====
 +
<pre>context Mapping
 +
inv: refinement-&gt;isEmpty() and specification-&gt;isEmpty()
 +
</pre>
 +
== QVTu  ==
 +
 
 +
QVTu is a simple unidirectional declarative transformation language that is syntactically and semantically a subset of QVTc.
 +
 
 +
QVTu is intended to be a practical programming language for those applications that do not require the full multi-directionality capabilities of QVTc.
 +
 
 +
QVTu may be an appropriate entry point at which other declarative transformation languages such as ATL, Epsilon or Viatra2 reuse a shared transformation framework.
 +
 
 +
Plan: The QVTd project will develop a QVTu to QVTm transformation using QVTm
 +
 
 +
=== Unidirectional Semantics  ===
 +
 
 +
The selected direction is identified by the domain attributes.
 +
 
 +
An input only domain is neither isCheckable nor isEnforceable.
 +
 
 +
*a checked domain isCheckable.
 +
*a created output domain isEnforceable.
 +
*an updated output domain is isCheckable and isEnforceable.
 +
 
 +
An input domain has no realized variables or assignments.
 +
 
 +
Middle domain input assignments are replaced by predicates.
 +
 
 +
==== Validation  ====
 +
<pre>context Mapping
 +
inv: domain-&gt;select(isCheckable)-&gt;union(domain-&gt;select(isEnforceable))-&gt;size() = 1
 +
 
 +
context CoreDomain
 +
inv: not isCheckable and not isEnforceable implies bottomPattern.realizedVariable-&gt;isEmpty()
 +
inv: not isCheckable and not isEnforceable implies bottomPattern.assignments-&gt;isEmpty()
 +
</pre>
 +
 
 +
== QVTc  ==
  
 
QVTc is a simple multidirectional declarative transformation language defined by the OMG as the QVT Core Language.
 
QVTc is a simple multidirectional declarative transformation language defined by the OMG as the QVT Core Language.
  
QVTm is intended  to be provide an interchange point at which transformations originating from a variety of transformation languages can be brought together to produce highly efficient composed transformation chains.
+
Plan: The QVTd project will develop a QVTc to QVTu transformation using QVTu.
  
== QVTr ==
+
== QVTr ==
  
QVTr is a higher level multidirectional declarative transformation language defined by the OMG as the QVT Relations Language.
+
QVTr is a higher level multidirectional declarative transformation language defined by the OMG as the QVT Relations Language.  
  
QVTr is intended to be the declarative programming language of choice.
+
QVTr is intended to be the declarative programming language of choice.  
  
Plan: The QVTd project will develop a QVTr to QVTu transformation using QVTu
+
Plan: The QVTd project will develop a QVTr to QVTc transformation using QVTc
  
== QVTo ==
+
== QVTo ==
  
QVTo is a higher level multidirectional imperative transformation language defined by the OMG as the QVT Operational Mappings Language.
+
QVTo is a higher level multidirectional imperative transformation language defined by the OMG as the QVT Operational Mappings Language.  
  
QVTo is supported by the M2M/QVT Operational Project.
+
QVTo is supported by the M2M/QVT Operational Project.  
  
== UMLX ==
+
== UMLX ==
  
UMLX is a higher level graphical syntax for QVTr.
+
UMLX is a higher level graphical syntax for QVTr.  
  
 
UMLX is supported by the GMT/UMLX Project.
 
UMLX is supported by the GMT/UMLX Project.

Latest revision as of 16:29, 16 April 2012

Example

A manually transformed example demonstrating these ideas may be found at

  • host: umlx.cvs.sourceforge.net
  • repository: /cvsroot/umlx
  • project: examples/org.eclipse.qvt.declarative.examples.qvtcore.uml2rdbms

or

QVTdLanguageRelationships.png

Imperative OCL VM and OCL VM

The OCL Virtual Machine supports declarative evaluation of OCL expressions on models.

The Imperative OCL Virtual Machine adds imperative facilities to support execution of the compiled form of a transformation to perform a model to model transformation.

Plan: The QVTd project will initially exploit the direct AST interpretation of the Eclipse OCL pivot evaluator. Debugging will be provided using the QVTo project's enhancement of the Eclipse OCL ecore evaluator.

Future: the direct OCL to Java capabilities and optimised dispatch tbaales evolving for use with the Eclipse OCL pivot evaluator will be used to give substantially enhanced performance. Transformation composition and optimisation should provide further performance enhancements.

QVTi

QVTi is a very small unidirectional imperative transformation language that is syntactically a subset of QVTm, QVTu and QVTc.

QVTi is intended to be simple to transform to the representation required by a particular Transformation Viritual Machine.

Plan: The QVTd project will enhance the Eclipse OCL evaluator to support direct interpretation of QVTi.

Imperative Semantics

In addition to the Minimal Semantics.

A QVTi transformation is a tree of composed unidirectional mappings without refinement. Each mapping introduces exactly one unbound variable.

A QVTi transformation is executed by a single pass depth first traversal of the mapping composition tree.

At each node, a new unbound variable is introduced by one of the input or middle guard patterns. The set of bindings for this variable are determined by evaluating all the guard patterns in the context of the binding of each of the parent nodes. For each possible binding, the input, middle and output bottom patterns are evaluated and a sequential traversal of the composed mappings is performed.

Imperative semantics are imposed by the depth first search with a defined ordering of siblings.

Note that evaluation of middle pattern may create trace model instances, and that evaluation of the output bottom pattern may create or delete instances. An update transformation may therefore use early mappings to identify the required changes and late mappings to impose them without needing to re-access the 'input' model while in a transitional state.

Validation

context Mapping
inv: self.oclAsType(Area)->union(domain).guardPattern.variable->size() = 1

QVTm

QVTm is a minimal unidirectional declarative transformation language that is syntactically and semantically a subset of QVTu and QVTc.

QVTm is intended to provide an interchange point at which transformations originating from a variety of transformation languages can be brought together to produce efficient composed transformation chains.

Plan: The QVTd project will develop a QVTm to QVTi transformation using QVTi.

Future: A QVTi to QVTm transformation could support legacy rescue of QVTo transformations allowing them to be contribute to efficient composed transformation chains.

Minimal Semantics

In addition to the Unidirectional Semantics:

Refined mappings are flattened.

Validation

context Mapping
inv: refinement->isEmpty() and specification->isEmpty()

QVTu

QVTu is a simple unidirectional declarative transformation language that is syntactically and semantically a subset of QVTc.

QVTu is intended to be a practical programming language for those applications that do not require the full multi-directionality capabilities of QVTc.

QVTu may be an appropriate entry point at which other declarative transformation languages such as ATL, Epsilon or Viatra2 reuse a shared transformation framework.

Plan: The QVTd project will develop a QVTu to QVTm transformation using QVTm

Unidirectional Semantics

The selected direction is identified by the domain attributes.

An input only domain is neither isCheckable nor isEnforceable.

  • a checked domain isCheckable.
  • a created output domain isEnforceable.
  • an updated output domain is isCheckable and isEnforceable.

An input domain has no realized variables or assignments.

Middle domain input assignments are replaced by predicates.

Validation

context Mapping
inv: domain->select(isCheckable)->union(domain->select(isEnforceable))->size() = 1

context CoreDomain
inv: not isCheckable and not isEnforceable implies bottomPattern.realizedVariable->isEmpty()
inv: not isCheckable and not isEnforceable implies bottomPattern.assignments->isEmpty()

QVTc

QVTc is a simple multidirectional declarative transformation language defined by the OMG as the QVT Core Language.

Plan: The QVTd project will develop a QVTc to QVTu transformation using QVTu.

QVTr

QVTr is a higher level multidirectional declarative transformation language defined by the OMG as the QVT Relations Language.

QVTr is intended to be the declarative programming language of choice.

Plan: The QVTd project will develop a QVTr to QVTc transformation using QVTc

QVTo

QVTo is a higher level multidirectional imperative transformation language defined by the OMG as the QVT Operational Mappings Language.

QVTo is supported by the M2M/QVT Operational Project.

UMLX

UMLX is a higher level graphical syntax for QVTr.

UMLX is supported by the GMT/UMLX Project.

Back to the top