diff options
author | 2019-05-06 18:42:22 -0400 | |
---|---|---|
committer | 2019-05-06 18:42:22 -0400 | |
commit | 09b1255f11ee17828da706f682e33f50316887fe (patch) | |
tree | f3783961c521b73201a9d079be78feb26e8a285c /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java | |
parent | Merge remote-tracking branch 'origin/master' into kris (diff) | |
download | VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.tar.gz VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.tar.zst VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.zip |
Trying to implement spacecraft case study
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java | 216 |
1 files changed, 0 insertions, 216 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java deleted file mode 100644 index c70f4c8b..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java +++ /dev/null | |||
@@ -1,216 +0,0 @@ | |||
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 java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.emf.ecore.EDataType; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
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.TypeFilterConstraint; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue; | ||
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 basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { | ||
37 | * Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U); | ||
38 | * BasePrice == 250000.0; | ||
39 | * } or { | ||
40 | * Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat6U); | ||
41 | * BasePrice == 750000.0; | ||
42 | * } or { | ||
43 | * Spacecraft.kind(Spacecraft, SpacecraftKind::SmallSat); | ||
44 | * BasePrice == 3000000.0; | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see GenericPatternMatcher | ||
49 | * @see GenericPatternMatch | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class BasePrice extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
54 | private BasePrice() { | ||
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 BasePrice 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.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, 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.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, 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 BasePrice INSTANCE = new BasePrice(); | ||
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 BasePrice.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
99 | |||
100 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
101 | |||
102 | private final PParameter parameter_BasePrice = new PParameter("BasePrice", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT); | ||
103 | |||
104 | private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_BasePrice); | ||
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.basePrice"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> getParameterNames() { | ||
117 | return Arrays.asList("Spacecraft","BasePrice"); | ||
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_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
132 | PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice"); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
134 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
135 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
136 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft), | ||
137 | new ExportedParameter(body, var_BasePrice, parameter_BasePrice) | ||
138 | )); | ||
139 | // Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U) | ||
140 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
141 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "CubeSat3U").getInstance()); | ||
142 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
143 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
144 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind"))); | ||
145 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind"))); | ||
146 | new Equality(body, var__virtual_1_, var__virtual_0_); | ||
147 | // BasePrice == 250000.0 | ||
148 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
149 | new ConstantValue(body, var__virtual_2_, 250000.0); | ||
150 | new Equality(body, var_BasePrice, var__virtual_2_); | ||
151 | bodies.add(body); | ||
152 | } | ||
153 | { | ||
154 | PBody body = new PBody(this); | ||
155 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
156 | PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice"); | ||
157 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
158 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
159 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
160 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft), | ||
161 | new ExportedParameter(body, var_BasePrice, parameter_BasePrice) | ||
162 | )); | ||
163 | // Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat6U) | ||
164 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
165 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "CubeSat6U").getInstance()); | ||
166 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
167 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
168 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind"))); | ||
169 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind"))); | ||
170 | new Equality(body, var__virtual_1_, var__virtual_0_); | ||
171 | // BasePrice == 750000.0 | ||
172 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
173 | new ConstantValue(body, var__virtual_2_, 750000.0); | ||
174 | new Equality(body, var_BasePrice, var__virtual_2_); | ||
175 | bodies.add(body); | ||
176 | } | ||
177 | { | ||
178 | PBody body = new PBody(this); | ||
179 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
180 | PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice"); | ||
181 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
182 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
183 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
184 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft), | ||
185 | new ExportedParameter(body, var_BasePrice, parameter_BasePrice) | ||
186 | )); | ||
187 | // Spacecraft.kind(Spacecraft, SpacecraftKind::SmallSat) | ||
188 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
189 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "SmallSat").getInstance()); | ||
190 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
191 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
192 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind"))); | ||
193 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind"))); | ||
194 | new Equality(body, var__virtual_1_, var__virtual_0_); | ||
195 | // BasePrice == 3000000.0 | ||
196 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
197 | new ConstantValue(body, var__virtual_2_, 3000000.0); | ||
198 | new Equality(body, var_BasePrice, var__virtual_2_); | ||
199 | bodies.add(body); | ||
200 | } | ||
201 | return bodies; | ||
202 | } | ||
203 | } | ||
204 | |||
205 | private static double evaluateExpression_1_1() { | ||
206 | return 250000.0; | ||
207 | } | ||
208 | |||
209 | private static double evaluateExpression_2_1() { | ||
210 | return 750000.0; | ||
211 | } | ||
212 | |||
213 | private static double evaluateExpression_3_1() { | ||
214 | return 3000000.0; | ||
215 | } | ||
216 | } | ||