diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/HasMultipleIncomingTrainsition.java')
-rw-r--r-- | Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/HasMultipleIncomingTrainsition.java | 549 |
1 files changed, 0 insertions, 549 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/HasMultipleIncomingTrainsition.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/HasMultipleIncomingTrainsition.java deleted file mode 100644 index 236ce5ff..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/HasMultipleIncomingTrainsition.java +++ /dev/null | |||
@@ -1,549 +0,0 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql | ||
3 | */ | ||
4 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries; | ||
5 | |||
6 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Synchronization; | ||
7 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.Transition; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern hasMultipleIncomingTrainsition(v : Synchronization) { | ||
48 | * find transition(_, src1, v); | ||
49 | * find transition(_, src2, v); | ||
50 | * src1 != src2; | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class HasMultipleIncomingTrainsition extends BaseGeneratedEMFQuerySpecification<HasMultipleIncomingTrainsition.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleIncomingTrainsition pattern, | ||
62 | * to be used in conjunction with {@link Matcher}. | ||
63 | * | ||
64 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
65 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
66 | * usable to represent a match of the pattern in the result of a query, | ||
67 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
68 | * | ||
69 | * @see Matcher | ||
70 | * | ||
71 | */ | ||
72 | public static abstract class Match extends BasePatternMatch { | ||
73 | private Synchronization fV; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("v"); | ||
76 | |||
77 | private Match(final Synchronization pV) { | ||
78 | this.fV = pV; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | if ("v".equals(parameterName)) return this.fV; | ||
84 | return null; | ||
85 | } | ||
86 | |||
87 | public Synchronization getV() { | ||
88 | return this.fV; | ||
89 | } | ||
90 | |||
91 | @Override | ||
92 | public boolean set(final String parameterName, final Object newValue) { | ||
93 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
94 | if ("v".equals(parameterName) ) { | ||
95 | this.fV = (Synchronization) newValue; | ||
96 | return true; | ||
97 | } | ||
98 | return false; | ||
99 | } | ||
100 | |||
101 | public void setV(final Synchronization pV) { | ||
102 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
103 | this.fV = pV; | ||
104 | } | ||
105 | |||
106 | @Override | ||
107 | public String patternName() { | ||
108 | return "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleIncomingTrainsition"; | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public List<String> parameterNames() { | ||
113 | return HasMultipleIncomingTrainsition.Match.parameterNames; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public Object[] toArray() { | ||
118 | return new Object[]{fV}; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public HasMultipleIncomingTrainsition.Match toImmutable() { | ||
123 | return isMutable() ? newMatch(fV) : this; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public String prettyPrint() { | ||
128 | StringBuilder result = new StringBuilder(); | ||
129 | result.append("\"v\"=" + prettyPrintValue(fV)); | ||
130 | return result.toString(); | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public int hashCode() { | ||
135 | return Objects.hash(fV); | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public boolean equals(final Object obj) { | ||
140 | if (this == obj) | ||
141 | return true; | ||
142 | if (obj == null) { | ||
143 | return false; | ||
144 | } | ||
145 | if ((obj instanceof HasMultipleIncomingTrainsition.Match)) { | ||
146 | HasMultipleIncomingTrainsition.Match other = (HasMultipleIncomingTrainsition.Match) obj; | ||
147 | return Objects.equals(fV, other.fV); | ||
148 | } else { | ||
149 | // this should be infrequent | ||
150 | if (!(obj instanceof IPatternMatch)) { | ||
151 | return false; | ||
152 | } | ||
153 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
154 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
155 | } | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public HasMultipleIncomingTrainsition specification() { | ||
160 | return HasMultipleIncomingTrainsition.instance(); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * Returns an empty, mutable match. | ||
165 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
166 | * | ||
167 | * @return the empty match. | ||
168 | * | ||
169 | */ | ||
170 | public static HasMultipleIncomingTrainsition.Match newEmptyMatch() { | ||
171 | return new Mutable(null); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * Returns a mutable (partial) match. | ||
176 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
177 | * | ||
178 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
179 | * @return the new, mutable (partial) match object. | ||
180 | * | ||
181 | */ | ||
182 | public static HasMultipleIncomingTrainsition.Match newMutableMatch(final Synchronization pV) { | ||
183 | return new Mutable(pV); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * Returns a new (partial) match. | ||
188 | * This can be used e.g. to call the matcher with a partial match. | ||
189 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
190 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
191 | * @return the (partial) match object. | ||
192 | * | ||
193 | */ | ||
194 | public static HasMultipleIncomingTrainsition.Match newMatch(final Synchronization pV) { | ||
195 | return new Immutable(pV); | ||
196 | } | ||
197 | |||
198 | private static final class Mutable extends HasMultipleIncomingTrainsition.Match { | ||
199 | Mutable(final Synchronization pV) { | ||
200 | super(pV); | ||
201 | } | ||
202 | |||
203 | @Override | ||
204 | public boolean isMutable() { | ||
205 | return true; | ||
206 | } | ||
207 | } | ||
208 | |||
209 | private static final class Immutable extends HasMultipleIncomingTrainsition.Match { | ||
210 | Immutable(final Synchronization pV) { | ||
211 | super(pV); | ||
212 | } | ||
213 | |||
214 | @Override | ||
215 | public boolean isMutable() { | ||
216 | return false; | ||
217 | } | ||
218 | } | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleIncomingTrainsition pattern, | ||
223 | * providing pattern-specific query methods. | ||
224 | * | ||
225 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
226 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
227 | * | ||
228 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
229 | * | ||
230 | * <p>Original source: | ||
231 | * <code><pre> | ||
232 | * pattern hasMultipleIncomingTrainsition(v : Synchronization) { | ||
233 | * find transition(_, src1, v); | ||
234 | * find transition(_, src2, v); | ||
235 | * src1 != src2; | ||
236 | * } | ||
237 | * </pre></code> | ||
238 | * | ||
239 | * @see Match | ||
240 | * @see HasMultipleIncomingTrainsition | ||
241 | * | ||
242 | */ | ||
243 | public static class Matcher extends BaseMatcher<HasMultipleIncomingTrainsition.Match> { | ||
244 | /** | ||
245 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
246 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
247 | * | ||
248 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
249 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
250 | * | ||
251 | */ | ||
252 | public static HasMultipleIncomingTrainsition.Matcher on(final ViatraQueryEngine engine) { | ||
253 | // check if matcher already exists | ||
254 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
255 | if (matcher == null) { | ||
256 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
257 | } | ||
258 | return matcher; | ||
259 | } | ||
260 | |||
261 | /** | ||
262 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
263 | * @return an initialized matcher | ||
264 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
265 | * | ||
266 | */ | ||
267 | public static HasMultipleIncomingTrainsition.Matcher create() { | ||
268 | return new Matcher(); | ||
269 | } | ||
270 | |||
271 | private final static int POSITION_V = 0; | ||
272 | |||
273 | private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(HasMultipleIncomingTrainsition.Matcher.class); | ||
274 | |||
275 | /** | ||
276 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
277 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
278 | * | ||
279 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
280 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
281 | * | ||
282 | */ | ||
283 | private Matcher() { | ||
284 | super(querySpecification()); | ||
285 | } | ||
286 | |||
287 | /** | ||
288 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
289 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
290 | * @return matches represented as a Match object. | ||
291 | * | ||
292 | */ | ||
293 | public Collection<HasMultipleIncomingTrainsition.Match> getAllMatches(final Synchronization pV) { | ||
294 | return rawStreamAllMatches(new Object[]{pV}).collect(Collectors.toSet()); | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
299 | * </p> | ||
300 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
301 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
302 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
303 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
304 | * @return a stream of matches represented as a Match object. | ||
305 | * | ||
306 | */ | ||
307 | public Stream<HasMultipleIncomingTrainsition.Match> streamAllMatches(final Synchronization pV) { | ||
308 | return rawStreamAllMatches(new Object[]{pV}); | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
313 | * Neither determinism nor randomness of selection is guaranteed. | ||
314 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
315 | * @return a match represented as a Match object, or null if no match is found. | ||
316 | * | ||
317 | */ | ||
318 | public Optional<HasMultipleIncomingTrainsition.Match> getOneArbitraryMatch(final Synchronization pV) { | ||
319 | return rawGetOneArbitraryMatch(new Object[]{pV}); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
324 | * under any possible substitution of the unspecified parameters (if any). | ||
325 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
326 | * @return true if the input is a valid (partial) match of the pattern. | ||
327 | * | ||
328 | */ | ||
329 | public boolean hasMatch(final Synchronization pV) { | ||
330 | return rawHasMatch(new Object[]{pV}); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
335 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
336 | * @return the number of pattern matches found. | ||
337 | * | ||
338 | */ | ||
339 | public int countMatches(final Synchronization pV) { | ||
340 | return rawCountMatches(new Object[]{pV}); | ||
341 | } | ||
342 | |||
343 | /** | ||
344 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
345 | * Neither determinism nor randomness of selection is guaranteed. | ||
346 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
347 | * @param processor the action that will process the selected match. | ||
348 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
349 | * | ||
350 | */ | ||
351 | public boolean forOneArbitraryMatch(final Synchronization pV, final Consumer<? super HasMultipleIncomingTrainsition.Match> processor) { | ||
352 | return rawForOneArbitraryMatch(new Object[]{pV}, processor); | ||
353 | } | ||
354 | |||
355 | /** | ||
356 | * Returns a new (partial) match. | ||
357 | * This can be used e.g. to call the matcher with a partial match. | ||
358 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
359 | * @param pV the fixed value of pattern parameter v, or null if not bound. | ||
360 | * @return the (partial) match object. | ||
361 | * | ||
362 | */ | ||
363 | public HasMultipleIncomingTrainsition.Match newMatch(final Synchronization pV) { | ||
364 | return HasMultipleIncomingTrainsition.Match.newMatch(pV); | ||
365 | } | ||
366 | |||
367 | /** | ||
368 | * Retrieve the set of values that occur in matches for v. | ||
369 | * @return the Set of all values or empty set if there are no matches | ||
370 | * | ||
371 | */ | ||
372 | protected Stream<Synchronization> rawStreamAllValuesOfv(final Object[] parameters) { | ||
373 | return rawStreamAllValues(POSITION_V, parameters).map(Synchronization.class::cast); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for v. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | public Set<Synchronization> getAllValuesOfv() { | ||
382 | return rawStreamAllValuesOfv(emptyArray()).collect(Collectors.toSet()); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for v. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Stream<Synchronization> streamAllValuesOfv() { | ||
391 | return rawStreamAllValuesOfv(emptyArray()); | ||
392 | } | ||
393 | |||
394 | @Override | ||
395 | protected HasMultipleIncomingTrainsition.Match tupleToMatch(final Tuple t) { | ||
396 | try { | ||
397 | return HasMultipleIncomingTrainsition.Match.newMatch((Synchronization) t.get(POSITION_V)); | ||
398 | } catch(ClassCastException e) { | ||
399 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
400 | return null; | ||
401 | } | ||
402 | } | ||
403 | |||
404 | @Override | ||
405 | protected HasMultipleIncomingTrainsition.Match arrayToMatch(final Object[] match) { | ||
406 | try { | ||
407 | return HasMultipleIncomingTrainsition.Match.newMatch((Synchronization) match[POSITION_V]); | ||
408 | } catch(ClassCastException e) { | ||
409 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
410 | return null; | ||
411 | } | ||
412 | } | ||
413 | |||
414 | @Override | ||
415 | protected HasMultipleIncomingTrainsition.Match arrayToMatchMutable(final Object[] match) { | ||
416 | try { | ||
417 | return HasMultipleIncomingTrainsition.Match.newMutableMatch((Synchronization) match[POSITION_V]); | ||
418 | } catch(ClassCastException e) { | ||
419 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
420 | return null; | ||
421 | } | ||
422 | } | ||
423 | |||
424 | /** | ||
425 | * @return the singleton instance of the query specification of this pattern | ||
426 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
427 | * | ||
428 | */ | ||
429 | public static IQuerySpecification<HasMultipleIncomingTrainsition.Matcher> querySpecification() { | ||
430 | return HasMultipleIncomingTrainsition.instance(); | ||
431 | } | ||
432 | } | ||
433 | |||
434 | private HasMultipleIncomingTrainsition() { | ||
435 | super(GeneratedPQuery.INSTANCE); | ||
436 | } | ||
437 | |||
438 | /** | ||
439 | * @return the singleton instance of the query specification | ||
440 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
441 | * | ||
442 | */ | ||
443 | public static HasMultipleIncomingTrainsition instance() { | ||
444 | try{ | ||
445 | return LazyHolder.INSTANCE; | ||
446 | } catch (ExceptionInInitializerError err) { | ||
447 | throw processInitializerError(err); | ||
448 | } | ||
449 | } | ||
450 | |||
451 | @Override | ||
452 | protected HasMultipleIncomingTrainsition.Matcher instantiate(final ViatraQueryEngine engine) { | ||
453 | return HasMultipleIncomingTrainsition.Matcher.on(engine); | ||
454 | } | ||
455 | |||
456 | @Override | ||
457 | public HasMultipleIncomingTrainsition.Matcher instantiate() { | ||
458 | return HasMultipleIncomingTrainsition.Matcher.create(); | ||
459 | } | ||
460 | |||
461 | @Override | ||
462 | public HasMultipleIncomingTrainsition.Match newEmptyMatch() { | ||
463 | return HasMultipleIncomingTrainsition.Match.newEmptyMatch(); | ||
464 | } | ||
465 | |||
466 | @Override | ||
467 | public HasMultipleIncomingTrainsition.Match newMatch(final Object... parameters) { | ||
468 | return HasMultipleIncomingTrainsition.Match.newMatch((ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Synchronization) parameters[0]); | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.HasMultipleIncomingTrainsition (visibility: PUBLIC, simpleName: HasMultipleIncomingTrainsition, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.HasMultipleIncomingTrainsition, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
473 | * <b>not</b> at the class load time of the outer class, | ||
474 | * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.HasMultipleIncomingTrainsition (visibility: PUBLIC, simpleName: HasMultipleIncomingTrainsition, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.HasMultipleIncomingTrainsition, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
475 | * | ||
476 | * <p> This workaround is required e.g. to support recursion. | ||
477 | * | ||
478 | */ | ||
479 | private static class LazyHolder { | ||
480 | private final static HasMultipleIncomingTrainsition INSTANCE = new HasMultipleIncomingTrainsition(); | ||
481 | |||
482 | /** | ||
483 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
484 | * This initialization order is required to support indirect recursion. | ||
485 | * | ||
486 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
487 | * | ||
488 | */ | ||
489 | private final static Object STATIC_INITIALIZER = ensureInitialized(); | ||
490 | |||
491 | public static Object ensureInitialized() { | ||
492 | INSTANCE.ensureInitializedInternal(); | ||
493 | return null; | ||
494 | } | ||
495 | } | ||
496 | |||
497 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
498 | private final static HasMultipleIncomingTrainsition.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
499 | |||
500 | private final PParameter parameter_v = new PParameter("v", "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Synchronization", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("YakinduMetamodel", "Synchronization")), PParameterDirection.INOUT); | ||
501 | |||
502 | private final List<PParameter> parameters = Arrays.asList(parameter_v); | ||
503 | |||
504 | private GeneratedPQuery() { | ||
505 | super(PVisibility.PUBLIC); | ||
506 | } | ||
507 | |||
508 | @Override | ||
509 | public String getFullyQualifiedName() { | ||
510 | return "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleIncomingTrainsition"; | ||
511 | } | ||
512 | |||
513 | @Override | ||
514 | public List<String> getParameterNames() { | ||
515 | return Arrays.asList("v"); | ||
516 | } | ||
517 | |||
518 | @Override | ||
519 | public List<PParameter> getParameters() { | ||
520 | return parameters; | ||
521 | } | ||
522 | |||
523 | @Override | ||
524 | public Set<PBody> doGetContainedBodies() { | ||
525 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
526 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
527 | { | ||
528 | PBody body = new PBody(this); | ||
529 | PVariable var_v = body.getOrCreateVariableByName("v"); | ||
530 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
531 | PVariable var_src1 = body.getOrCreateVariableByName("src1"); | ||
532 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
533 | PVariable var_src2 = body.getOrCreateVariableByName("src2"); | ||
534 | new TypeConstraint(body, Tuples.flatTupleOf(var_v), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("YakinduMetamodel", "Synchronization"))); | ||
535 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
536 | new ExportedParameter(body, var_v, parameter_v) | ||
537 | )); | ||
538 | // find transition(_, src1, v) | ||
539 | new PositivePatternCall(body, Tuples.flatTupleOf(var___0_, var_src1, var_v), Transition.instance().getInternalQueryRepresentation()); | ||
540 | // find transition(_, src2, v) | ||
541 | new PositivePatternCall(body, Tuples.flatTupleOf(var___1_, var_src2, var_v), Transition.instance().getInternalQueryRepresentation()); | ||
542 | // src1 != src2 | ||
543 | new Inequality(body, var_src1, var_src2); | ||
544 | bodies.add(body); | ||
545 | } | ||
546 | return bodies; | ||
547 | } | ||
548 | } | ||
549 | } | ||