diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill')
8 files changed, 4 insertions, 657 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/Ecore.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/Ecore.vql deleted file mode 100644 index 9af35b50..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/Ecore.vql +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.ecore.queries | ||
2 | |||
3 | import epackage "http://www.eclipse.org/emf/2002/Ecore" | ||
4 | |||
5 | pattern directSupertype(a: EClass, b:EClass) { | ||
6 | EClass.eSuperTypes(a,b); | ||
7 | } | ||
8 | |||
9 | @Constraint(key={a}, severity="error", message="error") | ||
10 | pattern loopInInheritence(a: EClass) { | ||
11 | find directSupertype+(a,a); | ||
12 | } | ||
13 | |||
14 | pattern opposite(a:EReference, b: EReference) { | ||
15 | EReference.eOpposite(a,b); | ||
16 | } | ||
17 | @Constraint(key={a}, severity="error", message="error") | ||
18 | pattern oppositeDifferentClass(a:EReference) { | ||
19 | EReference.eOpposite(a,b); | ||
20 | EReference.eContainingClass(a,aContaining); | ||
21 | EReference.eType(b,bTarget); | ||
22 | aContaining != bTarget; | ||
23 | } | ||
24 | |||
25 | @Constraint(key={a}, severity="error", message="error") | ||
26 | pattern nonSymmetricOpposite(a:EReference, b:EReference) { | ||
27 | find opposite(a,b); | ||
28 | neg find opposite(b,a); | ||
29 | } \ No newline at end of file | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/Function.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/Function.java index 1fed3a2d..b2e5af29 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/Function.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/Function.java | |||
@@ -53,7 +53,7 @@ public interface Function extends FunctionalElement { | |||
53 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionType | 53 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionType |
54 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage#getFunction_Type() | 54 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage#getFunction_Type() |
55 | * @model required="true" transient="true" changeable="false" volatile="true" derived="true" | 55 | * @model required="true" transient="true" changeable="false" volatile="true" derived="true" |
56 | * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='ca.mcgill.ecse.dslreasoner.standalone.test.xyz.type'" | 56 | * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type'" |
57 | * @generated | 57 | * @generated |
58 | */ | 58 | */ |
59 | FunctionType getType(); | 59 | FunctionType getType(); |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/FunctionalElement.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/FunctionalElement.java index c3ed76d6..acfffbc0 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/FunctionalElement.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/FunctionalElement.java | |||
@@ -63,7 +63,7 @@ public interface FunctionalElement extends EObject { | |||
63 | * @see #setModel(FunctionalArchitectureModel) | 63 | * @see #setModel(FunctionalArchitectureModel) |
64 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage#getFunctionalElement_Model() | 64 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage#getFunctionalElement_Model() |
65 | * @model required="true" transient="true" volatile="true" derived="true" | 65 | * @model required="true" transient="true" volatile="true" derived="true" |
66 | * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='ca.mcgill.ecse.dslreasoner.standalone.test.xyz.model'" | 66 | * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model'" |
67 | * @generated | 67 | * @generated |
68 | */ | 68 | */ |
69 | FunctionalArchitectureModel getModel(); | 69 | FunctionalArchitectureModel getModel(); |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/famPackageImpl.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/famPackageImpl.java index 74efeeeb..e928e04e 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/famPackageImpl.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/impl/famPackageImpl.java | |||
@@ -561,13 +561,13 @@ public class famPackageImpl extends EPackageImpl implements famPackage { | |||
561 | (getFunctionalElement_Model(), | 561 | (getFunctionalElement_Model(), |
562 | source, | 562 | source, |
563 | new String[] { | 563 | new String[] { |
564 | "patternFQN", "ca.mcgill.ecse.dslreasoner.standalone.test.xyz.model" | 564 | "patternFQN", "ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model" |
565 | }); | 565 | }); |
566 | addAnnotation | 566 | addAnnotation |
567 | (getFunction_Type(), | 567 | (getFunction_Type(), |
568 | source, | 568 | source, |
569 | new String[] { | 569 | new String[] { |
570 | "patternFQN", "ca.mcgill.ecse.dslreasoner.standalone.test.xyz.type" | 570 | "patternFQN", "ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type" |
571 | }); | 571 | }); |
572 | } | 572 | } |
573 | 573 | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql deleted file mode 100644 index 02d34dcd..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries | ||
2 | |||
3 | import "FamMetamodel" | ||
4 | |||
5 | @Constraint(message="terminatorAndInformation", severity="error", key={T}) | ||
6 | pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | ||
7 | FunctionalOutput.outgoingLinks(Out,I); | ||
8 | FunctionalOutput.terminator(Out,T); | ||
9 | } or { | ||
10 | InformationLink.to(I,In); | ||
11 | FunctionalInput.terminator(In,T); | ||
12 | } | ||
13 | |||
14 | @QueryBasedFeature | ||
15 | pattern type(This : Function, Target : FunctionType) = { | ||
16 | find rootElements(_Model, This); | ||
17 | Target == FunctionType::Root; | ||
18 | } or { | ||
19 | neg find parent(_Child, This); | ||
20 | neg find rootElements(_Model, This); | ||
21 | Target == FunctionType::Leaf; | ||
22 | } or { | ||
23 | find parent(This, _Par); | ||
24 | find parent(_Child, This); | ||
25 | Target == FunctionType::Intermediate; | ||
26 | } | ||
27 | |||
28 | pattern rootElements(Model: FunctionalArchitectureModel, Root : Function) = { | ||
29 | FunctionalArchitectureModel.rootElements(Model, Root); | ||
30 | } | ||
31 | |||
32 | pattern parent(Func : Function, Par : Function) = { | ||
33 | Function.parent(Func, Par); | ||
34 | } | ||
35 | |||
36 | @QueryBasedFeature | ||
37 | pattern model(This:FunctionalElement, Target: FunctionalArchitectureModel) { | ||
38 | FunctionalElement(This); | ||
39 | FunctionalArchitectureModel(Target); | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | @Constraint(message="noRoot", severity="error", key={fam}) | ||
44 | pattern noRoot(fam: FunctionalArchitectureModel) { | ||
45 | FunctionalArchitectureModel(fam); | ||
46 | neg find hasRoot(_); | ||
47 | } | ||
48 | @Constraint(message="noIntermediate", severity="error", key={fam}) | ||
49 | pattern noInt(fam: FunctionalArchitectureModel) { | ||
50 | FunctionalArchitectureModel(fam); | ||
51 | neg find hasInt(_); | ||
52 | } | ||
53 | @Constraint(message="noLeaf", severity="error", key={fam}) | ||
54 | pattern noLeaf(fam: FunctionalArchitectureModel) { | ||
55 | FunctionalArchitectureModel(fam); | ||
56 | neg find hasLeaf(_); | ||
57 | } | ||
58 | */ | ||
59 | |||
60 | /* | ||
61 | @QueryBasedFeature | ||
62 | pattern model(This : FunctionalElement, Target : FunctionalArchitectureModel) = { | ||
63 | find parent+(This, Parent); | ||
64 | find rootElements(Target, Parent); | ||
65 | } or { | ||
66 | find rootElements(Target, This); | ||
67 | } | ||
68 | |||
69 | pattern interfaceData(FI : FunctionalInterface, FD : FunctionalData) = { | ||
70 | FunctionalInterface.data(FI, FD); | ||
71 | } | ||
72 | |||
73 | @QueryBasedFeature | ||
74 | pattern inputs(This : FunctionalInterface, Target : FunctionalInput) = { | ||
75 | find interfaceData(This, Target); | ||
76 | } | ||
77 | |||
78 | @QueryBasedFeature | ||
79 | pattern outputs(This : FunctionalInterface, Target : FunctionalOutput) = { | ||
80 | find interfaceData(This, Target); | ||
81 | } | ||
82 | |||
83 | @QueryBasedFeature | ||
84 | pattern outgoingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
85 | FunctionalElement.interface.outputs(This, Output); | ||
86 | InformationLink.from(Target, Output); | ||
87 | } | ||
88 | |||
89 | @QueryBasedFeature | ||
90 | pattern incomingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
91 | FunctionalElement.interface.inputs(This, Input); | ||
92 | InformationLink.to(Target, Input); | ||
93 | } | ||
94 | |||
95 | @QueryBasedFeature | ||
96 | pattern connects(This : FunctionalElement, Target : FunctionalElement) = { | ||
97 | FunctionalElement.outgoingLinks(This,Link); | ||
98 | FunctionalElement.incomingLinks(Target,Link); | ||
99 | }*/ | ||
100 | |||
101 | /*pattern frequency(a: Function, b : EInt) { | ||
102 | Function.minimumFrequency(a,b); | ||
103 | }*/ | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/filesystem/queries/FileSystem.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/filesystem/queries/FileSystem.vql deleted file mode 100644 index 269a4242..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/filesystem/queries/FileSystem.vql +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.queries | ||
2 | |||
3 | import epackage "FileSystemMetamodel" | ||
4 | |||
5 | pattern patternContent(o1: FSObject, o2: FSObject) { | ||
6 | Dir.contents(o1,o2); | ||
7 | } | ||
8 | |||
9 | @QueryBasedFeature | ||
10 | pattern live(this: FileSystem, l: FSObject) { | ||
11 | FileSystem.root(this,l); | ||
12 | } or { | ||
13 | FileSystem.root(this,root); | ||
14 | find patternContent+(root,l); | ||
15 | } | ||
16 | |||
17 | @Constraint(key={child}, severity="error", message="error") | ||
18 | pattern contentInNotLive(parent : Dir, child: FSObject) { | ||
19 | Dir.contents(parent,child); | ||
20 | neg find live(_,parent); | ||
21 | } or { | ||
22 | Dir.contents(parent,child); | ||
23 | neg find live(_,child); | ||
24 | } | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql deleted file mode 100644 index 2e498670..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql +++ /dev/null | |||
@@ -1,270 +0,0 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries | ||
2 | |||
3 | import epackage "YakinduMetamodel" | ||
4 | |||
5 | ///////// | ||
6 | // Entry | ||
7 | ///////// | ||
8 | |||
9 | pattern entryInRegion_M0(r1 : Region, e1 : Entry) { | ||
10 | Region.vertices(r1, e1); | ||
11 | } | ||
12 | pattern entryInRegion_M1(r1 : Region, e1) { | ||
13 | Region.vertices(r1, e1); | ||
14 | } | ||
15 | pattern entryInRegion_M2(r1 : Region, e1: Entry) { | ||
16 | // For positive constraint | ||
17 | Region(r1);Entry(e1); | ||
18 | } | ||
19 | |||
20 | |||
21 | //@Constraint(severity="error", message="error", key = {r1}) | ||
22 | pattern noEntryInRegion_M0(r1 : Region) { | ||
23 | neg find entryInRegion_M0(r1, _); | ||
24 | } | ||
25 | pattern noEntryInRegion_M1(r1 : Region) { | ||
26 | neg find entryInRegion_M1(r1, _); | ||
27 | } | ||
28 | pattern noEntryInRegion_M2(r1 : Region) { | ||
29 | neg find entryInRegion_M2(r1, _); | ||
30 | } | ||
31 | pattern noEntryInRegion_M3(r1 : Region) { | ||
32 | find entryInRegion_M0(r1, _); | ||
33 | } | ||
34 | pattern noEntryInRegion_M4(r1 : Region) { | ||
35 | find entryInRegion_M1(r1, _); | ||
36 | } | ||
37 | pattern noEntryInRegion_M5(r1 : Region) { | ||
38 | find entryInRegion_M2(r1, _); | ||
39 | } | ||
40 | |||
41 | //@Constraint(severity="error", message="error", key = {r}) | ||
42 | pattern multipleEntryInRegion_M0(r : Region) { | ||
43 | find entryInRegion_M0(r, e1); | ||
44 | find entryInRegion_M0(r, e2); | ||
45 | e1 != e2; | ||
46 | } | ||
47 | pattern multipleEntryInRegion_M1(r : Region) { | ||
48 | find entryInRegion_M1(r, e1); | ||
49 | find entryInRegion_M0(r, e2); | ||
50 | e1 != e2; | ||
51 | } | ||
52 | pattern multipleEntryInRegion_M2(r : Region) { | ||
53 | find entryInRegion_M2(r, e1); | ||
54 | find entryInRegion_M0(r, e2); | ||
55 | e1 != e2; | ||
56 | } | ||
57 | pattern multipleEntryInRegion_M3(r : Region) { | ||
58 | find entryInRegion_M0(r, e1); | ||
59 | find entryInRegion_M1(r, e2); | ||
60 | e1 != e2; | ||
61 | } | ||
62 | pattern multipleEntryInRegion_M4(r : Region) { | ||
63 | find entryInRegion_M2(r, e1); | ||
64 | find entryInRegion_M2(r, e2); | ||
65 | e1 != e2; | ||
66 | } | ||
67 | pattern multipleEntryInRegion_M5(r : Region) { | ||
68 | find entryInRegion_M0(r, e1); | ||
69 | find entryInRegion_M0(r, e2); | ||
70 | } | ||
71 | |||
72 | |||
73 | pattern transition_M0(t : Transition, src : Vertex, trg : Vertex) { | ||
74 | Transition.source(t, src); | ||
75 | Transition.target(t, trg); | ||
76 | } | ||
77 | pattern transition_M1(t : Transition, src : Vertex, trg : Vertex) { | ||
78 | Transition.source(t, src); | ||
79 | Vertex(trg); | ||
80 | } | ||
81 | pattern transition_M2(t : Transition, src : Vertex, trg : Vertex) { | ||
82 | Vertex(src); | ||
83 | Transition.target(t, trg); | ||
84 | } | ||
85 | pattern transition_M3(t : Transition, src : Vertex, trg : Vertex) { | ||
86 | Transition.source(t_x, src); | ||
87 | Transition.target(t, trg); | ||
88 | } | ||
89 | pattern transition_M4(t : Transition, src : Vertex, trg : Vertex) { | ||
90 | Transition.source(t, src); | ||
91 | Transition.target(t_x, trg); | ||
92 | } | ||
93 | |||
94 | //@Constraint(severity="error", message="error", key = {e}) | ||
95 | pattern incomingToEntry_M0(t : Transition, e : Entry) { | ||
96 | find transition_M0(t, _, e); | ||
97 | } | ||
98 | pattern incomingToEntry_1(t : Transition, e) { | ||
99 | find transition_M0(t, _, e); | ||
100 | } | ||
101 | pattern incomingToEntry_2(t : Transition, e : Entry) { | ||
102 | find transition_M1(t, _, e); | ||
103 | } | ||
104 | pattern incomingToEntry_3(t : Transition, e : Entry) { | ||
105 | find transition_M2(t, _, e); | ||
106 | } | ||
107 | pattern incomingToEntry_4(t : Transition, e : Entry) { | ||
108 | find transition_M3(t, _, e); | ||
109 | } | ||
110 | pattern incomingToEntry_5(t : Transition, e : Entry) { | ||
111 | find transition_M4(t, _, e); | ||
112 | } | ||
113 | |||
114 | pattern noOutgoingTransitionFromEntry_M0(e : Entry) { | ||
115 | neg find transition_M0(_, e, _); | ||
116 | } | ||
117 | |||
118 | pattern noOutgoingTransitionFromEntry_M1(e) { | ||
119 | Vertex(e); | ||
120 | neg find transition_M0(_, e, _); | ||
121 | } | ||
122 | pattern noOutgoingTransitionFromEntry_M2(e : Entry) { | ||
123 | neg find transition_M1(_, e, _); | ||
124 | } | ||
125 | pattern noOutgoingTransitionFromEntry_M3(e : Entry) { | ||
126 | neg find transition_M2(_, e, _); | ||
127 | } | ||
128 | pattern noOutgoingTransitionFromEntry_M4(e : Entry) { | ||
129 | neg find transition_M3(_, e, _); | ||
130 | } | ||
131 | pattern noOutgoingTransitionFromEntry_M5(e : Entry) { | ||
132 | neg find transition_M4(_, e, _); | ||
133 | } | ||
134 | |||
135 | |||
136 | //@Constraint(severity="error", message="error", key = {e}) | ||
137 | pattern multipleTransitionFromEntry_M0(e : Entry, t1 : Transition, t2: Transition) { | ||
138 | Entry.outgoingTransitions(e,t1); | ||
139 | Entry.outgoingTransitions(e,t2); | ||
140 | t1!=t2; | ||
141 | } | ||
142 | pattern multipleTransitionFromEntry_M1(e, t1 : Transition, t2: Transition) { | ||
143 | Entry.outgoingTransitions(e,t1); | ||
144 | Entry.outgoingTransitions(e,t2); | ||
145 | t1!=t2; | ||
146 | } | ||
147 | pattern multipleTransitionFromEntry_M2(e : Entry, t1 : Transition, t2: Transition) { | ||
148 | Transition(t1); | ||
149 | Entry.outgoingTransitions(e,t2); | ||
150 | t1!=t2; | ||
151 | } | ||
152 | pattern multipleTransitionFromEntry_M3(e : Entry, t1 : Transition, t2: Transition) { | ||
153 | Entry.outgoingTransitions(e,t1); | ||
154 | Transition(t2); | ||
155 | t1!=t2; | ||
156 | } | ||
157 | pattern multipleTransitionFromEntry_M4(e : Entry, t1 : Transition, t2: Transition) { | ||
158 | Entry.outgoingTransitions(e,t1); | ||
159 | Entry.outgoingTransitions(e,t2); | ||
160 | } | ||
161 | |||
162 | ///////// | ||
163 | // Exit | ||
164 | ///////// | ||
165 | |||
166 | //@Constraint(severity="error", message="error", key = {e}) | ||
167 | pattern outgoingFromExit_M0(t : Transition, e : Exit) { | ||
168 | Exit.outgoingTransitions(e,t); | ||
169 | } | ||
170 | pattern outgoingFromExit_M1(t : Transition, e) { | ||
171 | Vertex.outgoingTransitions(e,t); | ||
172 | } | ||
173 | pattern outgoingFromExit_M2(t : Transition, e : Exit) { | ||
174 | Transition(t); | ||
175 | Exit(e); | ||
176 | } | ||
177 | |||
178 | ///////// | ||
179 | // Final | ||
180 | ///////// | ||
181 | |||
182 | //@Constraint(severity="error", message="error", key = {f}) | ||
183 | pattern outgoingFromFinal_M0(t : Transition, f : FinalState) { | ||
184 | FinalState.outgoingTransitions(f,t); | ||
185 | } | ||
186 | pattern outgoingFromFinal_M1(t : Transition, f) { | ||
187 | Vertex.outgoingTransitions(f,t); | ||
188 | } | ||
189 | pattern outgoingFromFinal_M2(t : Transition, f : FinalState) { | ||
190 | Transition(t); | ||
191 | FinalState(f); | ||
192 | } | ||
193 | |||
194 | ///////// | ||
195 | // State vs Region | ||
196 | ///////// | ||
197 | |||
198 | //@Constraint(severity="error", message="error", key = {region}) | ||
199 | pattern noStateInRegion_M0(region: Region) { | ||
200 | neg find StateInRegion_M0(region,_); | ||
201 | } | ||
202 | pattern noStateInRegion_M1(region: Region) { | ||
203 | neg find StateInRegion_M1(region,_); | ||
204 | } | ||
205 | pattern noStateInRegion_M2(region: Region) { | ||
206 | neg find StateInRegion_M2(region,_); | ||
207 | } | ||
208 | pattern noStateInRegion_M3(region: Region) { | ||
209 | find StateInRegion_M0(region,_); | ||
210 | } | ||
211 | |||
212 | pattern StateInRegion_M0(region: Region, state: State) { | ||
213 | Region.vertices(region,state); | ||
214 | } | ||
215 | pattern StateInRegion_M1(region: Region, state) { | ||
216 | Region.vertices(region,state); | ||
217 | } | ||
218 | pattern StateInRegion_M2(region: Region, state:State) { | ||
219 | Region(region);State(state); | ||
220 | } | ||
221 | |||
222 | ///////// | ||
223 | // Choice | ||
224 | ///////// | ||
225 | |||
226 | @Constraint(severity="error", message="error", key = {c}) | ||
227 | pattern choiceHasNoOutgoing_M0(c : Choice) { | ||
228 | neg find transition_M0(_, c, _); | ||
229 | } | ||
230 | pattern choiceHasNoOutgoing_M1(c:Vertex) { | ||
231 | neg find transition_M0(_, c, _); | ||
232 | } | ||
233 | pattern choiceHasNoOutgoing_M2(c : Choice) { | ||
234 | neg find transition_M1(_, c, _); | ||
235 | } | ||
236 | pattern choiceHasNoOutgoing_M3(c : Choice) { | ||
237 | neg find transition_M2(_, c, _); | ||
238 | } | ||
239 | pattern choiceHasNoOutgoing_M4(c : Choice) { | ||
240 | neg find transition_M3(_, c, _); | ||
241 | } | ||
242 | pattern choiceHasNoOutgoing_M5(c : Choice) { | ||
243 | neg find transition_M4(_, c, _); | ||
244 | } | ||
245 | pattern choiceHasNoOutgoing_M6(c : Choice) { | ||
246 | find transition_M0(_, c, _); | ||
247 | } | ||
248 | |||
249 | @Constraint(severity="error", message="error", key = {c}) | ||
250 | pattern choiceHasNoIncoming_M0(c: Choice) { | ||
251 | neg find transition_M0(_, _, c); | ||
252 | } | ||
253 | pattern choiceHasNoIncoming_M1(c:Vertex) { | ||
254 | neg find transition_M0(_, _, c); | ||
255 | } | ||
256 | pattern choiceHasNoIncoming_M2(c: Choice) { | ||
257 | neg find transition_M1(_, _, c); | ||
258 | } | ||
259 | pattern choiceHasNoIncoming_M3(c: Choice) { | ||
260 | neg find transition_M2(_, _, c); | ||
261 | } | ||
262 | pattern choiceHasNoIncoming_M4(c: Choice) { | ||
263 | neg find transition_M3(_, _, c); | ||
264 | } | ||
265 | pattern choiceHasNoIncoming_M5(c: Choice) { | ||
266 | neg find transition_M4(_, _, c); | ||
267 | } | ||
268 | pattern choiceHasNoIncoming_M6(c: Choice) { | ||
269 | find transition_M0(_, _, c); | ||
270 | } | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql deleted file mode 100644 index 597b1691..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql +++ /dev/null | |||
@@ -1,227 +0,0 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries | ||
2 | |||
3 | import epackage "YakinduMetamodel" | ||
4 | |||
5 | ///////// | ||
6 | // Entry | ||
7 | ///////// | ||
8 | |||
9 | pattern entryInRegion(r1 : Region, e1 : Entry) { | ||
10 | Region.vertices(r1, e1); | ||
11 | } | ||
12 | |||
13 | @Constraint(severity="error", message="error", key = {r1}) | ||
14 | pattern noEntryInRegion(r1 : Region) { | ||
15 | neg find entryInRegion(r1, _); | ||
16 | } | ||
17 | |||
18 | @Constraint(severity="error", message="error", key = {r}) | ||
19 | pattern multipleEntryInRegion(r : Region) { | ||
20 | find entryInRegion(r, e1); | ||
21 | find entryInRegion(r, e2); | ||
22 | e1 != e2; | ||
23 | } | ||
24 | |||
25 | pattern transition(t : Transition, src : Vertex, trg : Vertex) { | ||
26 | Transition.source(t, src); | ||
27 | Transition.target(t, trg); | ||
28 | } | ||
29 | |||
30 | @Constraint(severity="error", message="error", key = {e}) | ||
31 | pattern incomingToEntry(t : Transition, e : Entry) { | ||
32 | find transition(t, _, e); | ||
33 | } | ||
34 | |||
35 | @Constraint(severity="error", message="error", key = {e}) | ||
36 | pattern noOutgoingTransitionFromEntry(e : Entry) { | ||
37 | neg find transition(_, e, _); | ||
38 | } | ||
39 | |||
40 | @Constraint(severity="error", message="error", key = {e}) | ||
41 | pattern multipleTransitionFromEntry(e : Entry, t1 : Transition, t2: Transition) { | ||
42 | Entry.outgoingTransitions(e,t1); | ||
43 | Entry.outgoingTransitions(e,t2); | ||
44 | t1!=t2; | ||
45 | } | ||
46 | |||
47 | ///////// | ||
48 | // Exit | ||
49 | ///////// | ||
50 | |||
51 | @Constraint(severity="error", message="error", key = {e}) | ||
52 | pattern outgoingFromExit(t : Transition, e : Exit) { | ||
53 | Exit.outgoingTransitions(e,t); | ||
54 | } | ||
55 | |||
56 | ///////// | ||
57 | // Final | ||
58 | ///////// | ||
59 | |||
60 | @Constraint(severity="error", message="error", key = {f}) | ||
61 | pattern outgoingFromFinal(t : Transition, f : FinalState) { | ||
62 | FinalState.outgoingTransitions(f,t); | ||
63 | } | ||
64 | |||
65 | ///////// | ||
66 | // State vs Region | ||
67 | ///////// | ||
68 | |||
69 | @Constraint(severity="error", message="error", key = {region}) | ||
70 | pattern noStateInRegion(region: Region) { | ||
71 | neg find StateInRegion(region,_); | ||
72 | } | ||
73 | pattern StateInRegion(region: Region, state: State) { | ||
74 | Region.vertices(region,state); | ||
75 | } | ||
76 | |||
77 | ///////// | ||
78 | // Choice | ||
79 | ///////// | ||
80 | |||
81 | @Constraint(severity="error", message="error", key = {c}) | ||
82 | pattern choiceHasNoOutgoing(c : Choice) { | ||
83 | neg find transition(_, c, _); | ||
84 | } | ||
85 | |||
86 | @Constraint(severity="error", message="error", key = {c}) | ||
87 | pattern choiceHasNoIncoming(c: Choice) { | ||
88 | neg find transition(_, _, c); | ||
89 | } | ||
90 | |||
91 | ///////// | ||
92 | // Synchronization | ||
93 | ///////// | ||
94 | |||
95 | @Constraint(severity="error", message="error", key = {s}) | ||
96 | pattern synchHasNoOutgoing(s : Synchronization) { | ||
97 | neg find transition(_, s, _); | ||
98 | } | ||
99 | |||
100 | @Constraint(severity="error", message="error", key = {s}) | ||
101 | pattern synchHasNoIncoming(s : Synchronization) { | ||
102 | neg find transition(_, _, s); | ||
103 | } | ||
104 | |||
105 | @Constraint(severity="error", message="error", key = {s}) | ||
106 | pattern SynchronizedIncomingInSameRegion(s : Synchronization, v1 : Vertex, v2 : Vertex) { | ||
107 | find transition(t1, v1, s); | ||
108 | find transition(t2, v2, s); | ||
109 | t1!=t2; | ||
110 | Region.vertices(r, v1); | ||
111 | Region.vertices(r, v2); | ||
112 | } or { | ||
113 | find transition(t1, s, v1); | ||
114 | find transition(t2, s, v2); | ||
115 | t1!=t2; | ||
116 | Region.vertices(r, v1); | ||
117 | Region.vertices(r, v2); | ||
118 | } | ||
119 | |||
120 | @Constraint(severity="error", message="error", key = {s}) | ||
121 | pattern notSynchronizingStates(s : Synchronization) { | ||
122 | neg find hasMultipleOutgoingTrainsition(s); | ||
123 | neg find hasMultipleIncomingTrainsition(s); | ||
124 | } | ||
125 | |||
126 | pattern hasMultipleOutgoingTrainsition(v : Synchronization) { | ||
127 | find transition(_, v, trg1); | ||
128 | find transition(_, v, trg2); | ||
129 | trg1 != trg2; | ||
130 | } | ||
131 | |||
132 | pattern hasMultipleIncomingTrainsition(v : Synchronization) { | ||
133 | find transition(_, src1, v); | ||
134 | find transition(_, src2, v); | ||
135 | src1 != src2; | ||
136 | } | ||
137 | |||
138 | @Constraint(severity="error", message="error", key = {s}) | ||
139 | pattern SynchronizedRegionsAreNotSiblings(s : Synchronization, v1 : Vertex, v2 : Vertex) { | ||
140 | find transition(_, v1, s); | ||
141 | find transition(_, v2, s); | ||
142 | CompositeElement.regions.vertices(r1, v1); | ||
143 | CompositeElement.regions.vertices(r2, v2); | ||
144 | r1 != r2; | ||
145 | } or { | ||
146 | find transition(_, s, v1); | ||
147 | find transition(_, s, v2); | ||
148 | CompositeElement.regions.vertices(r1, v1); | ||
149 | CompositeElement.regions.vertices(r2, v2); | ||
150 | r1 != r2; | ||
151 | } | ||
152 | |||
153 | /////////////////////////////// | ||
154 | // Extra | ||
155 | // | ||
156 | //@Constraint(severity="error", message="error", key = {s}) | ||
157 | //pattern SynchronizedRegionDoesNotHaveParent(s : Synchronization, v : Vertex) { | ||
158 | // find transition(_, v, s); | ||
159 | // neg find child(_,v); | ||
160 | //} or { | ||
161 | // find transition(_, s, v); | ||
162 | // neg find child(_,v); | ||
163 | //} | ||
164 | |||
165 | pattern child(parent: CompositeElement, child: Vertex) { | ||
166 | CompositeElement.regions.vertices(parent, child); | ||
167 | } | ||
168 | |||
169 | @Constraint(severity="error", message="error", key = {s}) | ||
170 | pattern SynchronizedRegionDoesNotHaveMultipleRegions(s : Synchronization, v : Vertex) { | ||
171 | find transition(_, v, s); | ||
172 | find child(c,v); | ||
173 | neg find hasMultipleRegions(c); | ||
174 | } or { | ||
175 | find transition(_, s, v); | ||
176 | find child(c,v); | ||
177 | neg find hasMultipleRegions(c); | ||
178 | } | ||
179 | |||
180 | |||
181 | pattern hasMultipleRegions(composite: CompositeElement) { | ||
182 | CompositeElement.regions(composite,region1); | ||
183 | CompositeElement.regions(composite,region2); | ||
184 | region1 != region2; | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * Simplifying model generation | ||
189 | */ | ||
190 | @Constraint(severity="error", message="error", key = {s}) | ||
191 | pattern synchThree(s: Synchronization) { | ||
192 | Transition.target(t1,s); | ||
193 | Transition.target(t2,s); | ||
194 | Transition.target(t3,s); | ||
195 | t1!=t2; | ||
196 | t2!=t3; | ||
197 | t1!=t3; | ||
198 | } or { | ||
199 | Transition.source(t1,s); | ||
200 | Transition.source(t2,s); | ||
201 | Transition.source(t3,s); | ||
202 | t1!=t2; | ||
203 | t2!=t3; | ||
204 | t1!=t3; | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * Simplifying model generation | ||
209 | */ | ||
210 | @Constraint(severity="error", message="error", key = {s1,s2}) | ||
211 | pattern twoSynch(s1 : Synchronization, s2 : Synchronization) { | ||
212 | Synchronization(s1); | ||
213 | Synchronization(s2); | ||
214 | s1 != s2; | ||
215 | } | ||
216 | |||
217 | /** | ||
218 | * Model generation task: at least one synch | ||
219 | */ | ||
220 | //@Constraint(severity="error", message="error", key = {s}) | ||
221 | //pattern noSynch(s:Statechart) { | ||
222 | // Statechart(s); | ||
223 | // neg find synch(_); | ||
224 | //} | ||
225 | //pattern synch(s:Synchronization) { | ||
226 | // Synchronization(s); | ||
227 | //} \ No newline at end of file | ||