diff options
author | 2017-06-21 18:39:47 +0200 | |
---|---|---|
committer | 2017-06-21 18:39:47 +0200 | |
commit | ac3d399075bda8c77a74a4553ee7b7217a50734c (patch) | |
tree | 0bbb78fe8850293c69446f5864f9423f4cd8576e /Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf | |
parent | Merge branch 'master' of https://github.com/viatra/VIATRA-Generator (diff) | |
download | VIATRA-Generator-ac3d399075bda8c77a74a4553ee7b7217a50734c.tar.gz VIATRA-Generator-ac3d399075bda8c77a74a4553ee7b7217a50734c.tar.zst VIATRA-Generator-ac3d399075bda8c77a74a4553ee7b7217a50734c.zip |
Added missing types: exit state, final state and choice
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql | 110 |
1 files changed, 70 insertions, 40 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql index afee1332..e964cfc7 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql | |||
@@ -2,6 +2,10 @@ package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu | |||
2 | 2 | ||
3 | import epackage "hu.bme.mit.inf.yakindumm" | 3 | import epackage "hu.bme.mit.inf.yakindumm" |
4 | 4 | ||
5 | ///////// | ||
6 | // Entry | ||
7 | ///////// | ||
8 | |||
5 | pattern entryInRegion(r1 : Region, e1 : Entry) { | 9 | pattern entryInRegion(r1 : Region, e1 : Entry) { |
6 | Region.vertices(r1, e1); | 10 | Region.vertices(r1, e1); |
7 | } | 11 | } |
@@ -40,21 +44,64 @@ pattern multipleTransitionFromEntry(e : Entry, t1 : Transition, t2: Transition) | |||
40 | t1!=t2; | 44 | t1!=t2; |
41 | } | 45 | } |
42 | 46 | ||
47 | ///////// | ||
48 | // Exit | ||
49 | ///////// | ||
43 | 50 | ||
44 | @Constraint(severity="error", message="error", key = {s}) | 51 | @Constraint(severity="error", message="error", key = {e}) |
45 | pattern hasNoOutgoing(s : Synchronization) { | 52 | pattern outgoingFromExit(t : Transition, e : Exit) { |
46 | neg find transition(_, s, _); | 53 | find transition(t, e, _); |
47 | } | 54 | } |
48 | 55 | ||
49 | @Constraint(severity="error", message="error", key = {s}) | 56 | ///////// |
50 | pattern hasNoIncoming(s : Synchronization) { | 57 | // Final |
51 | neg find transition(_, _, s); | 58 | ///////// |
59 | |||
60 | @Constraint(severity="error", message="error", key = {f}) | ||
61 | pattern outgoingFromFinal(t : Transition, f : FinalState) { | ||
62 | find transition(t, f, _); | ||
52 | } | 63 | } |
53 | 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 | } | ||
54 | pattern StateInRegion(region: Region, state: State) { | 73 | pattern StateInRegion(region: Region, state: State) { |
55 | Region.vertices(region,state); | 74 | Region.vertices(region,state); |
56 | } | 75 | } |
57 | 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 | |||
58 | @Constraint(severity="error", message="error", key = {s}) | 105 | @Constraint(severity="error", message="error", key = {s}) |
59 | pattern SynchronizedIncomingInSameRegion(s : Synchronization, v1 : Vertex, v2 : Vertex) { | 106 | pattern SynchronizedIncomingInSameRegion(s : Synchronization, v1 : Vertex, v2 : Vertex) { |
60 | find transition(t1, v1, s); | 107 | find transition(t1, v1, s); |
@@ -70,11 +117,6 @@ pattern SynchronizedIncomingInSameRegion(s : Synchronization, v1 : Vertex, v2 : | |||
70 | Region.vertices(r, v2); | 117 | Region.vertices(r, v2); |
71 | } | 118 | } |
72 | 119 | ||
73 | @Constraint(severity="error", message="error", key = {region}) | ||
74 | pattern noStateInRegion(region: Region) { | ||
75 | neg find StateInRegion(region,_); | ||
76 | } | ||
77 | |||
78 | @Constraint(severity="error", message="error", key = {s}) | 120 | @Constraint(severity="error", message="error", key = {s}) |
79 | pattern notSynchronizingStates(s : Synchronization) { | 121 | pattern notSynchronizingStates(s : Synchronization) { |
80 | neg find hasMultipleOutgoingTrainsition(s); | 122 | neg find hasMultipleOutgoingTrainsition(s); |
@@ -142,7 +184,9 @@ pattern hasMultipleRegions(composite: CompositeElement) { | |||
142 | region1 != region2; | 184 | region1 != region2; |
143 | } | 185 | } |
144 | 186 | ||
145 | // multiplicity constraints | 187 | /** |
188 | * Simplifying model generation | ||
189 | */ | ||
146 | @Constraint(severity="error", message="error", key = {s}) | 190 | @Constraint(severity="error", message="error", key = {s}) |
147 | pattern synchThree(s: Synchronization) { | 191 | pattern synchThree(s: Synchronization) { |
148 | Transition.target(t1,s); | 192 | Transition.target(t1,s); |
@@ -160,6 +204,9 @@ pattern synchThree(s: Synchronization) { | |||
160 | t1!=t3; | 204 | t1!=t3; |
161 | } | 205 | } |
162 | 206 | ||
207 | /** | ||
208 | * Simplifying model generation | ||
209 | */ | ||
163 | @Constraint(severity="error", message="error", key = {s1,s2}) | 210 | @Constraint(severity="error", message="error", key = {s1,s2}) |
164 | pattern twoSynch(s1 : Synchronization, s2 : Synchronization) { | 211 | pattern twoSynch(s1 : Synchronization, s2 : Synchronization) { |
165 | Synchronization(s1); | 212 | Synchronization(s1); |
@@ -167,31 +214,14 @@ pattern twoSynch(s1 : Synchronization, s2 : Synchronization) { | |||
167 | s1 != s2; | 214 | s1 != s2; |
168 | } | 215 | } |
169 | 216 | ||
170 | pattern synch(s:Synchronization) { | 217 | /** |
171 | Synchronization(s); | 218 | * Model generation task: at least one synch |
172 | } | 219 | */ |
173 | @Constraint(severity="error", message="error", key = {s}) | 220 | //@Constraint(severity="error", message="error", key = {s}) |
174 | pattern noSynch(s:Statechart) { | 221 | //pattern noSynch(s:Statechart) { |
175 | Statechart(s); | 222 | // Statechart(s); |
176 | neg find synch(_); | 223 | // neg find synch(_); |
177 | } | 224 | //} |
178 | @Constraint(severity="error", message="error", key = {s}) | 225 | //pattern synch(s:Synchronization) { |
179 | pattern noSynch1(s:Statechart) { | 226 | // Synchronization(s); |
180 | Statechart(s); | 227 | //} \ No newline at end of file |
181 | neg find synch(_); | ||
182 | } | ||
183 | @Constraint(severity="error", message="error", key = {s}) | ||
184 | pattern noSynch2(s:Statechart) { | ||
185 | Statechart(s); | ||
186 | neg find synch(_); | ||
187 | } | ||
188 | @Constraint(severity="error", message="error", key = {s}) | ||
189 | pattern noSynch3(s:Statechart) { | ||
190 | Statechart(s); | ||
191 | neg find synch(_); | ||
192 | } | ||
193 | @Constraint(severity="error", message="error", key = {s}) | ||
194 | pattern noSynch4(s:Statechart) { | ||
195 | Statechart(s); | ||
196 | neg find synch(_); | ||
197 | } \ No newline at end of file | ||