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