diff options
author | 2019-06-09 15:13:00 -0400 | |
---|---|---|
committer | 2019-06-09 15:13:00 -0400 | |
commit | cd63ccf6fba2a812a9b115635bbd209c92cebad0 (patch) | |
tree | 6f2a04b6fd274dffe6bb72c1afdf87989c0ba6db /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java | |
parent | Simplify satellite metamodel further (diff) | |
download | VIATRA-Generator-cd63ccf6fba2a812a9b115635bbd209c92cebad0.tar.gz VIATRA-Generator-cd63ccf6fba2a812a9b115635bbd209c92cebad0.tar.zst VIATRA-Generator-cd63ccf6fba2a812a9b115635bbd209c92cebad0.zip |
Bump MDEOptimizer version
https://github.com/mde-optimiser/mde_optimiser/issues/49
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java new file mode 100644 index 00000000..3c4f9244 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKindCount.java | |||
@@ -0,0 +1,189 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Set; | ||
13 | import org.eclipse.emf.ecore.EClass; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
15 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
30 | |||
31 | /** | ||
32 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
33 | * | ||
34 | * <p>Original source: | ||
35 | * <code><pre> | ||
36 | * private pattern spacecraftOfKindCount(Sat : Spacecraft, Count : java Integer) { | ||
37 | * CubeSat3U(Sat); | ||
38 | * Count == count find cubeSat3U(_); | ||
39 | * } or { | ||
40 | * CubeSat6U(Sat); | ||
41 | * Count == count find cubeSat6U(_); | ||
42 | * } or { | ||
43 | * SmallSat(Sat); | ||
44 | * Count == count find smallSat(_); | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see GenericPatternMatcher | ||
49 | * @see GenericPatternMatch | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class SpacecraftOfKindCount extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
54 | private SpacecraftOfKindCount() { | ||
55 | super(GeneratedPQuery.INSTANCE); | ||
56 | } | ||
57 | |||
58 | /** | ||
59 | * @return the singleton instance of the query specification | ||
60 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
61 | * | ||
62 | */ | ||
63 | public static SpacecraftOfKindCount instance() { | ||
64 | try{ | ||
65 | return LazyHolder.INSTANCE; | ||
66 | } catch (ExceptionInInitializerError err) { | ||
67 | throw processInitializerError(err); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKindCount (visibility: PUBLIC, simpleName: SpacecraftOfKindCount, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKindCount, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
73 | * <b>not</b> at the class load time of the outer class, | ||
74 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKindCount (visibility: PUBLIC, simpleName: SpacecraftOfKindCount, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKindCount, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
75 | * | ||
76 | * <p> This workaround is required e.g. to support recursion. | ||
77 | * | ||
78 | */ | ||
79 | private static class LazyHolder { | ||
80 | private static final SpacecraftOfKindCount INSTANCE = new SpacecraftOfKindCount(); | ||
81 | |||
82 | /** | ||
83 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
84 | * This initialization order is required to support indirect recursion. | ||
85 | * | ||
86 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
87 | * | ||
88 | */ | ||
89 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
90 | |||
91 | public static Object ensureInitialized() { | ||
92 | INSTANCE.ensureInitializedInternal(); | ||
93 | return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
98 | private static final SpacecraftOfKindCount.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
99 | |||
100 | private final PParameter parameter_Sat = new PParameter("Sat", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
101 | |||
102 | private final PParameter parameter_Count = new PParameter("Count", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT); | ||
103 | |||
104 | private final List<PParameter> parameters = Arrays.asList(parameter_Sat, parameter_Count); | ||
105 | |||
106 | private GeneratedPQuery() { | ||
107 | super(PVisibility.PRIVATE); | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String getFullyQualifiedName() { | ||
112 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKindCount"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> getParameterNames() { | ||
117 | return Arrays.asList("Sat","Count"); | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public List<PParameter> getParameters() { | ||
122 | return parameters; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public Set<PBody> doGetContainedBodies() { | ||
127 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
128 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
129 | { | ||
130 | PBody body = new PBody(this); | ||
131 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
132 | PVariable var_Count = body.getOrCreateVariableByName("Count"); | ||
133 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
135 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Count), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
136 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
137 | new ExportedParameter(body, var_Sat, parameter_Sat), | ||
138 | new ExportedParameter(body, var_Count, parameter_Count) | ||
139 | )); | ||
140 | // CubeSat3U(Sat) | ||
141 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
142 | // Count == count find cubeSat3U(_) | ||
143 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
144 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_), CubeSat3U.instance().getInternalQueryRepresentation(), var__virtual_0_); | ||
145 | new Equality(body, var_Count, var__virtual_0_); | ||
146 | bodies.add(body); | ||
147 | } | ||
148 | { | ||
149 | PBody body = new PBody(this); | ||
150 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
151 | PVariable var_Count = body.getOrCreateVariableByName("Count"); | ||
152 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
153 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
154 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Count), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
155 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
156 | new ExportedParameter(body, var_Sat, parameter_Sat), | ||
157 | new ExportedParameter(body, var_Count, parameter_Count) | ||
158 | )); | ||
159 | // CubeSat6U(Sat) | ||
160 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U"))); | ||
161 | // Count == count find cubeSat6U(_) | ||
162 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
163 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_), CubeSat6U.instance().getInternalQueryRepresentation(), var__virtual_0_); | ||
164 | new Equality(body, var_Count, var__virtual_0_); | ||
165 | bodies.add(body); | ||
166 | } | ||
167 | { | ||
168 | PBody body = new PBody(this); | ||
169 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
170 | PVariable var_Count = body.getOrCreateVariableByName("Count"); | ||
171 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
172 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
173 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Count), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
174 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
175 | new ExportedParameter(body, var_Sat, parameter_Sat), | ||
176 | new ExportedParameter(body, var_Count, parameter_Count) | ||
177 | )); | ||
178 | // SmallSat(Sat) | ||
179 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat"))); | ||
180 | // Count == count find smallSat(_) | ||
181 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
182 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_), SmallSat.instance().getInternalQueryRepresentation(), var__virtual_0_); | ||
183 | new Equality(body, var_Count, var__virtual_0_); | ||
184 | bodies.add(body); | ||
185 | } | ||
186 | return bodies; | ||
187 | } | ||
188 | } | ||
189 | } | ||