Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-05-17 16:31:11 +0000
committerEd Willink2016-05-17 16:54:06 +0000
commit906ab24f80cbb50d920bd1ede47bee33164ceb94 (patch)
treee34fd565de7b534066577548fb4871999487a2ec
parent47c5a4458adfb94fd3b7f2eb67d87922ddbc7017 (diff)
downloadorg.eclipse.qvtd-ewillink/493791.tar.gz
org.eclipse.qvtd-ewillink/493791.tar.xz
org.eclipse.qvtd-ewillink/493791.zip
[493791] Avoid input assignmentsewillink/493791
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/hstm2stm/HstmToStm.qvtc202
1 files changed, 101 insertions, 101 deletions
diff --git a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/hstm2stm/HstmToStm.qvtc b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/hstm2stm/HstmToStm.qvtc
index 7c3ec4681..5f0f4aef8 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/hstm2stm/HstmToStm.qvtc
+++ b/tests/org.eclipse.qvtd.xtext.qvtcore.tests/src/org/eclipse/qvtd/xtext/qvtcore/tests/hstm2stm/HstmToStm.qvtc
@@ -1,102 +1,102 @@
-/*******************************************************************************
- * Copyright (c) 2007,2008 Tata Consultancy Services and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * TCS - initial implementation for ModelMorf
- * E.D.Willink - alignment with evolved specification
- * Horacio Hoyos - transliterate to QVTc
- *******************************************************************************/
-import hstmMM : 'hstmMM.emof'::hstmMM_p;
-import stmMM : 'stmMM.emof'::stmMM_p;
-import hstm2stmMM : 'hstm2stmMM.ecore'::Hstm2Stm;
-
-transformation HstmToStm {
- hstm imports hstmMM;
- stm imports stmMM;
- imports hstm2stmMM;
-}
-
-query HstmToStm::StateContainsState(cState:hstmMM_p::State, mState:hstmMM_p::State ) : Boolean {
-
- if (mState.containedInState->isEmpty()) then
- false
- else
- if (mState.containedInState = cState) then
- true
- else
- StateContainsState(cState, mState.containedInState)
- endif
- endif
-}
-
-map LStateToState in HstmToStm {
-
- hstm (s1:State |
- s1.containsState->isEmpty();) {
- }
- enforce stm () {
- realize s2 : State |
- }
- where () {
- realize s2s : HstateToState |
- s2s.hstate := s1;
- s2s.state := s2;
- }
- map {
- where () {
- s2s.name := s1.name;
- s1.name := s2s.name;
- s2s.name := s2.name;
- s2.name := s2s.name;
- }
- }
-}
-
-map CStateToState in HstmToStm {
- hstm (fs1:State, ts1:State) {
- t1:Trans,
- ms1:State,
- ms2:State |
- t1.fromState = fs1;
- t1.toState = ts1;
- }
- enforce stm (ts2:State) {
- realize fs2:State,
- realize t2 : Trans |
- t2.fromState := fs2;
- t2.toState := ts2;
- }
- -- s2s1 -> ms1
- -- s2s1 -> ms2
- where (s2s1:HstateToState, s2s2:HstateToState |) {
- realize s2s : HstateToState,
- realize t2t : HtransToTrans |
- ms1 := s2s1.hstate;
- ms2 := s2s2.hstate;
- s2s.hstate := fs1;
- s2s.state := fs2;
- t2t.htrans := t1;
- t2t.trans := t2;
- }
- map {
- hstm(
- ms1 = fs1 or StateContainsState(fs1, ms1);
- ms2 = ts1 or StateContainsState(ts1, ms2);) {}
- where ( )
- {
- s2s.name := fs1.name;
- fs1.name := s2s.name;
- s2s.name := fs2.name;
- fs2.name := s2s.name;
- t2t.name := t1.name;
- t1.name := t2t.name;
- t2t.name := t2.name;
- t2.name := t2t.name;
-
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+ * Horacio Hoyos - transliterate to QVTc
+ *******************************************************************************/
+import hstmMM : 'hstmMM.emof'::hstmMM_p;
+import stmMM : 'stmMM.emof'::stmMM_p;
+import hstm2stmMM : 'hstm2stmMM.ecore'::Hstm2Stm;
+
+transformation HstmToStm {
+ hstm imports hstmMM;
+ stm imports stmMM;
+ imports hstm2stmMM;
+}
+
+query HstmToStm::StateContainsState(cState:hstmMM_p::State, mState:hstmMM_p::State ) : Boolean {
+
+ if (mState.containedInState->isEmpty()) then
+ false
+ else
+ if (mState.containedInState = cState) then
+ true
+ else
+ StateContainsState(cState, mState.containedInState)
+ endif
+ endif
+}
+
+map LStateToState in HstmToStm {
+
+ hstm (s1:State |
+ s1.containsState->isEmpty();) {
+ }
+ enforce stm () {
+ realize s2 : State |
+ }
+ where () {
+ realize s2s : HstateToState |
+ s2s.hstate := s1;
+ s2s.state := s2;
+ }
+ map {
+ where () {
+ s2s.name := s1.name;
+ s1.name := s2s.name;
+ s2s.name := s2.name;
+ s2.name := s2s.name;
+ }
+ }
+}
+
+map CStateToState in HstmToStm {
+ hstm (fs1:State, ts1:State) {
+ t1:Trans |
+ t1.fromState = fs1;
+ t1.toState = ts1;
+ }
+ enforce stm (ts2:State) {
+ realize fs2:State,
+ realize t2 : Trans |
+ t2.fromState := fs2;
+ t2.toState := ts2;
+ }
+ -- s2s1 -> ms1
+ -- s2s1 -> ms2
+ where (s2s1:HstateToState, s2s2:HstateToState |) {
+ realize s2s : HstateToState,
+ realize t2t : HtransToTrans,
+ ms1:hstmMM::State,
+ ms2:hstmMM::State |
+ ms1 := s2s1.hstate;
+ ms2 := s2s2.hstate;
+ s2s.hstate := fs1;
+ s2s.state := fs2;
+ t2t.htrans := t1;
+ t2t.trans := t2;
+ }
+ map {
+ hstm(
+ ms1 = fs1 or StateContainsState(fs1, ms1);
+ ms2 = ts1 or StateContainsState(ts1, ms2);) {}
+ where ( )
+ {
+ s2s.name := fs1.name;
+ fs1.name := s2s.name;
+ s2s.name := fs2.name;
+ fs2.name := s2s.name;
+ t2t.name := t1.name;
+ t1.name := t2t.name;
+ t2t.name := t2.name;
+ t2.name := t2t.name;
+
+ }
+ }
} \ No newline at end of file

Back to the top