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