Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd.Willink2013-02-02 13:03:01 +0000
committerEd.Willink2013-02-02 13:03:01 +0000
commit098253501414fd8b6a8bdc5da825c6513b471888 (patch)
tree508d7818ea447eb9ad42bcd565e81560b1d3899c
parentbf69e674679ed074f03399fcc98a5b97c599819b (diff)
downloadorg.eclipse.qvtd-098253501414fd8b6a8bdc5da825c6513b471888.tar.gz
org.eclipse.qvtd-098253501414fd8b6a8bdc5da825c6513b471888.tar.xz
org.eclipse.qvtd-098253501414fd8b6a8bdc5da825c6513b471888.zip
[unrelated] Add imports to make examples mostly error free
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbstractToConcrete.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/ClassModelToClassModel/ClassModelToClassModel.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF/DNF.qvtr37
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF_bbox/DNF_bbox.qvtr39
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/HstmToStm/hstmtostm.qvtr7
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_1.qvtr3
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_2.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/MiToSi/mitosi.qvtr3
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStm/SeqToStm.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStmc_CT/SeqToStmc.qvtr3
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRdbms/UmlToRdbms.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRel/UmlToRel.qvtr2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/FlatRelToCore.qvtr187
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/RelToCore.qvtr168
14 files changed, 245 insertions, 214 deletions
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbstractToConcrete.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbstractToConcrete.qvtr
index 5f640264d..d89d1cdce 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbstractToConcrete.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbstractToConcrete.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import UMLMM : 'ClassMM_IN.emof'::ClassMM;
+
transformation AbstractToConcrete(uml1:UMLMM, uml2:UMLMM)
{
key UMLMM::Type {name};
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/ClassModelToClassModel/ClassModelToClassModel.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/ClassModelToClassModel/ClassModelToClassModel.qvtr
index 57e4302ee..54c208793 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/ClassModelToClassModel/ClassModelToClassModel.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/ClassModelToClassModel/ClassModelToClassModel.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlMM : 'ClassMM.emof'::ClassMM;
+
transformation ClassModelToClassModel(uml1:umlMM, uml2:umlMM)
{
key umlMM::Class{name};
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF/DNF.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF/DNF.qvtr
index 074cb50a5..5195e4014 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF/DNF.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF/DNF.qvtr
@@ -10,13 +10,14 @@
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
-// Transforming an arbitrary boolean expression into disjunctive normal form by using
-// DeMorgan's law
+-- Transforming an arbitrary boolean expression into disjunctive normal form by using
+-- DeMorgan's law
+import exprMM : 'DNFMM.emof'::deMorgansLawMM;
transformation DNF(expr1:exprMM, expr2:exprMM)
{
- // a.(b+c) = (a.b) + (a.c)
+ -- a.(b+c) = (a.b) + (a.c)
top relation EqualByDistributionLaw1
{
p:exprMM::Expr;
@@ -34,11 +35,11 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
{
b:Expr{parent = e2},
c:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -80,7 +81,7 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
}
}
- // (b+c).a = (b.a) + (c.a)
+ -- (b+c).a = (b.a) + (c.a)
top relation EqualByDistributionLaw2
{
p:exprMM::Expr;
@@ -97,12 +98,12 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
{
b:Expr{parent = e2},
c:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e2
},
a:Expr{parent = e1}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -140,7 +141,7 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
when
{
- not EqualByDistributionLaw1(e1, _); // lest (a+b).(c+d) transformed twice!
+ not EqualByDistributionLaw1(e1, _); -- lest (a+b).(c+d) transformed twice!
}
where
@@ -149,7 +150,7 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
}
}
- // ~(a+b) = ~a.~b
+ -- ~(a+b) = ~a.~b
top relation EqualByDeMorganLaw1
{
p:exprMM::Expr;
@@ -166,11 +167,11 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
{
a:Expr{parent = e2},
b:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -205,7 +206,7 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
};
}
- // ~(a.b) = ~a+~b
+ -- ~(a.b) = ~a+~b
top relation EqualByDeMorganLaw2
{
p:exprMM::Expr;
@@ -222,11 +223,11 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
{
a:Expr{parent = e2},
b:Expr{parent = e2}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that NOT only has one operand.
+ ++ emptySequence -- To ensure that NOT only has one operand.
},
parent = p
}
@@ -397,9 +398,9 @@ transformation DNF(expr1:exprMM, expr2:exprMM)
where
{
e1.ID <> e2.ID;
- // ID is unique for each instance.
- // For each run of this relation a new Literal will be created even if
- // a Literal with the same name already exists.
+ -- ID is unique for each instance.
+ -- For each run of this relation a new Literal will be created even if
+ -- a Literal with the same name already exists.
}
}
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF_bbox/DNF_bbox.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF_bbox/DNF_bbox.qvtr
index e69ae256c..72a7b23af 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF_bbox/DNF_bbox.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/DNF_bbox/DNF_bbox.qvtr
@@ -10,19 +10,20 @@
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
-// Transforming an arbitrary boolean expression into disjunctive normal form by using
-// DeMorgan's law
+-- Transforming an arbitrary boolean expression into disjunctive normal form by using
+-- DeMorgan's law
+import exprMM : 'DNFMM.emof'::exprMM;
transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
{
- // a.(b+c) = (a.b) + (a.c)
+ -- a.(b+c) = (a.b) + (a.c)
top relation EqualByDistributionLaw1
{
p:exprMM::Expr;
emptySequence:Sequence(exprMM::Expr);
- replace domain expr1
+ /*replace*/ domain expr1
e1:And
{
expr = e1s:Sequence(Expr)
@@ -34,11 +35,11 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
{
b:Expr{parent = e2},
c:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -80,13 +81,13 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
}
}
- // (b+c).a = (b.a) + (c.a)
+ -- (b+c).a = (b.a) + (c.a)
top relation EqualByDistributionLaw2
{
p:exprMM::Expr;
emptySequence:Sequence(exprMM::Expr);
- replace domain expr1
+ /*replace*/ domain expr1
e1:And
{
expr = e1s:Sequence(Expr)
@@ -97,12 +98,12 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
{
b:Expr{parent = e2},
c:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e2
},
a:Expr{parent = e1}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -140,7 +141,7 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
when
{
- not EqualByDistributionLaw1(e1, _); // lest (a+b).(c+d) transformed twice!
+ not EqualByDistributionLaw1(e1, _); -- lest (a+b).(c+d) transformed twice!
}
where
@@ -149,13 +150,13 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
}
}
- // ~(a+b) = ~a.~b
+ -- ~(a+b) = ~a.~b
top relation EqualByDeMorganLaw1
{
p:exprMM::Expr;
emptySequence:Sequence(exprMM::Expr);
- replace domain expr1
+ /*replace*/ domain expr1
e1:Not
{
expr = e1s:Sequence(Expr)
@@ -166,11 +167,11 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
{
a:Expr{parent = e2},
b:Expr{parent = e2}
- ++ emptySequence // To ensures that OR only has two operands.
+ ++ emptySequence -- To ensures that OR only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = p
}
@@ -205,13 +206,13 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
};
}
- // ~(a.b) = ~a+~b
+ -- ~(a.b) = ~a+~b
top relation EqualByDeMorganLaw2
{
p:exprMM::Expr;
emptySequence:Sequence(exprMM::Expr);
- replace domain expr1
+ /*replace*/ domain expr1
e1:Not
{
expr = e1s:Sequence(Expr)
@@ -222,11 +223,11 @@ transformation DNF_bbox(expr1:exprMM, expr2:exprMM)
{
a:Expr{parent = e2},
b:Expr{parent = e2}
- ++ emptySequence // To ensure that AND only has two operands.
+ ++ emptySequence -- To ensure that AND only has two operands.
},
parent = e1
}
- ++ emptySequence // To ensure that NOT only has one operand.
+ ++ emptySequence -- To ensure that NOT only has one operand.
},
parent = p
}
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/HstmToStm/hstmtostm.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/HstmToStm/hstmtostm.qvtr
index 705bd86c4..aed3b7f16 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/HstmToStm/hstmtostm.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/HstmToStm/hstmtostm.qvtr
@@ -9,6 +9,9 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import hstmMM_p : 'hstmMM.emof'::hstmMM_p;
+import stmMM_p : 'stmMM.emof'::stmMM_p;
+
transformation HstmToStm(hstm:hstmMM_p, stm:stmMM_p)
{
key hstmMM_p::State {name};
@@ -30,7 +33,7 @@ transformation HstmToStm(hstm:hstmMM_p, stm:stmMM_p)
endif
}
- top relation LStateToState // map each Class to Table
+ top relation LStateToState -- map each Class to Table
{
n : String;
@@ -45,7 +48,7 @@ transformation HstmToStm(hstm:hstmMM_p, stm:stmMM_p)
};
}
- top relation CStateToState // map each Class to Table
+ top relation CStateToState -- map each Class to Table
{
tn : String;
ms1: hstmMM_p::State;
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_1.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_1.qvtr
index 49f4f8d05..4d28e66df 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_1.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_1.qvtr
@@ -9,6 +9,9 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlMM : 'umlMM.emof'::umlMM;
+import rdbmsMM : 'rdbmsMM.emof'::rdbmsMM;
+
import UmlToRdbms_2;
transformation UmlToRdbms_1(uml:umlMM, rdbms:rdbmsMM)
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_2.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_2.qvtr
index e16566658..b4346934d 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_2.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/Import/UmlToRdbms_2.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlMM : 'umlMM.emof'::umlMM;
+import rdbmsMM : 'rdbmsMM.emof'::rdbmsMM;
transformation UmlToRdbms_2(uml:umlMM, rdbms:rdbmsMM)
{
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/MiToSi/mitosi.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/MiToSi/mitosi.qvtr
index cebaf8d33..4d100249f 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/MiToSi/mitosi.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/MiToSi/mitosi.qvtr
@@ -9,6 +9,9 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlmmmi : 'umlmmmi.emof'::umlmmmi;
+import javammsi : 'javammsi.emof'::javammsi;
+
transformation MiToSi(uml:umlmmmi, java:javammsi)
{
key umlmmmi::Class {name};
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStm/SeqToStm.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStm/SeqToStm.qvtr
index 193a5d32d..d39d47237 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStm/SeqToStm.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStm/SeqToStm.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import SeqMM : 'SeqMM.emof'::SeqMM;
+import StmcMM : 'StmcMM.emof'::StmcMM;
transformation SeqToStm(seqDgm: SeqMM, stm: StmcMM)
{
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStmc_CT/SeqToStmc.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStmc_CT/SeqToStmc.qvtr
index 968335cce..330f1f41e 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStmc_CT/SeqToStmc.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/SeqToStmc_CT/SeqToStmc.qvtr
@@ -9,6 +9,9 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import SeqMM : 'SeqMM.emof'::SeqMM_CT;
+import StmcMM : 'StmcMM.emof'::StmcMM;
+
transformation SeqToStmc(seqDgm:SeqMM, stmc:StmcMM)
{
top relation LifeLineToStateMachine
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRdbms/UmlToRdbms.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRdbms/UmlToRdbms.qvtr
index d84185ea4..ad628de55 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRdbms/UmlToRdbms.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRdbms/UmlToRdbms.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlMM : 'umlMM.emof'::umlMM;
+import rdbmsMM : 'rdbmsMM.emof'::rdbmsMM;
transformation UmlToRdbms(uml:umlMM, rdbms:rdbmsMM)
{
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRel/UmlToRel.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRel/UmlToRel.qvtr
index 5735d87bb..37e0463f1 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRel/UmlToRel.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/UmlToRel/UmlToRel.qvtr
@@ -9,6 +9,8 @@
* TCS - initial implementation for ModelMorf
* E.D.Willink - alignment with evolved specification
*******************************************************************************/
+import umlmm : 'UmlMM.emof'::umlMM2;
+import relmm : 'RelMM.emof'::relMM2;
transformation UmlToRel(uml:umlmm, rdbms:relmm)
{
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/FlatRelToCore.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/FlatRelToCore.qvtr
index c65078dde..b56991ace 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/FlatRelToCore.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/FlatRelToCore.qvtr
@@ -6,13 +6,16 @@
-- http://www.eclipse.org/legal/epl-v10.html
--
-- Contributors:
--- S.Reddy - Section 10.3 of the QVT 1.0 specification
+-- S.Reddy - Section 10.3 of the OMG MOF-QVT 1.0 specification
-- E.D.Willink - contributions to drafts of the above
+-- E.D.Willink - adaptation to comply with QVT specification
--------------------------------------------------------------------------------
-transformation relToCore(relations:QVTMM, core:QVTMM)
+import QVTMM : 'FlatQVT.emof'::FlatQVT;
+
+transformation relToCore(relations:{QVTMM}, core:{QVTMM})
{
-key QVTMM::Mapping{name, _'transformation'};
+key QVTMM::Mapping{name, transformation};
key QVTMM::GuardPattern{area};
key QVTMM::BottomPattern{area};
key QVTMM::Variable{name, type};
@@ -20,7 +23,7 @@ key QVTMM::Type{name};
key QVTMM::Class{name};
key QVTMM::Property{name, class};
key QVTMM::CoreDomain{name, rule};
-key QVTMM::TypedModel{name, usedPackage, _'transformation'};
+key QVTMM::TypedModel{name, usedPackage, transformation};
key QVTMM::Package{name};
key QVTMM::Transformation{name};
key QVTMM::Operation{name};
@@ -28,7 +31,7 @@ key QVTMM::Predicate{pattern, conditionExpression};
query getSharedDomainVars(r:QVTMM::Relation):Set(QVTMM::Variable)
{
- r._'domain'->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
+ r.domain->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
if (vars->isEmpty())
then
vars->union(d.oclAsType(QVTMM::RelationDomain).pattern.bindsTo)
@@ -43,7 +46,7 @@ query getWhenVars(r:QVTMM::Relation):Set(QVTMM::Variable)
let
vs:Set(QVTMM::Variable) = Set{}
in
- r._'domain'->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
+ r.domain->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
if (vars->isEmpty())
then
vars->union(d.oclAsType(QVTMM::RelationDomain).pattern.bindsTo)
@@ -158,7 +161,7 @@ top relation RelationToTraceClass
domain relations r:Relation {
name = rn,
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
pattern = rdp:DomainPattern {
templateExpression = t:ObjectTemplateExp {
bindsTo = tv:Variable {
@@ -266,14 +269,14 @@ top relation TopLevelRelationToMappingForChecking
mt: QVTMM::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = true,
name = rn
} {
- not r._'domain'->exists(d| d.isEnforceable = true)
+ not r.domain->exists(d| d.isEnforceable = true)
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn,
guardPattern = mg:GuardPattern {
area = m
@@ -288,10 +291,10 @@ top relation TopLevelRelationToMappingForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
acc->including(md.oclAsType(QVTMM::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
unsharedWhereVars =
@@ -315,7 +318,7 @@ top relation TopLevelRelationToMappingForChecking
relation RWherePatternToMPattern
{
domain relations r:Relation{
- _'where' = wherep:Pattern { }
+ where = wherep:Pattern { }
};
enforce domain core mp:Pattern {};
where {
@@ -413,17 +416,17 @@ top relation TopLevelRelationToMappingForEnforcement
mt: QVTMM::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = true,
name = rn,
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
rd:RelationDomain {
isEnforceable = true,
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable) {},
@@ -435,7 +438,7 @@ top relation TopLevelRelationToMappingForEnforcement
}
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+dn,
guardPattern = mg:GuardPattern {
area = m
@@ -445,13 +448,13 @@ top relation TopLevelRelationToMappingForEnforcement
tcv:RealizedVariable {} ++ mbVars
}
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
area = md
@@ -465,15 +468,15 @@ top relation TopLevelRelationToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
acc->including(md.oclAsType(QVTMM::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
-- Exclude where clause relation calls.
-- The predicate corresponding to a where clause relation call is included not in this
-- mapping but in the one corresponding to the invoked relation (refer to rule 2.6.1)
- rpSet = r._'where'.predicate->reject(p |
+ rpSet = r.where.predicate->reject(p |
p.conditionExpression.oclIsTypeOf(QVTMM::RelationCallExp));
oppositeDomainVars = rOppositeDomains->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
@@ -540,21 +543,21 @@ top relation InvokedRelationToMappingForChecking
whereVars: Set(QVTMM::Variable);
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = false,
name = rn,
- relationCallExp = ri:RelationCallExp {
- predicate = p:Predicate {
+ RelationCallExp = ri:RelationCallExp {
+ Predicate = p:Predicate {
pattern = pt:Pattern {
whereOwner = ir:Relation {name = irn}
}
}
}
} {
- not r._'domain'->exists(d| d.isEnforceable = true)
+ not r.domain->exists(d| d.isEnforceable = true)
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+irn,
guardPattern = mg:GuardPattern {
area = m
@@ -569,10 +572,10 @@ top relation InvokedRelationToMappingForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
acc->including(md.oclAsType(QVTMM::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
unsharedWhereVars =
(whereVars - whenVars - allDomainVars)->union(sharedDomainVars);
@@ -631,24 +634,24 @@ top relation InvokedRelationToMappingForEnforcement
mt: QVTMM::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = false,
name = rn,
- relationCallExp = ri:RelationCallExp {
- predicate = p:Predicate {
+ RelationCallExp = ri:RelationCallExp {
+ Predicate = p:Predicate {
pattern = pt:Pattern {
whereOwner = ir:Relation {name = irn}
}
}
},
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
rd:RelationDomain {
isEnforceable = true,
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable) {},
@@ -660,7 +663,7 @@ top relation InvokedRelationToMappingForEnforcement
}
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+irn+'_'+dn,
guardPattern = mg:GuardPattern {
area = m
@@ -670,13 +673,13 @@ top relation InvokedRelationToMappingForEnforcement
tcv:RealizedVariable {} ++ mbVars
}
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
bindsTo = dgVars:Set(Variable) {}
@@ -690,15 +693,15 @@ top relation InvokedRelationToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
acc->including(md.oclAsType(QVTMM::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
-- Exclude where clause relation calls.
-- The predicate corresponding to a where clause relation call is included not in this
-- mapping but in the one corresponding to the invoked relation (refer to rule 2.6.1)
- rpSet = r._'where'.predicate->reject(p |
+ rpSet = r.where.predicate->reject(p |
p.conditionExpression.oclIsTypeOf(QVTMM::RelationCallExp));
oppositeDomainVars = rOppositeDomains->iterate(d; vars: Set(QVTMM::Variable) = Set{} |
@@ -752,13 +755,13 @@ relation RDomainToMDomainForChecking
mt: QVTMM::Transformation;
domain relations r:Relation {
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
name = dn,
isCheckable = true,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable){},
@@ -770,13 +773,13 @@ relation RDomainToMDomainForChecking
bottomPattern = mb:BottomPattern {
area = m
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isCheckable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
area = md
@@ -790,7 +793,7 @@ relation RDomainToMDomainForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
domainVarsSharedWithWhen = domainVars->intersection(whenVars);
domainBottomUnSharedVars = domainVars - whenVars - sharedDomainVars;
@@ -826,13 +829,13 @@ relation IROppositeDomainsToMappingForEnforcement
domain relations oppDomainSeq:Sequence(Element) {
r:Relation {
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
ord:RelationDomain { -- opposite domain
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = rt
+ transformation = rt
},
isCheckable = c,
pattern = dp:DomainPattern {
@@ -851,12 +854,12 @@ relation IROppositeDomainsToMappingForEnforcement
ord <> rd
};
enforce domain core m:Mapping {
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
isCheckable = c,
isEnforceable = false,
@@ -875,7 +878,7 @@ relation IROppositeDomainsToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
domainTopVars = domainVars->intersection(whenVars)->including(tev);
sharedDomainVars = getSharedDomainVars(r);
domainBottomUnSharedVars = (domainVars - whenVars - sharedDomainVars)->excluding(tev);
@@ -910,13 +913,13 @@ relation TROppositeDomainsToMappingForEnforcement
domain relations oppDomainSeq:Sequence(Element) {
r:Relation {
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
ord:RelationDomain {
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = rt
+ transformation = rt
},
isCheckable = c,
pattern = dp:DomainPattern {
@@ -932,16 +935,17 @@ relation TROppositeDomainsToMappingForEnforcement
ord <> rd
};
enforce domain core m:Mapping {
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
isCheckable = c,
isEnforceable = false,
guardPattern = dg:GuardPattern {
+ bindsTo = dgVars:Set(Variable) {},
area = cd
},
bottomPattern = db:BottomPattern {
@@ -953,7 +957,7 @@ relation TROppositeDomainsToMappingForEnforcement
}
};
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
domainTopVars = domainVars->intersection(whenVars);
sharedDomainVars = getSharedDomainVars(r);
domainBottomUnSharedVars = domainVars - whenVars - sharedDomainVars;
@@ -975,13 +979,13 @@ relation RWhenPatternToMGuardPattern
unsharedWhenVars: Set(QVTMM::Variable);
domain relations r:Relation{
- _'when' = whenp:Pattern {
+ when = whenp:Pattern {
bindsTo = whenVars:Set(Variable) {}
}
};
enforce domain core mg:GuardPattern {};
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(QVTMM::RelationDomain)=Set{} |
acc->including(md.oclAsType(QVTMM::RelationDomain))).pattern.bindsTo->asSet();
unsharedWhenVars = whenVars - allDomainVars;
@@ -1085,7 +1089,7 @@ relation RWhenRelCallToMGuard
predicate = pd:Predicate {
conditionExpression = e:RelationCallExp {
referredRelation = r:Relation {
- _'domain' = dseq:Sequence(RelationDomain) {}
+ domain = dseq:Sequence(RelationDomain) {}
},
argument = aseq:Sequence(VariableExp) {}
}
@@ -1150,7 +1154,7 @@ relation RInvokerToMGuard
argument = aseq:Sequence(VariableExp) {}
},
r:Relation { -- invoked relation
- _'domain' = dseq:Sequence(RelationDomain) {}
+ domain = dseq:Sequence(RelationDomain) {}
}
++ _
};
@@ -1244,10 +1248,8 @@ relation RDomainToMDBottomForEnforcement
}
};
where {
- predicatesWithoutVarBindings = rdtVarsSeq->at(2)->iterate(md; acc:Set(QVTMM::Predicate)=Set{} |
- acc->including(md.oclAsType(QVTMM::Predicate)));
- unboundDomainVars = rdtVarsSeq->at(3)->iterate(md; acc:Set(QVTMM::Variable)=Set{} |
- acc->including(md.oclAsType(QVTMM::Variable)));
+ rdtVarsSeq->at(2) = predicatesWithoutVarBindings;
+ rdtVarsSeq->at(3) = unboundDomainVars;
remainingUnBoundDomainVars = unboundDomainVars - Set{v};
predicatesWithVarBindings = filterOutPredicatesThatReferToVars(
@@ -1335,8 +1337,7 @@ relation RDomainToMBottomPredicateForEnforcement
RelationDomainToTraceClassVar(rdSeq, tcv);
RVarToMVar(v, mv);
- predicatesWithoutVarBindings = rdtVarsSeq->at(2)->iterate(md; acc:Set(QVTMM::Predicate)=Set{} |
- acc->including(md.oclAsType(QVTMM::Predicate)));
+ rdtVarsSeq->at(2) = predicatesWithoutVarBindings;
rdtVarsSeq->at(3) = unboundDomainVars;
remainingUnBoundDomainVars = unboundDomainVars - Set{v};
@@ -1381,7 +1382,7 @@ relation RDomainToMDBottomForEnforcementOfIdentityProp
value = e:OclExpression {}
}
} {
- c._'key'.part->includes(pp)
+ c.Key.part->includes(pp)
}
++ _
};
@@ -1419,7 +1420,7 @@ relation RDomainToMDBottomForEnforcementOfIdentityPropObject
value = e:ObjectTemplateExp {bindsTo = tv:Variable{}}
}
} {
- c._'key'.part->includes(pp)
+ c.Key.part->includes(pp)
}
++ _
};
@@ -1567,7 +1568,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
domain relations rtdSeq:Sequence(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
te:ObjectTemplateExp {
bindsTo = v:Variable {type = c:Class {}},
@@ -1576,7 +1577,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
value = e:OclExpression {}
}
} {
- (not c._'key'.part->includes(pp)) and (not e.oclIsKindOf(TemplateExp))
+ (not c.Key.part->includes(pp)) and (not e.oclIsKindOf(TemplateExp))
},
rd:RelationDomain {
pattern = rdp:DomainPattern {
@@ -1588,7 +1589,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
enforce domain core m:Mapping {
local = cm:Mapping {
name = m.name+'_forNonIdentityProp',
- _'transformation' = mt:Transformation{},
+ transformation = mt:Transformation{},
bottomPattern = bp:BottomPattern {
assignment = a:PropertyAssignment {
slotExpression = ve:VariableExp{referredVariable = mv},
@@ -1620,7 +1621,7 @@ relation RDomainToMComposedMappingGuard
domain relations rtdSeq:Sequence(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
te:ObjectTemplateExp {},
rd:RelationDomain {
@@ -1628,7 +1629,7 @@ relation RDomainToMComposedMappingGuard
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = rdp:DomainPattern {
templateExpression = rdt:ObjectTemplateExp {}
@@ -1655,12 +1656,12 @@ relation RDomainToMComposedMappingGuard
}
}
},
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = cmdg:GuardPattern {
bindsTo = mv
@@ -1689,14 +1690,14 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
domain relations rdtVarsSeq:Sequence(Set(Element)) {
rdtSet:Set(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
rd:RelationDomain {
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
}
},
te:ObjectTemplateExp {
@@ -1706,7 +1707,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
value = pte:ObjectTemplateExp {bindsTo = pv:Variable {}}
}
} {
- not c._'key'.part->includes(pp)
+ not c.Key.part->includes(pp)
}
++ _
}
@@ -1715,14 +1716,14 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
enforce domain core m:Mapping {
local = cm:Mapping {
name = m.name+'_for_'+pv.name,
- _'transformation' = mt:Transformation{},
- _'domain' = cd:CoreDomain {
+ transformation = mt:Transformation{},
+ domain = cd:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
bottomPattern = cmdb:BottomPattern {
realizedVariable = mpv:RealizedVariable {},
@@ -1745,10 +1746,8 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
RVarToMVar(v, mv);
RVarToMRealizedVar(pv, mpv);
- predicatesWithoutVarBindings = rdtVarsSeq->at(2)->iterate(md; acc:Set(QVTMM::Predicate)=Set{} |
- acc->including(md.oclAsType(QVTMM::Predicate)));
- unboundDomainVars = rdtVarsSeq->at(3)->iterate(md; acc:Set(QVTMM::Variable)=Set{} |
- acc->including(md.oclAsType(QVTMM::Variable)));
+ rdtVarsSeq->at(2) = predicatesWithoutVarBindings;
+ rdtVarsSeq->at(3) = unboundDomainVars;
rdtSetNext = Set{r, rd, pte};
rdtVarsSeqRest = Sequence{rdtSetNext, predicatesWithoutVarBindings, unboundDomainVars};
@@ -1896,7 +1895,7 @@ relation RDomainVarsToTraceClassProps
domain relations rd:RelationDomain {
rule = r:Relation{},
pattern = dp:DomainPattern {
- bindsTo = domainVars:Set(Variable) {dv:Variable {templateExp = te: TemplateExp{}}++_}
+ bindsTo = domainVars:Set(Variable) {dv:Variable {TemplateExp = te: TemplateExp{}}++_}
}
};
enforce domain core mb:BottomPattern {
@@ -1922,7 +1921,7 @@ relation ROppositeDomainVarsToTraceClassProps
r:Relation {},
rd:RelationDomain {} ++ _
},
- domainVars:Set(Variable) {dv:Variable{templateExp = te:TemplateExp{}} ++ _}
+ domainVars:Set(Variable) {dv:Variable{TemplateExp = te:TemplateExp{}} ++ _}
++ _
};
enforce domain core mb:BottomPattern {
@@ -1980,7 +1979,7 @@ relation RRelImplToMBottomEnforcementOperation
relation RRelDomainsToMOpCallArg
{
domain relations r:Relation {
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
pattern = p:DomainPattern{bindsTo = rv:Variable{}}
}
};
@@ -2033,9 +2032,7 @@ relation RelationDomainToTraceClassVar
relation RExpToMExp
{
domain relations re:OclExpression{};
- enforce domain core me:OclExpression{} implementedby CopyOclExpession(re, me);
+ enforce domain core me:OclExpression{} /*implementedby CopyOclExpession(re, me)*/;
}
-}
-
-
+} \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/RelToCore.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/RelToCore.qvtr
index 400f4f220..45968e006 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/RelToCore.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.reltocore/qvtrsrc/RelToCore.qvtr
@@ -10,10 +10,17 @@
-- E.D.Willink - contributions to drafts of the above
-- E.D.Willink - adaptation to comply with QVT specification
--------------------------------------------------------------------------------
+import emof : 'platform:/resource/org.eclipse.qvt/model/ecore/EMOF.ecore'::EMOF;
+import essentialocl : 'platform:/resource/org.eclipse.qvt/model/ecore/EssentialOCL.ecore'::EssentialOCL;
+import qvtbase : 'platform:/resource/org.eclipse.qvt/model/ecore/QVTBase.ecore'::QVTBase;
+import qvttemplate : 'platform:/resource/org.eclipse.qvt/model/ecore/QVTTemplate.ecore'::QVTTemplate;
+import qvtrelation : 'platform:/resource/org.eclipse.qvt/model/ecore/QVTRelation.ecore'::QVTRelation;
+import qvtcore : 'platform:/resource/org.eclipse.qvt/model/ecore/QVTCore.ecore'::QVTCore;
+
transformation relToCore(relations:{qvtrelation,qvttemplate,qvtbase,essentialocl,emof}, core:{qvtcore,qvtbase,essentialocl,emof})
{
-key qvtcore::Mapping{name, _'transformation'};
+key qvtcore::Mapping{name, transformation};
key qvtcore::GuardPattern{area};
key qvtcore::BottomPattern{area};
key essentialocl::Variable{name, type};
@@ -21,7 +28,7 @@ key emof::Type{name};
key emof::Class{name};
key emof::Property{name, class};
key qvtcore::CoreDomain{name, rule};
-key qvtbase::TypedModel{name, usedPackage, _'transformation'};
+key qvtbase::TypedModel{name, usedPackage, transformation};
key emof::Package{name};
key qvtbase::Transformation{name};
key emof::Operation{name};
@@ -29,7 +36,7 @@ key qvtbase::Predicate{pattern, conditionExpression};
query getSharedDomainVars(r:qvtrelation::Relation):Set(essentialocl::Variable)
{
- r._'domain'->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
+ r.domain->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
if (vars->isEmpty())
then
vars->union(d.oclAsType(qvtrelation::RelationDomain).pattern.bindsTo)
@@ -44,7 +51,7 @@ query getWhenVars(r:qvtrelation::Relation):Set(essentialocl::Variable)
let
vs:Set(essentialocl::Variable) = Set{}
in
- r._'domain'->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
+ r.domain->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
if (vars->isEmpty())
then
vars->union(d.oclAsType(qvtrelation::RelationDomain).pattern.bindsTo)
@@ -159,7 +166,7 @@ top relation RelationToTraceClass
domain relations r:Relation {
name = rn,
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
pattern = rdp:DomainPattern {
templateExpression = t:ObjectTemplateExp {
bindsTo = tv:Variable {
@@ -267,14 +274,14 @@ top relation TopLevelRelationToMappingForChecking
mt: qvtbase::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = true,
name = rn
} {
- not r._'domain'->exists(d| d.isEnforceable = true)
+ not r.domain->exists(d| d.isEnforceable = true)
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn,
guardPattern = mg:GuardPattern {
area = m
@@ -289,10 +296,10 @@ top relation TopLevelRelationToMappingForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
acc->including(md.oclAsType(qvtrelation::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
unsharedWhereVars =
@@ -316,7 +323,7 @@ top relation TopLevelRelationToMappingForChecking
relation RWherePatternToMPattern
{
domain relations r:Relation{
- _'where' = wherep:Pattern { }
+ where = wherep:Pattern { }
};
enforce domain core mp:Pattern {};
where {
@@ -414,17 +421,17 @@ top relation TopLevelRelationToMappingForEnforcement
mt: qvtbase::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = true,
name = rn,
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
rd:RelationDomain {
isEnforceable = true,
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable) {},
@@ -436,7 +443,7 @@ top relation TopLevelRelationToMappingForEnforcement
}
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+dn,
guardPattern = mg:GuardPattern {
area = m
@@ -446,13 +453,13 @@ top relation TopLevelRelationToMappingForEnforcement
tcv:RealizedVariable {} ++ mbVars
}
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
area = md
@@ -466,15 +473,15 @@ top relation TopLevelRelationToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
acc->including(md.oclAsType(qvtrelation::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
-- Exclude where clause relation calls.
-- The predicate corresponding to a where clause relation call is included not in this
-- mapping but in the one corresponding to the invoked relation (refer to rule 2.6.1)
- rpSet = r._'where'.predicate->reject(p |
+ rpSet = r.where.predicate->reject(p |
p.conditionExpression.oclIsTypeOf(qvtrelation::RelationCallExp));
oppositeDomainVars = rOppositeDomains->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
@@ -541,21 +548,21 @@ top relation InvokedRelationToMappingForChecking
whereVars: Set(essentialocl::Variable);
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = false,
name = rn,
- relationCallExp = ri:RelationCallExp {
- predicate = p:Predicate {
+ RelationCallExp = ri:RelationCallExp {
+ Predicate = p:Predicate {
pattern = pt:Pattern {
whereOwner = ir:Relation {name = irn}
}
}
}
} {
- not r._'domain'->exists(d| d.isEnforceable = true)
+ not r.domain->exists(d| d.isEnforceable = true)
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+irn,
guardPattern = mg:GuardPattern {
area = m
@@ -570,10 +577,10 @@ top relation InvokedRelationToMappingForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
acc->including(md.oclAsType(qvtrelation::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
unsharedWhereVars =
(whereVars - whenVars - allDomainVars)->union(sharedDomainVars);
@@ -632,24 +639,24 @@ top relation InvokedRelationToMappingForEnforcement
mt: qvtbase::Transformation;
domain relations r:Relation {
- _'transformation' = rt,
+ transformation = rt,
isTopLevel = false,
name = rn,
- relationCallExp = ri:RelationCallExp {
- predicate = p:Predicate {
+ RelationCallExp = ri:RelationCallExp {
+ Predicate = p:Predicate {
pattern = pt:Pattern {
whereOwner = ir:Relation {name = irn}
}
}
},
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
rd:RelationDomain {
isEnforceable = true,
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable) {},
@@ -661,7 +668,7 @@ top relation InvokedRelationToMappingForEnforcement
}
};
enforce domain core m:Mapping {
- _'transformation' = mt,
+ transformation = mt,
name = rn+'_'+irn+'_'+dn,
guardPattern = mg:GuardPattern {
area = m
@@ -671,13 +678,13 @@ top relation InvokedRelationToMappingForEnforcement
tcv:RealizedVariable {} ++ mbVars
}
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
bindsTo = dgVars:Set(Variable) {}
@@ -691,15 +698,15 @@ top relation InvokedRelationToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
acc->including(md.oclAsType(qvtrelation::RelationDomain))).pattern.bindsTo->asSet();
- whenVars = r._'when'.bindsTo;
- whereVars = r._'where'.bindsTo;
+ whenVars = r.when.bindsTo;
+ whereVars = r.where.bindsTo;
-- Exclude where clause relation calls.
-- The predicate corresponding to a where clause relation call is included not in this
-- mapping but in the one corresponding to the invoked relation (refer to rule 2.6.1)
- rpSet = r._'where'.predicate->reject(p |
+ rpSet = r.where.predicate->reject(p |
p.conditionExpression.oclIsTypeOf(qvtrelation::RelationCallExp));
oppositeDomainVars = rOppositeDomains->iterate(d; vars: Set(essentialocl::Variable) = Set{} |
@@ -753,13 +760,13 @@ relation RDomainToMDomainForChecking
mt: qvtbase::Transformation;
domain relations r:Relation {
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
name = dn,
isCheckable = true,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = dp:DomainPattern {
bindsTo = domainVars:Set(Variable){},
@@ -771,13 +778,13 @@ relation RDomainToMDomainForChecking
bottomPattern = mb:BottomPattern {
area = m
},
- _'domain' = md:CoreDomain {
+ domain = md:CoreDomain {
name = dn,
isCheckable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = dg:GuardPattern {
area = md
@@ -791,7 +798,7 @@ relation RDomainToMDomainForChecking
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
sharedDomainVars = getSharedDomainVars(r);
domainVarsSharedWithWhen = domainVars->intersection(whenVars);
domainBottomUnSharedVars = domainVars - whenVars - sharedDomainVars;
@@ -827,13 +834,13 @@ relation IROppositeDomainsToMappingForEnforcement
domain relations oppDomainSeq:Sequence(Element) {
r:Relation {
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
ord:RelationDomain { -- opposite domain
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = rt
+ transformation = rt
},
isCheckable = c,
pattern = dp:DomainPattern {
@@ -852,12 +859,12 @@ relation IROppositeDomainsToMappingForEnforcement
ord <> rd
};
enforce domain core m:Mapping {
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
isCheckable = c,
isEnforceable = false,
@@ -876,7 +883,7 @@ relation IROppositeDomainsToMappingForEnforcement
RelationalTransformationToMappingTransformation(rt, mt);
}
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
domainTopVars = domainVars->intersection(whenVars)->including(tev);
sharedDomainVars = getSharedDomainVars(r);
domainBottomUnSharedVars = (domainVars - whenVars - sharedDomainVars)->excluding(tev);
@@ -911,13 +918,13 @@ relation TROppositeDomainsToMappingForEnforcement
domain relations oppDomainSeq:Sequence(Element) {
r:Relation {
- _'domain' = rds:Set(RelationDomain) {
+ domain = rds:Set(RelationDomain) {
ord:RelationDomain {
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = rt
+ transformation = rt
},
isCheckable = c,
pattern = dp:DomainPattern {
@@ -933,16 +940,17 @@ relation TROppositeDomainsToMappingForEnforcement
ord <> rd
};
enforce domain core m:Mapping {
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
isCheckable = c,
isEnforceable = false,
guardPattern = dg:GuardPattern {
+ bindsTo = dgVars:Set(Variable) {},
area = cd
},
bottomPattern = db:BottomPattern {
@@ -954,7 +962,7 @@ relation TROppositeDomainsToMappingForEnforcement
}
};
where {
- whenVars = r._'when'.bindsTo;
+ whenVars = r.when.bindsTo;
domainTopVars = domainVars->intersection(whenVars);
sharedDomainVars = getSharedDomainVars(r);
domainBottomUnSharedVars = domainVars - whenVars - sharedDomainVars;
@@ -976,13 +984,13 @@ relation RWhenPatternToMGuardPattern
unsharedWhenVars: Set(essentialocl::Variable);
domain relations r:Relation{
- _'when' = whenp:Pattern {
+ when = whenp:Pattern {
bindsTo = whenVars:Set(Variable) {}
}
};
enforce domain core mg:GuardPattern {};
where {
- allDomainVars = r._'domain'->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
+ allDomainVars = r.domain->iterate(md; acc:Set(qvtrelation::RelationDomain)=Set{} |
acc->including(md.oclAsType(qvtrelation::RelationDomain))).pattern.bindsTo->asSet();
unsharedWhenVars = whenVars - allDomainVars;
@@ -1086,7 +1094,7 @@ relation RWhenRelCallToMGuard
predicate = pd:Predicate {
conditionExpression = e:RelationCallExp {
referredRelation = r:Relation {
- _'domain' = dseq:Sequence(RelationDomain) {}
+ domain = dseq:Sequence(RelationDomain) {}
},
argument = aseq:Sequence(VariableExp) {}
}
@@ -1151,7 +1159,7 @@ relation RInvokerToMGuard
argument = aseq:Sequence(VariableExp) {}
},
r:Relation { -- invoked relation
- _'domain' = dseq:Sequence(RelationDomain) {}
+ domain = dseq:Sequence(RelationDomain) {}
}
++ _
};
@@ -1379,7 +1387,7 @@ relation RDomainToMDBottomForEnforcementOfIdentityProp
value = e:OclExpression {}
}
} {
- c._'key'.part->includes(pp)
+ c.Key.part->includes(pp)
}
++ _
};
@@ -1417,7 +1425,7 @@ relation RDomainToMDBottomForEnforcementOfIdentityPropObject
value = e:ObjectTemplateExp {bindsTo = tv:Variable{}}
}
} {
- c._'key'.part->includes(pp)
+ c.Key.part->includes(pp)
}
++ _
};
@@ -1565,7 +1573,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
domain relations rtdSeq:Sequence(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
te:ObjectTemplateExp {
bindsTo = v:Variable {type = c:Class {}},
@@ -1574,7 +1582,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
value = e:OclExpression {}
}
} {
- (not c._'key'.part->includes(pp)) and (not e.oclIsKindOf(TemplateExp))
+ (not c.Key.part->includes(pp)) and (not e.oclIsKindOf(TemplateExp))
},
rd:RelationDomain {
pattern = rdp:DomainPattern {
@@ -1586,7 +1594,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive
enforce domain core m:Mapping {
local = cm:Mapping {
name = m.name+'_forNonIdentityProp',
- _'transformation' = mt:Transformation{},
+ transformation = mt:Transformation{},
bottomPattern = bp:BottomPattern {
assignment = a:PropertyAssignment {
slotExpression = ve:VariableExp{referredVariable = mv},
@@ -1618,7 +1626,7 @@ relation RDomainToMComposedMappingGuard
domain relations rtdSeq:Sequence(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
te:ObjectTemplateExp {},
rd:RelationDomain {
@@ -1626,7 +1634,7 @@ relation RDomainToMComposedMappingGuard
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
},
pattern = rdp:DomainPattern {
templateExpression = rdt:ObjectTemplateExp {}
@@ -1653,12 +1661,12 @@ relation RDomainToMComposedMappingGuard
}
}
},
- _'domain' = cd:CoreDomain {
+ domain = cd:CoreDomain {
name = dn,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
guardPattern = cmdg:GuardPattern {
bindsTo = mv
@@ -1687,14 +1695,14 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
domain relations rdtVarsSeq:Sequence(Set(Element)) {
rdtSet:Set(Element) {
r:Relation{
- _'transformation' = rt:RelationalTransformation{}
+ transformation = rt:RelationalTransformation{}
},
rd:RelationDomain {
name = dn,
typedModel = dir:TypedModel {
name = tmn,
usedPackage = up:Package{},
- _'transformation' = rt
+ transformation = rt
}
},
te:ObjectTemplateExp {
@@ -1704,7 +1712,7 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
value = pte:ObjectTemplateExp {bindsTo = pv:Variable {}}
}
} {
- not c._'key'.part->includes(pp)
+ not c.Key.part->includes(pp)
}
++ _
}
@@ -1713,14 +1721,14 @@ relation RDomainToMDBottomForEnforcementOfNonIdentityPropObject
enforce domain core m:Mapping {
local = cm:Mapping {
name = m.name+'_for_'+pv.name,
- _'transformation' = mt:Transformation{},
- _'domain' = cd:CoreDomain {
+ transformation = mt:Transformation{},
+ domain = cd:CoreDomain {
name = dn,
isEnforceable = true,
typedModel = mdir:TypedModel {
name = tmn,
usedPackage = up,
- _'transformation' = mt
+ transformation = mt
},
bottomPattern = cmdb:BottomPattern {
realizedVariable = mpv:RealizedVariable {},
@@ -1892,7 +1900,7 @@ relation RDomainVarsToTraceClassProps
domain relations rd:RelationDomain {
rule = r:Relation{},
pattern = dp:DomainPattern {
- bindsTo = domainVars:Set(Variable) {dv:Variable {templateExp = te: TemplateExp{}}++_}
+ bindsTo = domainVars:Set(Variable) {dv:Variable {TemplateExp = te: TemplateExp{}}++_}
}
};
enforce domain core mb:BottomPattern {
@@ -1918,7 +1926,7 @@ relation ROppositeDomainVarsToTraceClassProps
r:Relation {},
rd:RelationDomain {} ++ _
},
- domainVars:Set(Variable) {dv:Variable{templateExp = te:TemplateExp{}} ++ _}
+ domainVars:Set(Variable) {dv:Variable{TemplateExp = te:TemplateExp{}} ++ _}
++ _
};
enforce domain core mb:BottomPattern {
@@ -1976,7 +1984,7 @@ relation RRelImplToMBottomEnforcementOperation
relation RRelDomainsToMOpCallArg
{
domain relations r:Relation {
- _'domain' = rd:RelationDomain {
+ domain = rd:RelationDomain {
pattern = p:DomainPattern{bindsTo = rv:Variable{}}
}
};
@@ -2029,7 +2037,7 @@ relation RelationDomainToTraceClassVar
relation RExpToMExp
{
domain relations re:OclExpression{};
- enforce domain core me:OclExpression{} implementedby CopyOclExpession(re, me);
+ enforce domain core me:OclExpression{} /*implementedby CopyOclExpession(re, me)*/;
}
} \ No newline at end of file

Back to the top