diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries')
30 files changed, 0 insertions, 7311 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace deleted file mode 100644 index 8fb61263..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace +++ /dev/null | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace deleted file mode 100644 index 64b692d3..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace +++ /dev/null | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore deleted file mode 100644 index f6cfd36a..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /.SatelliteQueries.java._trace | ||
2 | /.NoLinkToGroundStation.java._trace | ||
3 | /.CommunicationLoop.java._trace | ||
4 | /.SingleInterferometryPayload.java._trace | ||
5 | /.NoInterferometryPayload.java._trace | ||
6 | /.NotENoughInterferometryPayloads.java._trace | ||
7 | /.NotEnoughInterferometryPayloads.java._trace | ||
8 | /.UhfAntennaGainNotLow.java._trace | ||
9 | /.XAntennaGainNotMedium.java._trace | ||
10 | /.KaAntennaGainLow.java._trace | ||
11 | /.IncompatibleSourceAndTarget.java._trace | ||
12 | /.IncompatibleSourceAndTargetBand.java._trace | ||
13 | /.IncompatibleSourceAndTargetGain.java._trace | ||
14 | /.CubeSatWithKaAntenna.java._trace | ||
15 | /.ThreeUCubeSatWithNonUhfCrossLink.java._trace | ||
16 | /.CommunicationLinkDoesNotStartAtContainingElement.java._trace | ||
17 | /.SpacecraftWithInterferometryPayload.java._trace | ||
18 | /.SatelliteMetrics.java._trace | ||
19 | /.CoverageMetric.java._trace | ||
20 | /.TimeMetric.java._trace | ||
21 | /.CostMetric.java._trace | ||
22 | /.SpacecraftCost.java._trace | ||
23 | /.SpacecraftOfKind.java._trace | ||
24 | /.NoPotentialLinkToGroundStation.java._trace | ||
25 | /.SmallSat.java._trace | ||
26 | /CommunicationLinkDoesNotStartAtContainingElement.java | ||
27 | /CommunicationLoop.java | ||
28 | /CostMetric.java | ||
29 | /CoverageMetric.java | ||
30 | /CubeSatWithKaAntenna.java | ||
31 | /IncompatibleSourceAndTargetBand.java | ||
32 | /IncompatibleSourceAndTargetGain.java | ||
33 | /KaAntennaGainLow.java | ||
34 | /NoLinkToGroundStation.java | ||
35 | /NoPotentialLinkToGroundStation.java | ||
36 | /NotEnoughInterferometryPayloads.java | ||
37 | /SatelliteQueries.java | ||
38 | /SmallSat.java | ||
39 | /SpacecraftOfKind.java | ||
40 | /ThreeUCubeSatWithNonUhfCrossLink.java | ||
41 | /TimeMetric.java | ||
42 | /UhfAntennaGainNotLow.java | ||
43 | /XAntennaGainNotMedium.java | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java deleted file mode 100644 index a23cb415..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java +++ /dev/null | |||
@@ -1,562 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | import satellite.CommunicatingElement; | ||
43 | |||
44 | /** | ||
45 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
46 | * | ||
47 | * <p>Original source: | ||
48 | * <code><pre> | ||
49 | * {@literal @}Constraint(severity = "error", key = {Element}, | ||
50 | * message = "A communicating element may not have two transmitting communication subsystems..") | ||
51 | * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { | ||
52 | * find transmittingCommSubsystem(Element, Comm1); | ||
53 | * find transmittingCommSubsystem(Element, Comm2); | ||
54 | * Comm1 != Comm2; | ||
55 | * } | ||
56 | * </pre></code> | ||
57 | * | ||
58 | * @see Matcher | ||
59 | * @see Match | ||
60 | * | ||
61 | */ | ||
62 | @SuppressWarnings("all") | ||
63 | public final class CommunicationLinkDoesNotStartAtContainingElement extends BaseGeneratedEMFQuerySpecification<CommunicationLinkDoesNotStartAtContainingElement.Matcher> { | ||
64 | /** | ||
65 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern, | ||
66 | * to be used in conjunction with {@link Matcher}. | ||
67 | * | ||
68 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
69 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
70 | * usable to represent a match of the pattern in the result of a query, | ||
71 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
72 | * | ||
73 | * @see Matcher | ||
74 | * | ||
75 | */ | ||
76 | public static abstract class Match extends BasePatternMatch { | ||
77 | private CommunicatingElement fElement; | ||
78 | |||
79 | private static List<String> parameterNames = makeImmutableList("Element"); | ||
80 | |||
81 | private Match(final CommunicatingElement pElement) { | ||
82 | this.fElement = pElement; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public Object get(final String parameterName) { | ||
87 | if ("Element".equals(parameterName)) return this.fElement; | ||
88 | return null; | ||
89 | } | ||
90 | |||
91 | public CommunicatingElement getElement() { | ||
92 | return this.fElement; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("Element".equals(parameterName) ) { | ||
99 | this.fElement = (CommunicatingElement) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | return false; | ||
103 | } | ||
104 | |||
105 | public void setElement(final CommunicatingElement pElement) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | this.fElement = pElement; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String patternName() { | ||
112 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> parameterNames() { | ||
117 | return CommunicationLinkDoesNotStartAtContainingElement.Match.parameterNames; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public Object[] toArray() { | ||
122 | return new Object[]{fElement}; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public CommunicationLinkDoesNotStartAtContainingElement.Match toImmutable() { | ||
127 | return isMutable() ? newMatch(fElement) : this; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String prettyPrint() { | ||
132 | StringBuilder result = new StringBuilder(); | ||
133 | result.append("\"Element\"=" + prettyPrintValue(fElement)); | ||
134 | return result.toString(); | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public int hashCode() { | ||
139 | return Objects.hash(fElement); | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public boolean equals(final Object obj) { | ||
144 | if (this == obj) | ||
145 | return true; | ||
146 | if (obj == null) { | ||
147 | return false; | ||
148 | } | ||
149 | if ((obj instanceof CommunicationLinkDoesNotStartAtContainingElement.Match)) { | ||
150 | CommunicationLinkDoesNotStartAtContainingElement.Match other = (CommunicationLinkDoesNotStartAtContainingElement.Match) obj; | ||
151 | return Objects.equals(fElement, other.fElement); | ||
152 | } else { | ||
153 | // this should be infrequent | ||
154 | if (!(obj instanceof IPatternMatch)) { | ||
155 | return false; | ||
156 | } | ||
157 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
158 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public CommunicationLinkDoesNotStartAtContainingElement specification() { | ||
164 | return CommunicationLinkDoesNotStartAtContainingElement.instance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Returns an empty, mutable match. | ||
169 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
170 | * | ||
171 | * @return the empty match. | ||
172 | * | ||
173 | */ | ||
174 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() { | ||
175 | return new Mutable(null); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns a mutable (partial) match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
183 | * @return the new, mutable (partial) match object. | ||
184 | * | ||
185 | */ | ||
186 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMutableMatch(final CommunicatingElement pElement) { | ||
187 | return new Mutable(pElement); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a new (partial) match. | ||
192 | * This can be used e.g. to call the matcher with a partial match. | ||
193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
194 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
195 | * @return the (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) { | ||
199 | return new Immutable(pElement); | ||
200 | } | ||
201 | |||
202 | private static final class Mutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { | ||
203 | Mutable(final CommunicatingElement pElement) { | ||
204 | super(pElement); | ||
205 | } | ||
206 | |||
207 | @Override | ||
208 | public boolean isMutable() { | ||
209 | return true; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | private static final class Immutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { | ||
214 | Immutable(final CommunicatingElement pElement) { | ||
215 | super(pElement); | ||
216 | } | ||
217 | |||
218 | @Override | ||
219 | public boolean isMutable() { | ||
220 | return false; | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern, | ||
227 | * providing pattern-specific query methods. | ||
228 | * | ||
229 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
230 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
231 | * | ||
232 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
233 | * | ||
234 | * <p>Original source: | ||
235 | * <code><pre> | ||
236 | * {@literal @}Constraint(severity = "error", key = {Element}, | ||
237 | * message = "A communicating element may not have two transmitting communication subsystems..") | ||
238 | * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { | ||
239 | * find transmittingCommSubsystem(Element, Comm1); | ||
240 | * find transmittingCommSubsystem(Element, Comm2); | ||
241 | * Comm1 != Comm2; | ||
242 | * } | ||
243 | * </pre></code> | ||
244 | * | ||
245 | * @see Match | ||
246 | * @see CommunicationLinkDoesNotStartAtContainingElement | ||
247 | * | ||
248 | */ | ||
249 | public static class Matcher extends BaseMatcher<CommunicationLinkDoesNotStartAtContainingElement.Match> { | ||
250 | /** | ||
251 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
252 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
253 | * | ||
254 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
255 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
256 | * | ||
257 | */ | ||
258 | public static CommunicationLinkDoesNotStartAtContainingElement.Matcher on(final ViatraQueryEngine engine) { | ||
259 | // check if matcher already exists | ||
260 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
261 | if (matcher == null) { | ||
262 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
263 | } | ||
264 | return matcher; | ||
265 | } | ||
266 | |||
267 | /** | ||
268 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
269 | * @return an initialized matcher | ||
270 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
271 | * | ||
272 | */ | ||
273 | public static CommunicationLinkDoesNotStartAtContainingElement.Matcher create() { | ||
274 | return new Matcher(); | ||
275 | } | ||
276 | |||
277 | private static final int POSITION_ELEMENT = 0; | ||
278 | |||
279 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkDoesNotStartAtContainingElement.Matcher.class); | ||
280 | |||
281 | /** | ||
282 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
283 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
284 | * | ||
285 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
286 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
287 | * | ||
288 | */ | ||
289 | private Matcher() { | ||
290 | super(querySpecification()); | ||
291 | } | ||
292 | |||
293 | /** | ||
294 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
295 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
296 | * @return matches represented as a Match object. | ||
297 | * | ||
298 | */ | ||
299 | public Collection<CommunicationLinkDoesNotStartAtContainingElement.Match> getAllMatches(final CommunicatingElement pElement) { | ||
300 | return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet()); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
305 | * </p> | ||
306 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
307 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
308 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
309 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
310 | * @return a stream of matches represented as a Match object. | ||
311 | * | ||
312 | */ | ||
313 | public Stream<CommunicationLinkDoesNotStartAtContainingElement.Match> streamAllMatches(final CommunicatingElement pElement) { | ||
314 | return rawStreamAllMatches(new Object[]{pElement}); | ||
315 | } | ||
316 | |||
317 | /** | ||
318 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
319 | * Neither determinism nor randomness of selection is guaranteed. | ||
320 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
321 | * @return a match represented as a Match object, or null if no match is found. | ||
322 | * | ||
323 | */ | ||
324 | public Optional<CommunicationLinkDoesNotStartAtContainingElement.Match> getOneArbitraryMatch(final CommunicatingElement pElement) { | ||
325 | return rawGetOneArbitraryMatch(new Object[]{pElement}); | ||
326 | } | ||
327 | |||
328 | /** | ||
329 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
330 | * under any possible substitution of the unspecified parameters (if any). | ||
331 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
332 | * @return true if the input is a valid (partial) match of the pattern. | ||
333 | * | ||
334 | */ | ||
335 | public boolean hasMatch(final CommunicatingElement pElement) { | ||
336 | return rawHasMatch(new Object[]{pElement}); | ||
337 | } | ||
338 | |||
339 | /** | ||
340 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
341 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
342 | * @return the number of pattern matches found. | ||
343 | * | ||
344 | */ | ||
345 | public int countMatches(final CommunicatingElement pElement) { | ||
346 | return rawCountMatches(new Object[]{pElement}); | ||
347 | } | ||
348 | |||
349 | /** | ||
350 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
351 | * Neither determinism nor randomness of selection is guaranteed. | ||
352 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
353 | * @param processor the action that will process the selected match. | ||
354 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
355 | * | ||
356 | */ | ||
357 | public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer<? super CommunicationLinkDoesNotStartAtContainingElement.Match> processor) { | ||
358 | return rawForOneArbitraryMatch(new Object[]{pElement}, processor); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Returns a new (partial) match. | ||
363 | * This can be used e.g. to call the matcher with a partial match. | ||
364 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
365 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
366 | * @return the (partial) match object. | ||
367 | * | ||
368 | */ | ||
369 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) { | ||
370 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch(pElement); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Retrieve the set of values that occur in matches for Element. | ||
375 | * @return the Set of all values or empty set if there are no matches | ||
376 | * | ||
377 | */ | ||
378 | protected Stream<CommunicatingElement> rawStreamAllValuesOfElement(final Object[] parameters) { | ||
379 | return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Retrieve the set of values that occur in matches for Element. | ||
384 | * @return the Set of all values or empty set if there are no matches | ||
385 | * | ||
386 | */ | ||
387 | public Set<CommunicatingElement> getAllValuesOfElement() { | ||
388 | return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet()); | ||
389 | } | ||
390 | |||
391 | /** | ||
392 | * Retrieve the set of values that occur in matches for Element. | ||
393 | * @return the Set of all values or empty set if there are no matches | ||
394 | * | ||
395 | */ | ||
396 | public Stream<CommunicatingElement> streamAllValuesOfElement() { | ||
397 | return rawStreamAllValuesOfElement(emptyArray()); | ||
398 | } | ||
399 | |||
400 | @Override | ||
401 | protected CommunicationLinkDoesNotStartAtContainingElement.Match tupleToMatch(final Tuple t) { | ||
402 | try { | ||
403 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT)); | ||
404 | } catch(ClassCastException e) { | ||
405 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
406 | return null; | ||
407 | } | ||
408 | } | ||
409 | |||
410 | @Override | ||
411 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatch(final Object[] match) { | ||
412 | try { | ||
413 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]); | ||
414 | } catch(ClassCastException e) { | ||
415 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
416 | return null; | ||
417 | } | ||
418 | } | ||
419 | |||
420 | @Override | ||
421 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatchMutable(final Object[] match) { | ||
422 | try { | ||
423 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]); | ||
424 | } catch(ClassCastException e) { | ||
425 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
426 | return null; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * @return the singleton instance of the query specification of this pattern | ||
432 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
433 | * | ||
434 | */ | ||
435 | public static IQuerySpecification<CommunicationLinkDoesNotStartAtContainingElement.Matcher> querySpecification() { | ||
436 | return CommunicationLinkDoesNotStartAtContainingElement.instance(); | ||
437 | } | ||
438 | } | ||
439 | |||
440 | private CommunicationLinkDoesNotStartAtContainingElement() { | ||
441 | super(GeneratedPQuery.INSTANCE); | ||
442 | } | ||
443 | |||
444 | /** | ||
445 | * @return the singleton instance of the query specification | ||
446 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
447 | * | ||
448 | */ | ||
449 | public static CommunicationLinkDoesNotStartAtContainingElement instance() { | ||
450 | try{ | ||
451 | return LazyHolder.INSTANCE; | ||
452 | } catch (ExceptionInInitializerError err) { | ||
453 | throw processInitializerError(err); | ||
454 | } | ||
455 | } | ||
456 | |||
457 | @Override | ||
458 | protected CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate(final ViatraQueryEngine engine) { | ||
459 | return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine); | ||
460 | } | ||
461 | |||
462 | @Override | ||
463 | public CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate() { | ||
464 | return CommunicationLinkDoesNotStartAtContainingElement.Matcher.create(); | ||
465 | } | ||
466 | |||
467 | @Override | ||
468 | public CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() { | ||
469 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newEmptyMatch(); | ||
470 | } | ||
471 | |||
472 | @Override | ||
473 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final Object... parameters) { | ||
474 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((satellite.CommunicatingElement) parameters[0]); | ||
475 | } | ||
476 | |||
477 | /** | ||
478 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
479 | * <b>not</b> at the class load time of the outer class, | ||
480 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
481 | * | ||
482 | * <p> This workaround is required e.g. to support recursion. | ||
483 | * | ||
484 | */ | ||
485 | private static class LazyHolder { | ||
486 | private static final CommunicationLinkDoesNotStartAtContainingElement INSTANCE = new CommunicationLinkDoesNotStartAtContainingElement(); | ||
487 | |||
488 | /** | ||
489 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
490 | * This initialization order is required to support indirect recursion. | ||
491 | * | ||
492 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
493 | * | ||
494 | */ | ||
495 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
496 | |||
497 | public static Object ensureInitialized() { | ||
498 | INSTANCE.ensureInitializedInternal(); | ||
499 | return null; | ||
500 | } | ||
501 | } | ||
502 | |||
503 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
504 | private static final CommunicationLinkDoesNotStartAtContainingElement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
505 | |||
506 | private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
507 | |||
508 | private final List<PParameter> parameters = Arrays.asList(parameter_Element); | ||
509 | |||
510 | private GeneratedPQuery() { | ||
511 | super(PVisibility.PUBLIC); | ||
512 | } | ||
513 | |||
514 | @Override | ||
515 | public String getFullyQualifiedName() { | ||
516 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"; | ||
517 | } | ||
518 | |||
519 | @Override | ||
520 | public List<String> getParameterNames() { | ||
521 | return Arrays.asList("Element"); | ||
522 | } | ||
523 | |||
524 | @Override | ||
525 | public List<PParameter> getParameters() { | ||
526 | return parameters; | ||
527 | } | ||
528 | |||
529 | @Override | ||
530 | public Set<PBody> doGetContainedBodies() { | ||
531 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
532 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
533 | { | ||
534 | PBody body = new PBody(this); | ||
535 | PVariable var_Element = body.getOrCreateVariableByName("Element"); | ||
536 | PVariable var_Comm1 = body.getOrCreateVariableByName("Comm1"); | ||
537 | PVariable var_Comm2 = body.getOrCreateVariableByName("Comm2"); | ||
538 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
539 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
540 | new ExportedParameter(body, var_Element, parameter_Element) | ||
541 | )); | ||
542 | // find transmittingCommSubsystem(Element, Comm1) | ||
543 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm1), TransmittingCommSubsystem.instance().getInternalQueryRepresentation()); | ||
544 | // find transmittingCommSubsystem(Element, Comm2) | ||
545 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm2), TransmittingCommSubsystem.instance().getInternalQueryRepresentation()); | ||
546 | // Comm1 != Comm2 | ||
547 | new Inequality(body, var_Comm1, var_Comm2); | ||
548 | bodies.add(body); | ||
549 | } | ||
550 | { | ||
551 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
552 | annotation.addAttribute("severity", "error"); | ||
553 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
554 | new ParameterReference("Element") | ||
555 | })); | ||
556 | annotation.addAttribute("message", "A communicating element may not have two transmitting communication subsystems.."); | ||
557 | addAnnotation(annotation); | ||
558 | } | ||
559 | return bodies; | ||
560 | } | ||
561 | } | ||
562 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java deleted file mode 100644 index ede57df8..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java +++ /dev/null | |||
@@ -1,557 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
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 | import satellite.CommunicatingElement; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * // No communication loops may exist | ||
49 | * // No spacecraft may directly communicate with itself | ||
50 | * | ||
51 | * {@literal @}Constraint(severity = "error", key = {Element}, | ||
52 | * message = "Communication loop.") | ||
53 | * pattern communicationLoop(Element : CommunicatingElement) { | ||
54 | * find indirectCommunicationLink(Element, Element); | ||
55 | * } | ||
56 | * </pre></code> | ||
57 | * | ||
58 | * @see Matcher | ||
59 | * @see Match | ||
60 | * | ||
61 | */ | ||
62 | @SuppressWarnings("all") | ||
63 | public final class CommunicationLoop extends BaseGeneratedEMFQuerySpecification<CommunicationLoop.Matcher> { | ||
64 | /** | ||
65 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop pattern, | ||
66 | * to be used in conjunction with {@link Matcher}. | ||
67 | * | ||
68 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
69 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
70 | * usable to represent a match of the pattern in the result of a query, | ||
71 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
72 | * | ||
73 | * @see Matcher | ||
74 | * | ||
75 | */ | ||
76 | public static abstract class Match extends BasePatternMatch { | ||
77 | private CommunicatingElement fElement; | ||
78 | |||
79 | private static List<String> parameterNames = makeImmutableList("Element"); | ||
80 | |||
81 | private Match(final CommunicatingElement pElement) { | ||
82 | this.fElement = pElement; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public Object get(final String parameterName) { | ||
87 | if ("Element".equals(parameterName)) return this.fElement; | ||
88 | return null; | ||
89 | } | ||
90 | |||
91 | public CommunicatingElement getElement() { | ||
92 | return this.fElement; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("Element".equals(parameterName) ) { | ||
99 | this.fElement = (CommunicatingElement) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | return false; | ||
103 | } | ||
104 | |||
105 | public void setElement(final CommunicatingElement pElement) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | this.fElement = pElement; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String patternName() { | ||
112 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> parameterNames() { | ||
117 | return CommunicationLoop.Match.parameterNames; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public Object[] toArray() { | ||
122 | return new Object[]{fElement}; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public CommunicationLoop.Match toImmutable() { | ||
127 | return isMutable() ? newMatch(fElement) : this; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String prettyPrint() { | ||
132 | StringBuilder result = new StringBuilder(); | ||
133 | result.append("\"Element\"=" + prettyPrintValue(fElement)); | ||
134 | return result.toString(); | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public int hashCode() { | ||
139 | return Objects.hash(fElement); | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public boolean equals(final Object obj) { | ||
144 | if (this == obj) | ||
145 | return true; | ||
146 | if (obj == null) { | ||
147 | return false; | ||
148 | } | ||
149 | if ((obj instanceof CommunicationLoop.Match)) { | ||
150 | CommunicationLoop.Match other = (CommunicationLoop.Match) obj; | ||
151 | return Objects.equals(fElement, other.fElement); | ||
152 | } else { | ||
153 | // this should be infrequent | ||
154 | if (!(obj instanceof IPatternMatch)) { | ||
155 | return false; | ||
156 | } | ||
157 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
158 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public CommunicationLoop specification() { | ||
164 | return CommunicationLoop.instance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Returns an empty, mutable match. | ||
169 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
170 | * | ||
171 | * @return the empty match. | ||
172 | * | ||
173 | */ | ||
174 | public static CommunicationLoop.Match newEmptyMatch() { | ||
175 | return new Mutable(null); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns a mutable (partial) match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
183 | * @return the new, mutable (partial) match object. | ||
184 | * | ||
185 | */ | ||
186 | public static CommunicationLoop.Match newMutableMatch(final CommunicatingElement pElement) { | ||
187 | return new Mutable(pElement); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a new (partial) match. | ||
192 | * This can be used e.g. to call the matcher with a partial match. | ||
193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
194 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
195 | * @return the (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static CommunicationLoop.Match newMatch(final CommunicatingElement pElement) { | ||
199 | return new Immutable(pElement); | ||
200 | } | ||
201 | |||
202 | private static final class Mutable extends CommunicationLoop.Match { | ||
203 | Mutable(final CommunicatingElement pElement) { | ||
204 | super(pElement); | ||
205 | } | ||
206 | |||
207 | @Override | ||
208 | public boolean isMutable() { | ||
209 | return true; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | private static final class Immutable extends CommunicationLoop.Match { | ||
214 | Immutable(final CommunicatingElement pElement) { | ||
215 | super(pElement); | ||
216 | } | ||
217 | |||
218 | @Override | ||
219 | public boolean isMutable() { | ||
220 | return false; | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop pattern, | ||
227 | * providing pattern-specific query methods. | ||
228 | * | ||
229 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
230 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
231 | * | ||
232 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
233 | * | ||
234 | * <p>Original source: | ||
235 | * <code><pre> | ||
236 | * // No communication loops may exist | ||
237 | * // No spacecraft may directly communicate with itself | ||
238 | * | ||
239 | * {@literal @}Constraint(severity = "error", key = {Element}, | ||
240 | * message = "Communication loop.") | ||
241 | * pattern communicationLoop(Element : CommunicatingElement) { | ||
242 | * find indirectCommunicationLink(Element, Element); | ||
243 | * } | ||
244 | * </pre></code> | ||
245 | * | ||
246 | * @see Match | ||
247 | * @see CommunicationLoop | ||
248 | * | ||
249 | */ | ||
250 | public static class Matcher extends BaseMatcher<CommunicationLoop.Match> { | ||
251 | /** | ||
252 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
253 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
254 | * | ||
255 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
256 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
257 | * | ||
258 | */ | ||
259 | public static CommunicationLoop.Matcher on(final ViatraQueryEngine engine) { | ||
260 | // check if matcher already exists | ||
261 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
262 | if (matcher == null) { | ||
263 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
264 | } | ||
265 | return matcher; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
270 | * @return an initialized matcher | ||
271 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
272 | * | ||
273 | */ | ||
274 | public static CommunicationLoop.Matcher create() { | ||
275 | return new Matcher(); | ||
276 | } | ||
277 | |||
278 | private static final int POSITION_ELEMENT = 0; | ||
279 | |||
280 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLoop.Matcher.class); | ||
281 | |||
282 | /** | ||
283 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
284 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
285 | * | ||
286 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
287 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
288 | * | ||
289 | */ | ||
290 | private Matcher() { | ||
291 | super(querySpecification()); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
296 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
297 | * @return matches represented as a Match object. | ||
298 | * | ||
299 | */ | ||
300 | public Collection<CommunicationLoop.Match> getAllMatches(final CommunicatingElement pElement) { | ||
301 | return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet()); | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
306 | * </p> | ||
307 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
308 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
309 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
310 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
311 | * @return a stream of matches represented as a Match object. | ||
312 | * | ||
313 | */ | ||
314 | public Stream<CommunicationLoop.Match> streamAllMatches(final CommunicatingElement pElement) { | ||
315 | return rawStreamAllMatches(new Object[]{pElement}); | ||
316 | } | ||
317 | |||
318 | /** | ||
319 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
320 | * Neither determinism nor randomness of selection is guaranteed. | ||
321 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
322 | * @return a match represented as a Match object, or null if no match is found. | ||
323 | * | ||
324 | */ | ||
325 | public Optional<CommunicationLoop.Match> getOneArbitraryMatch(final CommunicatingElement pElement) { | ||
326 | return rawGetOneArbitraryMatch(new Object[]{pElement}); | ||
327 | } | ||
328 | |||
329 | /** | ||
330 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
331 | * under any possible substitution of the unspecified parameters (if any). | ||
332 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
333 | * @return true if the input is a valid (partial) match of the pattern. | ||
334 | * | ||
335 | */ | ||
336 | public boolean hasMatch(final CommunicatingElement pElement) { | ||
337 | return rawHasMatch(new Object[]{pElement}); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
342 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
343 | * @return the number of pattern matches found. | ||
344 | * | ||
345 | */ | ||
346 | public int countMatches(final CommunicatingElement pElement) { | ||
347 | return rawCountMatches(new Object[]{pElement}); | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
352 | * Neither determinism nor randomness of selection is guaranteed. | ||
353 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
354 | * @param processor the action that will process the selected match. | ||
355 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
356 | * | ||
357 | */ | ||
358 | public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer<? super CommunicationLoop.Match> processor) { | ||
359 | return rawForOneArbitraryMatch(new Object[]{pElement}, processor); | ||
360 | } | ||
361 | |||
362 | /** | ||
363 | * Returns a new (partial) match. | ||
364 | * This can be used e.g. to call the matcher with a partial match. | ||
365 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
366 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. | ||
367 | * @return the (partial) match object. | ||
368 | * | ||
369 | */ | ||
370 | public CommunicationLoop.Match newMatch(final CommunicatingElement pElement) { | ||
371 | return CommunicationLoop.Match.newMatch(pElement); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for Element. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | protected Stream<CommunicatingElement> rawStreamAllValuesOfElement(final Object[] parameters) { | ||
380 | return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for Element. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Set<CommunicatingElement> getAllValuesOfElement() { | ||
389 | return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet()); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for Element. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | public Stream<CommunicatingElement> streamAllValuesOfElement() { | ||
398 | return rawStreamAllValuesOfElement(emptyArray()); | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected CommunicationLoop.Match tupleToMatch(final Tuple t) { | ||
403 | try { | ||
404 | return CommunicationLoop.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT)); | ||
405 | } catch(ClassCastException e) { | ||
406 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
407 | return null; | ||
408 | } | ||
409 | } | ||
410 | |||
411 | @Override | ||
412 | protected CommunicationLoop.Match arrayToMatch(final Object[] match) { | ||
413 | try { | ||
414 | return CommunicationLoop.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]); | ||
415 | } catch(ClassCastException e) { | ||
416 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
417 | return null; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | @Override | ||
422 | protected CommunicationLoop.Match arrayToMatchMutable(final Object[] match) { | ||
423 | try { | ||
424 | return CommunicationLoop.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]); | ||
425 | } catch(ClassCastException e) { | ||
426 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
427 | return null; | ||
428 | } | ||
429 | } | ||
430 | |||
431 | /** | ||
432 | * @return the singleton instance of the query specification of this pattern | ||
433 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
434 | * | ||
435 | */ | ||
436 | public static IQuerySpecification<CommunicationLoop.Matcher> querySpecification() { | ||
437 | return CommunicationLoop.instance(); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | private CommunicationLoop() { | ||
442 | super(GeneratedPQuery.INSTANCE); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * @return the singleton instance of the query specification | ||
447 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
448 | * | ||
449 | */ | ||
450 | public static CommunicationLoop instance() { | ||
451 | try{ | ||
452 | return LazyHolder.INSTANCE; | ||
453 | } catch (ExceptionInInitializerError err) { | ||
454 | throw processInitializerError(err); | ||
455 | } | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | protected CommunicationLoop.Matcher instantiate(final ViatraQueryEngine engine) { | ||
460 | return CommunicationLoop.Matcher.on(engine); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public CommunicationLoop.Matcher instantiate() { | ||
465 | return CommunicationLoop.Matcher.create(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public CommunicationLoop.Match newEmptyMatch() { | ||
470 | return CommunicationLoop.Match.newEmptyMatch(); | ||
471 | } | ||
472 | |||
473 | @Override | ||
474 | public CommunicationLoop.Match newMatch(final Object... parameters) { | ||
475 | return CommunicationLoop.Match.newMatch((satellite.CommunicatingElement) parameters[0]); | ||
476 | } | ||
477 | |||
478 | /** | ||
479 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop (visibility: PUBLIC, simpleName: CommunicationLoop, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
480 | * <b>not</b> at the class load time of the outer class, | ||
481 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop (visibility: PUBLIC, simpleName: CommunicationLoop, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
482 | * | ||
483 | * <p> This workaround is required e.g. to support recursion. | ||
484 | * | ||
485 | */ | ||
486 | private static class LazyHolder { | ||
487 | private static final CommunicationLoop INSTANCE = new CommunicationLoop(); | ||
488 | |||
489 | /** | ||
490 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
491 | * This initialization order is required to support indirect recursion. | ||
492 | * | ||
493 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
494 | * | ||
495 | */ | ||
496 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
497 | |||
498 | public static Object ensureInitialized() { | ||
499 | INSTANCE.ensureInitializedInternal(); | ||
500 | return null; | ||
501 | } | ||
502 | } | ||
503 | |||
504 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
505 | private static final CommunicationLoop.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
506 | |||
507 | private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
508 | |||
509 | private final List<PParameter> parameters = Arrays.asList(parameter_Element); | ||
510 | |||
511 | private GeneratedPQuery() { | ||
512 | super(PVisibility.PUBLIC); | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public String getFullyQualifiedName() { | ||
517 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop"; | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<String> getParameterNames() { | ||
522 | return Arrays.asList("Element"); | ||
523 | } | ||
524 | |||
525 | @Override | ||
526 | public List<PParameter> getParameters() { | ||
527 | return parameters; | ||
528 | } | ||
529 | |||
530 | @Override | ||
531 | public Set<PBody> doGetContainedBodies() { | ||
532 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
533 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
534 | { | ||
535 | PBody body = new PBody(this); | ||
536 | PVariable var_Element = body.getOrCreateVariableByName("Element"); | ||
537 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
538 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
539 | new ExportedParameter(body, var_Element, parameter_Element) | ||
540 | )); | ||
541 | // find indirectCommunicationLink(Element, Element) | ||
542 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Element), IndirectCommunicationLink.instance().getInternalQueryRepresentation()); | ||
543 | bodies.add(body); | ||
544 | } | ||
545 | { | ||
546 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
547 | annotation.addAttribute("severity", "error"); | ||
548 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
549 | new ParameterReference("Element") | ||
550 | })); | ||
551 | annotation.addAttribute("message", "Communication loop."); | ||
552 | addAnnotation(annotation); | ||
553 | } | ||
554 | return bodies; | ||
555 | } | ||
556 | } | ||
557 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java deleted file mode 100644 index f372da70..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java +++ /dev/null | |||
@@ -1,570 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
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.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
43 | import satellite.Spacecraft; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * // Only a Small Satellite can be configured with a Ka-band communication system | ||
51 | * | ||
52 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
53 | * message = "Only a Small Satellite can be configured with a Ka-band communication system.") | ||
54 | * pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) { | ||
55 | * CommunicatingElement.commSubsystem(Spacecraft, Comm); | ||
56 | * KaCommSubsystem(Comm); | ||
57 | * neg find smallSat(Spacecraft); | ||
58 | * } | ||
59 | * </pre></code> | ||
60 | * | ||
61 | * @see Matcher | ||
62 | * @see Match | ||
63 | * | ||
64 | */ | ||
65 | @SuppressWarnings("all") | ||
66 | public final class CubeSatWithKaAntenna extends BaseGeneratedEMFQuerySpecification<CubeSatWithKaAntenna.Matcher> { | ||
67 | /** | ||
68 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna pattern, | ||
69 | * to be used in conjunction with {@link Matcher}. | ||
70 | * | ||
71 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
72 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
73 | * usable to represent a match of the pattern in the result of a query, | ||
74 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
75 | * | ||
76 | * @see Matcher | ||
77 | * | ||
78 | */ | ||
79 | public static abstract class Match extends BasePatternMatch { | ||
80 | private Spacecraft fSpacecraft; | ||
81 | |||
82 | private static List<String> parameterNames = makeImmutableList("Spacecraft"); | ||
83 | |||
84 | private Match(final Spacecraft pSpacecraft) { | ||
85 | this.fSpacecraft = pSpacecraft; | ||
86 | } | ||
87 | |||
88 | @Override | ||
89 | public Object get(final String parameterName) { | ||
90 | if ("Spacecraft".equals(parameterName)) return this.fSpacecraft; | ||
91 | return null; | ||
92 | } | ||
93 | |||
94 | public Spacecraft getSpacecraft() { | ||
95 | return this.fSpacecraft; | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public boolean set(final String parameterName, final Object newValue) { | ||
100 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
101 | if ("Spacecraft".equals(parameterName) ) { | ||
102 | this.fSpacecraft = (Spacecraft) newValue; | ||
103 | return true; | ||
104 | } | ||
105 | return false; | ||
106 | } | ||
107 | |||
108 | public void setSpacecraft(final Spacecraft pSpacecraft) { | ||
109 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
110 | this.fSpacecraft = pSpacecraft; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public String patternName() { | ||
115 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna"; | ||
116 | } | ||
117 | |||
118 | @Override | ||
119 | public List<String> parameterNames() { | ||
120 | return CubeSatWithKaAntenna.Match.parameterNames; | ||
121 | } | ||
122 | |||
123 | @Override | ||
124 | public Object[] toArray() { | ||
125 | return new Object[]{fSpacecraft}; | ||
126 | } | ||
127 | |||
128 | @Override | ||
129 | public CubeSatWithKaAntenna.Match toImmutable() { | ||
130 | return isMutable() ? newMatch(fSpacecraft) : this; | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public String prettyPrint() { | ||
135 | StringBuilder result = new StringBuilder(); | ||
136 | result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft)); | ||
137 | return result.toString(); | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public int hashCode() { | ||
142 | return Objects.hash(fSpacecraft); | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public boolean equals(final Object obj) { | ||
147 | if (this == obj) | ||
148 | return true; | ||
149 | if (obj == null) { | ||
150 | return false; | ||
151 | } | ||
152 | if ((obj instanceof CubeSatWithKaAntenna.Match)) { | ||
153 | CubeSatWithKaAntenna.Match other = (CubeSatWithKaAntenna.Match) obj; | ||
154 | return Objects.equals(fSpacecraft, other.fSpacecraft); | ||
155 | } else { | ||
156 | // this should be infrequent | ||
157 | if (!(obj instanceof IPatternMatch)) { | ||
158 | return false; | ||
159 | } | ||
160 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
161 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | @Override | ||
166 | public CubeSatWithKaAntenna specification() { | ||
167 | return CubeSatWithKaAntenna.instance(); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * Returns an empty, mutable match. | ||
172 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
173 | * | ||
174 | * @return the empty match. | ||
175 | * | ||
176 | */ | ||
177 | public static CubeSatWithKaAntenna.Match newEmptyMatch() { | ||
178 | return new Mutable(null); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * Returns a mutable (partial) match. | ||
183 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
184 | * | ||
185 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
186 | * @return the new, mutable (partial) match object. | ||
187 | * | ||
188 | */ | ||
189 | public static CubeSatWithKaAntenna.Match newMutableMatch(final Spacecraft pSpacecraft) { | ||
190 | return new Mutable(pSpacecraft); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * Returns a new (partial) match. | ||
195 | * This can be used e.g. to call the matcher with a partial match. | ||
196 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
197 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
198 | * @return the (partial) match object. | ||
199 | * | ||
200 | */ | ||
201 | public static CubeSatWithKaAntenna.Match newMatch(final Spacecraft pSpacecraft) { | ||
202 | return new Immutable(pSpacecraft); | ||
203 | } | ||
204 | |||
205 | private static final class Mutable extends CubeSatWithKaAntenna.Match { | ||
206 | Mutable(final Spacecraft pSpacecraft) { | ||
207 | super(pSpacecraft); | ||
208 | } | ||
209 | |||
210 | @Override | ||
211 | public boolean isMutable() { | ||
212 | return true; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | private static final class Immutable extends CubeSatWithKaAntenna.Match { | ||
217 | Immutable(final Spacecraft pSpacecraft) { | ||
218 | super(pSpacecraft); | ||
219 | } | ||
220 | |||
221 | @Override | ||
222 | public boolean isMutable() { | ||
223 | return false; | ||
224 | } | ||
225 | } | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna pattern, | ||
230 | * providing pattern-specific query methods. | ||
231 | * | ||
232 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
233 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
234 | * | ||
235 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
236 | * | ||
237 | * <p>Original source: | ||
238 | * <code><pre> | ||
239 | * // Only a Small Satellite can be configured with a Ka-band communication system | ||
240 | * | ||
241 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
242 | * message = "Only a Small Satellite can be configured with a Ka-band communication system.") | ||
243 | * pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) { | ||
244 | * CommunicatingElement.commSubsystem(Spacecraft, Comm); | ||
245 | * KaCommSubsystem(Comm); | ||
246 | * neg find smallSat(Spacecraft); | ||
247 | * } | ||
248 | * </pre></code> | ||
249 | * | ||
250 | * @see Match | ||
251 | * @see CubeSatWithKaAntenna | ||
252 | * | ||
253 | */ | ||
254 | public static class Matcher extends BaseMatcher<CubeSatWithKaAntenna.Match> { | ||
255 | /** | ||
256 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
257 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
258 | * | ||
259 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
260 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
261 | * | ||
262 | */ | ||
263 | public static CubeSatWithKaAntenna.Matcher on(final ViatraQueryEngine engine) { | ||
264 | // check if matcher already exists | ||
265 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
266 | if (matcher == null) { | ||
267 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
268 | } | ||
269 | return matcher; | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
274 | * @return an initialized matcher | ||
275 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
276 | * | ||
277 | */ | ||
278 | public static CubeSatWithKaAntenna.Matcher create() { | ||
279 | return new Matcher(); | ||
280 | } | ||
281 | |||
282 | private static final int POSITION_SPACECRAFT = 0; | ||
283 | |||
284 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CubeSatWithKaAntenna.Matcher.class); | ||
285 | |||
286 | /** | ||
287 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
288 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
289 | * | ||
290 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
291 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
292 | * | ||
293 | */ | ||
294 | private Matcher() { | ||
295 | super(querySpecification()); | ||
296 | } | ||
297 | |||
298 | /** | ||
299 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
300 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
301 | * @return matches represented as a Match object. | ||
302 | * | ||
303 | */ | ||
304 | public Collection<CubeSatWithKaAntenna.Match> getAllMatches(final Spacecraft pSpacecraft) { | ||
305 | return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet()); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
310 | * </p> | ||
311 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
312 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
313 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
314 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
315 | * @return a stream of matches represented as a Match object. | ||
316 | * | ||
317 | */ | ||
318 | public Stream<CubeSatWithKaAntenna.Match> streamAllMatches(final Spacecraft pSpacecraft) { | ||
319 | return rawStreamAllMatches(new Object[]{pSpacecraft}); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
324 | * Neither determinism nor randomness of selection is guaranteed. | ||
325 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
326 | * @return a match represented as a Match object, or null if no match is found. | ||
327 | * | ||
328 | */ | ||
329 | public Optional<CubeSatWithKaAntenna.Match> getOneArbitraryMatch(final Spacecraft pSpacecraft) { | ||
330 | return rawGetOneArbitraryMatch(new Object[]{pSpacecraft}); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
335 | * under any possible substitution of the unspecified parameters (if any). | ||
336 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
337 | * @return true if the input is a valid (partial) match of the pattern. | ||
338 | * | ||
339 | */ | ||
340 | public boolean hasMatch(final Spacecraft pSpacecraft) { | ||
341 | return rawHasMatch(new Object[]{pSpacecraft}); | ||
342 | } | ||
343 | |||
344 | /** | ||
345 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
346 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
347 | * @return the number of pattern matches found. | ||
348 | * | ||
349 | */ | ||
350 | public int countMatches(final Spacecraft pSpacecraft) { | ||
351 | return rawCountMatches(new Object[]{pSpacecraft}); | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
356 | * Neither determinism nor randomness of selection is guaranteed. | ||
357 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
358 | * @param processor the action that will process the selected match. | ||
359 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
360 | * | ||
361 | */ | ||
362 | public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer<? super CubeSatWithKaAntenna.Match> processor) { | ||
363 | return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Returns a new (partial) match. | ||
368 | * This can be used e.g. to call the matcher with a partial match. | ||
369 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
370 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
371 | * @return the (partial) match object. | ||
372 | * | ||
373 | */ | ||
374 | public CubeSatWithKaAntenna.Match newMatch(final Spacecraft pSpacecraft) { | ||
375 | return CubeSatWithKaAntenna.Match.newMatch(pSpacecraft); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
380 | * @return the Set of all values or empty set if there are no matches | ||
381 | * | ||
382 | */ | ||
383 | protected Stream<Spacecraft> rawStreamAllValuesOfSpacecraft(final Object[] parameters) { | ||
384 | return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
389 | * @return the Set of all values or empty set if there are no matches | ||
390 | * | ||
391 | */ | ||
392 | public Set<Spacecraft> getAllValuesOfSpacecraft() { | ||
393 | return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet()); | ||
394 | } | ||
395 | |||
396 | /** | ||
397 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
398 | * @return the Set of all values or empty set if there are no matches | ||
399 | * | ||
400 | */ | ||
401 | public Stream<Spacecraft> streamAllValuesOfSpacecraft() { | ||
402 | return rawStreamAllValuesOfSpacecraft(emptyArray()); | ||
403 | } | ||
404 | |||
405 | @Override | ||
406 | protected CubeSatWithKaAntenna.Match tupleToMatch(final Tuple t) { | ||
407 | try { | ||
408 | return CubeSatWithKaAntenna.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT)); | ||
409 | } catch(ClassCastException e) { | ||
410 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
411 | return null; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | @Override | ||
416 | protected CubeSatWithKaAntenna.Match arrayToMatch(final Object[] match) { | ||
417 | try { | ||
418 | return CubeSatWithKaAntenna.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
419 | } catch(ClassCastException e) { | ||
420 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
421 | return null; | ||
422 | } | ||
423 | } | ||
424 | |||
425 | @Override | ||
426 | protected CubeSatWithKaAntenna.Match arrayToMatchMutable(final Object[] match) { | ||
427 | try { | ||
428 | return CubeSatWithKaAntenna.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
429 | } catch(ClassCastException e) { | ||
430 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
431 | return null; | ||
432 | } | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * @return the singleton instance of the query specification of this pattern | ||
437 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
438 | * | ||
439 | */ | ||
440 | public static IQuerySpecification<CubeSatWithKaAntenna.Matcher> querySpecification() { | ||
441 | return CubeSatWithKaAntenna.instance(); | ||
442 | } | ||
443 | } | ||
444 | |||
445 | private CubeSatWithKaAntenna() { | ||
446 | super(GeneratedPQuery.INSTANCE); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * @return the singleton instance of the query specification | ||
451 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
452 | * | ||
453 | */ | ||
454 | public static CubeSatWithKaAntenna instance() { | ||
455 | try{ | ||
456 | return LazyHolder.INSTANCE; | ||
457 | } catch (ExceptionInInitializerError err) { | ||
458 | throw processInitializerError(err); | ||
459 | } | ||
460 | } | ||
461 | |||
462 | @Override | ||
463 | protected CubeSatWithKaAntenna.Matcher instantiate(final ViatraQueryEngine engine) { | ||
464 | return CubeSatWithKaAntenna.Matcher.on(engine); | ||
465 | } | ||
466 | |||
467 | @Override | ||
468 | public CubeSatWithKaAntenna.Matcher instantiate() { | ||
469 | return CubeSatWithKaAntenna.Matcher.create(); | ||
470 | } | ||
471 | |||
472 | @Override | ||
473 | public CubeSatWithKaAntenna.Match newEmptyMatch() { | ||
474 | return CubeSatWithKaAntenna.Match.newEmptyMatch(); | ||
475 | } | ||
476 | |||
477 | @Override | ||
478 | public CubeSatWithKaAntenna.Match newMatch(final Object... parameters) { | ||
479 | return CubeSatWithKaAntenna.Match.newMatch((satellite.Spacecraft) parameters[0]); | ||
480 | } | ||
481 | |||
482 | /** | ||
483 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna (visibility: PUBLIC, simpleName: CubeSatWithKaAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
484 | * <b>not</b> at the class load time of the outer class, | ||
485 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna (visibility: PUBLIC, simpleName: CubeSatWithKaAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
486 | * | ||
487 | * <p> This workaround is required e.g. to support recursion. | ||
488 | * | ||
489 | */ | ||
490 | private static class LazyHolder { | ||
491 | private static final CubeSatWithKaAntenna INSTANCE = new CubeSatWithKaAntenna(); | ||
492 | |||
493 | /** | ||
494 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
495 | * This initialization order is required to support indirect recursion. | ||
496 | * | ||
497 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
498 | * | ||
499 | */ | ||
500 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
501 | |||
502 | public static Object ensureInitialized() { | ||
503 | INSTANCE.ensureInitializedInternal(); | ||
504 | return null; | ||
505 | } | ||
506 | } | ||
507 | |||
508 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
509 | private static final CubeSatWithKaAntenna.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
510 | |||
511 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
512 | |||
513 | private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft); | ||
514 | |||
515 | private GeneratedPQuery() { | ||
516 | super(PVisibility.PUBLIC); | ||
517 | } | ||
518 | |||
519 | @Override | ||
520 | public String getFullyQualifiedName() { | ||
521 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna"; | ||
522 | } | ||
523 | |||
524 | @Override | ||
525 | public List<String> getParameterNames() { | ||
526 | return Arrays.asList("Spacecraft"); | ||
527 | } | ||
528 | |||
529 | @Override | ||
530 | public List<PParameter> getParameters() { | ||
531 | return parameters; | ||
532 | } | ||
533 | |||
534 | @Override | ||
535 | public Set<PBody> doGetContainedBodies() { | ||
536 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
537 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
538 | { | ||
539 | PBody body = new PBody(this); | ||
540 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
541 | PVariable var_Comm = body.getOrCreateVariableByName("Comm"); | ||
542 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
543 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
544 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft) | ||
545 | )); | ||
546 | // CommunicatingElement.commSubsystem(Spacecraft, Comm) | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
548 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
549 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
551 | new Equality(body, var__virtual_0_, var_Comm); | ||
552 | // KaCommSubsystem(Comm) | ||
553 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "KaCommSubsystem"))); | ||
554 | // neg find smallSat(Spacecraft) | ||
555 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SmallSat.instance().getInternalQueryRepresentation()); | ||
556 | bodies.add(body); | ||
557 | } | ||
558 | { | ||
559 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
560 | annotation.addAttribute("severity", "error"); | ||
561 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
562 | new ParameterReference("Spacecraft") | ||
563 | })); | ||
564 | annotation.addAttribute("message", "Only a Small Satellite can be configured with a Ka-band communication system."); | ||
565 | addAnnotation(annotation); | ||
566 | } | ||
567 | return bodies; | ||
568 | } | ||
569 | } | ||
570 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java deleted file mode 100644 index af53fc9f..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java +++ /dev/null | |||
@@ -1,566 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
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.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
43 | import satellite.CommSubsystem; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * // Source and target communication systems must be compatible. | ||
51 | * | ||
52 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, | ||
53 | * message = "Two ends of a communication link must use the same band.") | ||
54 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { | ||
55 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); | ||
56 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | ||
57 | * } | ||
58 | * </pre></code> | ||
59 | * | ||
60 | * @see Matcher | ||
61 | * @see Match | ||
62 | * | ||
63 | */ | ||
64 | @SuppressWarnings("all") | ||
65 | public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuerySpecification<IncompatibleSourceAndTargetBand.Matcher> { | ||
66 | /** | ||
67 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand 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 CommSubsystem fSourceSubsystem; | ||
80 | |||
81 | private static List<String> parameterNames = makeImmutableList("SourceSubsystem"); | ||
82 | |||
83 | private Match(final CommSubsystem pSourceSubsystem) { | ||
84 | this.fSourceSubsystem = pSourceSubsystem; | ||
85 | } | ||
86 | |||
87 | @Override | ||
88 | public Object get(final String parameterName) { | ||
89 | if ("SourceSubsystem".equals(parameterName)) return this.fSourceSubsystem; | ||
90 | return null; | ||
91 | } | ||
92 | |||
93 | public CommSubsystem getSourceSubsystem() { | ||
94 | return this.fSourceSubsystem; | ||
95 | } | ||
96 | |||
97 | @Override | ||
98 | public boolean set(final String parameterName, final Object newValue) { | ||
99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
100 | if ("SourceSubsystem".equals(parameterName) ) { | ||
101 | this.fSourceSubsystem = (CommSubsystem) newValue; | ||
102 | return true; | ||
103 | } | ||
104 | return false; | ||
105 | } | ||
106 | |||
107 | public void setSourceSubsystem(final CommSubsystem pSourceSubsystem) { | ||
108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
109 | this.fSourceSubsystem = pSourceSubsystem; | ||
110 | } | ||
111 | |||
112 | @Override | ||
113 | public String patternName() { | ||
114 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand"; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public List<String> parameterNames() { | ||
119 | return IncompatibleSourceAndTargetBand.Match.parameterNames; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public Object[] toArray() { | ||
124 | return new Object[]{fSourceSubsystem}; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public IncompatibleSourceAndTargetBand.Match toImmutable() { | ||
129 | return isMutable() ? newMatch(fSourceSubsystem) : this; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public String prettyPrint() { | ||
134 | StringBuilder result = new StringBuilder(); | ||
135 | result.append("\"SourceSubsystem\"=" + prettyPrintValue(fSourceSubsystem)); | ||
136 | return result.toString(); | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public int hashCode() { | ||
141 | return Objects.hash(fSourceSubsystem); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public boolean equals(final Object obj) { | ||
146 | if (this == obj) | ||
147 | return true; | ||
148 | if (obj == null) { | ||
149 | return false; | ||
150 | } | ||
151 | if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) { | ||
152 | IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj; | ||
153 | return Objects.equals(fSourceSubsystem, other.fSourceSubsystem); | ||
154 | } else { | ||
155 | // this should be infrequent | ||
156 | if (!(obj instanceof IPatternMatch)) { | ||
157 | return false; | ||
158 | } | ||
159 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
160 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | @Override | ||
165 | public IncompatibleSourceAndTargetBand specification() { | ||
166 | return IncompatibleSourceAndTargetBand.instance(); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * Returns an empty, mutable match. | ||
171 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
172 | * | ||
173 | * @return the empty match. | ||
174 | * | ||
175 | */ | ||
176 | public static IncompatibleSourceAndTargetBand.Match newEmptyMatch() { | ||
177 | return new Mutable(null); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns a mutable (partial) match. | ||
182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
183 | * | ||
184 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
185 | * @return the new, mutable (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final CommSubsystem pSourceSubsystem) { | ||
189 | return new Mutable(pSourceSubsystem); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns a new (partial) match. | ||
194 | * This can be used e.g. to call the matcher with a partial match. | ||
195 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
196 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
197 | * @return the (partial) match object. | ||
198 | * | ||
199 | */ | ||
200 | public static IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { | ||
201 | return new Immutable(pSourceSubsystem); | ||
202 | } | ||
203 | |||
204 | private static final class Mutable extends IncompatibleSourceAndTargetBand.Match { | ||
205 | Mutable(final CommSubsystem pSourceSubsystem) { | ||
206 | super(pSourceSubsystem); | ||
207 | } | ||
208 | |||
209 | @Override | ||
210 | public boolean isMutable() { | ||
211 | return true; | ||
212 | } | ||
213 | } | ||
214 | |||
215 | private static final class Immutable extends IncompatibleSourceAndTargetBand.Match { | ||
216 | Immutable(final CommSubsystem pSourceSubsystem) { | ||
217 | super(pSourceSubsystem); | ||
218 | } | ||
219 | |||
220 | @Override | ||
221 | public boolean isMutable() { | ||
222 | return false; | ||
223 | } | ||
224 | } | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand pattern, | ||
229 | * providing pattern-specific query methods. | ||
230 | * | ||
231 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
232 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
233 | * | ||
234 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
235 | * | ||
236 | * <p>Original source: | ||
237 | * <code><pre> | ||
238 | * // Source and target communication systems must be compatible. | ||
239 | * | ||
240 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, | ||
241 | * message = "Two ends of a communication link must use the same band.") | ||
242 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { | ||
243 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); | ||
244 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | ||
245 | * } | ||
246 | * </pre></code> | ||
247 | * | ||
248 | * @see Match | ||
249 | * @see IncompatibleSourceAndTargetBand | ||
250 | * | ||
251 | */ | ||
252 | public static class Matcher extends BaseMatcher<IncompatibleSourceAndTargetBand.Match> { | ||
253 | /** | ||
254 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
255 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
256 | * | ||
257 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
258 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
259 | * | ||
260 | */ | ||
261 | public static IncompatibleSourceAndTargetBand.Matcher on(final ViatraQueryEngine engine) { | ||
262 | // check if matcher already exists | ||
263 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
264 | if (matcher == null) { | ||
265 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
266 | } | ||
267 | return matcher; | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * @return an initialized matcher | ||
273 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
274 | * | ||
275 | */ | ||
276 | public static IncompatibleSourceAndTargetBand.Matcher create() { | ||
277 | return new Matcher(); | ||
278 | } | ||
279 | |||
280 | private static final int POSITION_SOURCESUBSYSTEM = 0; | ||
281 | |||
282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class); | ||
283 | |||
284 | /** | ||
285 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
286 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
287 | * | ||
288 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * | ||
291 | */ | ||
292 | private Matcher() { | ||
293 | super(querySpecification()); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
298 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
299 | * @return matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Collection<IncompatibleSourceAndTargetBand.Match> getAllMatches(final CommSubsystem pSourceSubsystem) { | ||
303 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}).collect(Collectors.toSet()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
308 | * </p> | ||
309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
312 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
313 | * @return a stream of matches represented as a Match object. | ||
314 | * | ||
315 | */ | ||
316 | public Stream<IncompatibleSourceAndTargetBand.Match> streamAllMatches(final CommSubsystem pSourceSubsystem) { | ||
317 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
322 | * Neither determinism nor randomness of selection is guaranteed. | ||
323 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
324 | * @return a match represented as a Match object, or null if no match is found. | ||
325 | * | ||
326 | */ | ||
327 | public Optional<IncompatibleSourceAndTargetBand.Match> getOneArbitraryMatch(final CommSubsystem pSourceSubsystem) { | ||
328 | return rawGetOneArbitraryMatch(new Object[]{pSourceSubsystem}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
333 | * under any possible substitution of the unspecified parameters (if any). | ||
334 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
335 | * @return true if the input is a valid (partial) match of the pattern. | ||
336 | * | ||
337 | */ | ||
338 | public boolean hasMatch(final CommSubsystem pSourceSubsystem) { | ||
339 | return rawHasMatch(new Object[]{pSourceSubsystem}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
345 | * @return the number of pattern matches found. | ||
346 | * | ||
347 | */ | ||
348 | public int countMatches(final CommSubsystem pSourceSubsystem) { | ||
349 | return rawCountMatches(new Object[]{pSourceSubsystem}); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
354 | * Neither determinism nor randomness of selection is guaranteed. | ||
355 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
356 | * @param processor the action that will process the selected match. | ||
357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
358 | * | ||
359 | */ | ||
360 | public boolean forOneArbitraryMatch(final CommSubsystem pSourceSubsystem, final Consumer<? super IncompatibleSourceAndTargetBand.Match> processor) { | ||
361 | return rawForOneArbitraryMatch(new Object[]{pSourceSubsystem}, processor); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Returns a new (partial) match. | ||
366 | * This can be used e.g. to call the matcher with a partial match. | ||
367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
368 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. | ||
369 | * @return the (partial) match object. | ||
370 | * | ||
371 | */ | ||
372 | public IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { | ||
373 | return IncompatibleSourceAndTargetBand.Match.newMatch(pSourceSubsystem); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for SourceSubsystem. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | protected Stream<CommSubsystem> rawStreamAllValuesOfSourceSubsystem(final Object[] parameters) { | ||
382 | return rawStreamAllValues(POSITION_SOURCESUBSYSTEM, parameters).map(CommSubsystem.class::cast); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for SourceSubsystem. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Set<CommSubsystem> getAllValuesOfSourceSubsystem() { | ||
391 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()).collect(Collectors.toSet()); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for SourceSubsystem. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Stream<CommSubsystem> streamAllValuesOfSourceSubsystem() { | ||
400 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()); | ||
401 | } | ||
402 | |||
403 | @Override | ||
404 | protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) { | ||
405 | try { | ||
406 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) t.get(POSITION_SOURCESUBSYSTEM)); | ||
407 | } catch(ClassCastException e) { | ||
408 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
409 | return null; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | @Override | ||
414 | protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) { | ||
415 | try { | ||
416 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); | ||
417 | } catch(ClassCastException e) { | ||
418 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
419 | return null; | ||
420 | } | ||
421 | } | ||
422 | |||
423 | @Override | ||
424 | protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) { | ||
425 | try { | ||
426 | return IncompatibleSourceAndTargetBand.Match.newMutableMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); | ||
427 | } catch(ClassCastException e) { | ||
428 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
429 | return null; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * @return the singleton instance of the query specification of this pattern | ||
435 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
436 | * | ||
437 | */ | ||
438 | public static IQuerySpecification<IncompatibleSourceAndTargetBand.Matcher> querySpecification() { | ||
439 | return IncompatibleSourceAndTargetBand.instance(); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | private IncompatibleSourceAndTargetBand() { | ||
444 | super(GeneratedPQuery.INSTANCE); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * @return the singleton instance of the query specification | ||
449 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
450 | * | ||
451 | */ | ||
452 | public static IncompatibleSourceAndTargetBand instance() { | ||
453 | try{ | ||
454 | return LazyHolder.INSTANCE; | ||
455 | } catch (ExceptionInInitializerError err) { | ||
456 | throw processInitializerError(err); | ||
457 | } | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | protected IncompatibleSourceAndTargetBand.Matcher instantiate(final ViatraQueryEngine engine) { | ||
462 | return IncompatibleSourceAndTargetBand.Matcher.on(engine); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public IncompatibleSourceAndTargetBand.Matcher instantiate() { | ||
467 | return IncompatibleSourceAndTargetBand.Matcher.create(); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public IncompatibleSourceAndTargetBand.Match newEmptyMatch() { | ||
472 | return IncompatibleSourceAndTargetBand.Match.newEmptyMatch(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { | ||
477 | return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.CommSubsystem) parameters[0]); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand (visibility: PUBLIC, simpleName: IncompatibleSourceAndTargetBand, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
482 | * <b>not</b> at the class load time of the outer class, | ||
483 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand (visibility: PUBLIC, simpleName: IncompatibleSourceAndTargetBand, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
484 | * | ||
485 | * <p> This workaround is required e.g. to support recursion. | ||
486 | * | ||
487 | */ | ||
488 | private static class LazyHolder { | ||
489 | private static final IncompatibleSourceAndTargetBand INSTANCE = new IncompatibleSourceAndTargetBand(); | ||
490 | |||
491 | /** | ||
492 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
493 | * This initialization order is required to support indirect recursion. | ||
494 | * | ||
495 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
496 | * | ||
497 | */ | ||
498 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
499 | |||
500 | public static Object ensureInitialized() { | ||
501 | INSTANCE.ensureInitializedInternal(); | ||
502 | return null; | ||
503 | } | ||
504 | } | ||
505 | |||
506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
507 | private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
508 | |||
509 | private final PParameter parameter_SourceSubsystem = new PParameter("SourceSubsystem", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); | ||
510 | |||
511 | private final List<PParameter> parameters = Arrays.asList(parameter_SourceSubsystem); | ||
512 | |||
513 | private GeneratedPQuery() { | ||
514 | super(PVisibility.PUBLIC); | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public String getFullyQualifiedName() { | ||
519 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand"; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public List<String> getParameterNames() { | ||
524 | return Arrays.asList("SourceSubsystem"); | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<PParameter> getParameters() { | ||
529 | return parameters; | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public Set<PBody> doGetContainedBodies() { | ||
534 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
535 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
536 | { | ||
537 | PBody body = new PBody(this); | ||
538 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | ||
539 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | ||
540 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
542 | new ExportedParameter(body, var_SourceSubsystem, parameter_SourceSubsystem) | ||
543 | )); | ||
544 | // CommSubsystem.target(SourceSubsystem, TargetSubsystem) | ||
545 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
546 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); | ||
548 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
549 | new Equality(body, var__virtual_0_, var_TargetSubsystem); | ||
550 | // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem) | ||
551 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); | ||
552 | bodies.add(body); | ||
553 | } | ||
554 | { | ||
555 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
556 | annotation.addAttribute("severity", "error"); | ||
557 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
558 | new ParameterReference("SourceSubsystem") | ||
559 | })); | ||
560 | annotation.addAttribute("message", "Two ends of a communication link must use the same band."); | ||
561 | addAnnotation(annotation); | ||
562 | } | ||
563 | return bodies; | ||
564 | } | ||
565 | } | ||
566 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java deleted file mode 100644 index 45952f33..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java +++ /dev/null | |||
@@ -1,575 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
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.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
43 | import satellite.Spacecraft; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * // All spacecraft must have some communication path to the ground station | ||
51 | * | ||
52 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
53 | * message = "Spacecraft has no communication path to the ground station.") | ||
54 | * pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | ||
55 | * ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
56 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
57 | * neg find indirectCommunicationLink(Spacecraft, GroundStation); | ||
58 | * } | ||
59 | * </pre></code> | ||
60 | * | ||
61 | * @see Matcher | ||
62 | * @see Match | ||
63 | * | ||
64 | */ | ||
65 | @SuppressWarnings("all") | ||
66 | public final class NoLinkToGroundStation extends BaseGeneratedEMFQuerySpecification<NoLinkToGroundStation.Matcher> { | ||
67 | /** | ||
68 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation pattern, | ||
69 | * to be used in conjunction with {@link Matcher}. | ||
70 | * | ||
71 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
72 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
73 | * usable to represent a match of the pattern in the result of a query, | ||
74 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
75 | * | ||
76 | * @see Matcher | ||
77 | * | ||
78 | */ | ||
79 | public static abstract class Match extends BasePatternMatch { | ||
80 | private Spacecraft fSpacecraft; | ||
81 | |||
82 | private static List<String> parameterNames = makeImmutableList("Spacecraft"); | ||
83 | |||
84 | private Match(final Spacecraft pSpacecraft) { | ||
85 | this.fSpacecraft = pSpacecraft; | ||
86 | } | ||
87 | |||
88 | @Override | ||
89 | public Object get(final String parameterName) { | ||
90 | if ("Spacecraft".equals(parameterName)) return this.fSpacecraft; | ||
91 | return null; | ||
92 | } | ||
93 | |||
94 | public Spacecraft getSpacecraft() { | ||
95 | return this.fSpacecraft; | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public boolean set(final String parameterName, final Object newValue) { | ||
100 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
101 | if ("Spacecraft".equals(parameterName) ) { | ||
102 | this.fSpacecraft = (Spacecraft) newValue; | ||
103 | return true; | ||
104 | } | ||
105 | return false; | ||
106 | } | ||
107 | |||
108 | public void setSpacecraft(final Spacecraft pSpacecraft) { | ||
109 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
110 | this.fSpacecraft = pSpacecraft; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public String patternName() { | ||
115 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation"; | ||
116 | } | ||
117 | |||
118 | @Override | ||
119 | public List<String> parameterNames() { | ||
120 | return NoLinkToGroundStation.Match.parameterNames; | ||
121 | } | ||
122 | |||
123 | @Override | ||
124 | public Object[] toArray() { | ||
125 | return new Object[]{fSpacecraft}; | ||
126 | } | ||
127 | |||
128 | @Override | ||
129 | public NoLinkToGroundStation.Match toImmutable() { | ||
130 | return isMutable() ? newMatch(fSpacecraft) : this; | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public String prettyPrint() { | ||
135 | StringBuilder result = new StringBuilder(); | ||
136 | result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft)); | ||
137 | return result.toString(); | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public int hashCode() { | ||
142 | return Objects.hash(fSpacecraft); | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public boolean equals(final Object obj) { | ||
147 | if (this == obj) | ||
148 | return true; | ||
149 | if (obj == null) { | ||
150 | return false; | ||
151 | } | ||
152 | if ((obj instanceof NoLinkToGroundStation.Match)) { | ||
153 | NoLinkToGroundStation.Match other = (NoLinkToGroundStation.Match) obj; | ||
154 | return Objects.equals(fSpacecraft, other.fSpacecraft); | ||
155 | } else { | ||
156 | // this should be infrequent | ||
157 | if (!(obj instanceof IPatternMatch)) { | ||
158 | return false; | ||
159 | } | ||
160 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
161 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | @Override | ||
166 | public NoLinkToGroundStation specification() { | ||
167 | return NoLinkToGroundStation.instance(); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * Returns an empty, mutable match. | ||
172 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
173 | * | ||
174 | * @return the empty match. | ||
175 | * | ||
176 | */ | ||
177 | public static NoLinkToGroundStation.Match newEmptyMatch() { | ||
178 | return new Mutable(null); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * Returns a mutable (partial) match. | ||
183 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
184 | * | ||
185 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
186 | * @return the new, mutable (partial) match object. | ||
187 | * | ||
188 | */ | ||
189 | public static NoLinkToGroundStation.Match newMutableMatch(final Spacecraft pSpacecraft) { | ||
190 | return new Mutable(pSpacecraft); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * Returns a new (partial) match. | ||
195 | * This can be used e.g. to call the matcher with a partial match. | ||
196 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
197 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
198 | * @return the (partial) match object. | ||
199 | * | ||
200 | */ | ||
201 | public static NoLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) { | ||
202 | return new Immutable(pSpacecraft); | ||
203 | } | ||
204 | |||
205 | private static final class Mutable extends NoLinkToGroundStation.Match { | ||
206 | Mutable(final Spacecraft pSpacecraft) { | ||
207 | super(pSpacecraft); | ||
208 | } | ||
209 | |||
210 | @Override | ||
211 | public boolean isMutable() { | ||
212 | return true; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | private static final class Immutable extends NoLinkToGroundStation.Match { | ||
217 | Immutable(final Spacecraft pSpacecraft) { | ||
218 | super(pSpacecraft); | ||
219 | } | ||
220 | |||
221 | @Override | ||
222 | public boolean isMutable() { | ||
223 | return false; | ||
224 | } | ||
225 | } | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation pattern, | ||
230 | * providing pattern-specific query methods. | ||
231 | * | ||
232 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
233 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
234 | * | ||
235 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
236 | * | ||
237 | * <p>Original source: | ||
238 | * <code><pre> | ||
239 | * // All spacecraft must have some communication path to the ground station | ||
240 | * | ||
241 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
242 | * message = "Spacecraft has no communication path to the ground station.") | ||
243 | * pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | ||
244 | * ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
245 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
246 | * neg find indirectCommunicationLink(Spacecraft, GroundStation); | ||
247 | * } | ||
248 | * </pre></code> | ||
249 | * | ||
250 | * @see Match | ||
251 | * @see NoLinkToGroundStation | ||
252 | * | ||
253 | */ | ||
254 | public static class Matcher extends BaseMatcher<NoLinkToGroundStation.Match> { | ||
255 | /** | ||
256 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
257 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
258 | * | ||
259 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
260 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
261 | * | ||
262 | */ | ||
263 | public static NoLinkToGroundStation.Matcher on(final ViatraQueryEngine engine) { | ||
264 | // check if matcher already exists | ||
265 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
266 | if (matcher == null) { | ||
267 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
268 | } | ||
269 | return matcher; | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
274 | * @return an initialized matcher | ||
275 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
276 | * | ||
277 | */ | ||
278 | public static NoLinkToGroundStation.Matcher create() { | ||
279 | return new Matcher(); | ||
280 | } | ||
281 | |||
282 | private static final int POSITION_SPACECRAFT = 0; | ||
283 | |||
284 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NoLinkToGroundStation.Matcher.class); | ||
285 | |||
286 | /** | ||
287 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
288 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
289 | * | ||
290 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
291 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
292 | * | ||
293 | */ | ||
294 | private Matcher() { | ||
295 | super(querySpecification()); | ||
296 | } | ||
297 | |||
298 | /** | ||
299 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
300 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
301 | * @return matches represented as a Match object. | ||
302 | * | ||
303 | */ | ||
304 | public Collection<NoLinkToGroundStation.Match> getAllMatches(final Spacecraft pSpacecraft) { | ||
305 | return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet()); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
310 | * </p> | ||
311 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
312 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
313 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
314 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
315 | * @return a stream of matches represented as a Match object. | ||
316 | * | ||
317 | */ | ||
318 | public Stream<NoLinkToGroundStation.Match> streamAllMatches(final Spacecraft pSpacecraft) { | ||
319 | return rawStreamAllMatches(new Object[]{pSpacecraft}); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
324 | * Neither determinism nor randomness of selection is guaranteed. | ||
325 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
326 | * @return a match represented as a Match object, or null if no match is found. | ||
327 | * | ||
328 | */ | ||
329 | public Optional<NoLinkToGroundStation.Match> getOneArbitraryMatch(final Spacecraft pSpacecraft) { | ||
330 | return rawGetOneArbitraryMatch(new Object[]{pSpacecraft}); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
335 | * under any possible substitution of the unspecified parameters (if any). | ||
336 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
337 | * @return true if the input is a valid (partial) match of the pattern. | ||
338 | * | ||
339 | */ | ||
340 | public boolean hasMatch(final Spacecraft pSpacecraft) { | ||
341 | return rawHasMatch(new Object[]{pSpacecraft}); | ||
342 | } | ||
343 | |||
344 | /** | ||
345 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
346 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
347 | * @return the number of pattern matches found. | ||
348 | * | ||
349 | */ | ||
350 | public int countMatches(final Spacecraft pSpacecraft) { | ||
351 | return rawCountMatches(new Object[]{pSpacecraft}); | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
356 | * Neither determinism nor randomness of selection is guaranteed. | ||
357 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
358 | * @param processor the action that will process the selected match. | ||
359 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
360 | * | ||
361 | */ | ||
362 | public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer<? super NoLinkToGroundStation.Match> processor) { | ||
363 | return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Returns a new (partial) match. | ||
368 | * This can be used e.g. to call the matcher with a partial match. | ||
369 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
370 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
371 | * @return the (partial) match object. | ||
372 | * | ||
373 | */ | ||
374 | public NoLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) { | ||
375 | return NoLinkToGroundStation.Match.newMatch(pSpacecraft); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
380 | * @return the Set of all values or empty set if there are no matches | ||
381 | * | ||
382 | */ | ||
383 | protected Stream<Spacecraft> rawStreamAllValuesOfSpacecraft(final Object[] parameters) { | ||
384 | return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
389 | * @return the Set of all values or empty set if there are no matches | ||
390 | * | ||
391 | */ | ||
392 | public Set<Spacecraft> getAllValuesOfSpacecraft() { | ||
393 | return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet()); | ||
394 | } | ||
395 | |||
396 | /** | ||
397 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
398 | * @return the Set of all values or empty set if there are no matches | ||
399 | * | ||
400 | */ | ||
401 | public Stream<Spacecraft> streamAllValuesOfSpacecraft() { | ||
402 | return rawStreamAllValuesOfSpacecraft(emptyArray()); | ||
403 | } | ||
404 | |||
405 | @Override | ||
406 | protected NoLinkToGroundStation.Match tupleToMatch(final Tuple t) { | ||
407 | try { | ||
408 | return NoLinkToGroundStation.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT)); | ||
409 | } catch(ClassCastException e) { | ||
410 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
411 | return null; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | @Override | ||
416 | protected NoLinkToGroundStation.Match arrayToMatch(final Object[] match) { | ||
417 | try { | ||
418 | return NoLinkToGroundStation.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
419 | } catch(ClassCastException e) { | ||
420 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
421 | return null; | ||
422 | } | ||
423 | } | ||
424 | |||
425 | @Override | ||
426 | protected NoLinkToGroundStation.Match arrayToMatchMutable(final Object[] match) { | ||
427 | try { | ||
428 | return NoLinkToGroundStation.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
429 | } catch(ClassCastException e) { | ||
430 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
431 | return null; | ||
432 | } | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * @return the singleton instance of the query specification of this pattern | ||
437 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
438 | * | ||
439 | */ | ||
440 | public static IQuerySpecification<NoLinkToGroundStation.Matcher> querySpecification() { | ||
441 | return NoLinkToGroundStation.instance(); | ||
442 | } | ||
443 | } | ||
444 | |||
445 | private NoLinkToGroundStation() { | ||
446 | super(GeneratedPQuery.INSTANCE); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * @return the singleton instance of the query specification | ||
451 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
452 | * | ||
453 | */ | ||
454 | public static NoLinkToGroundStation instance() { | ||
455 | try{ | ||
456 | return LazyHolder.INSTANCE; | ||
457 | } catch (ExceptionInInitializerError err) { | ||
458 | throw processInitializerError(err); | ||
459 | } | ||
460 | } | ||
461 | |||
462 | @Override | ||
463 | protected NoLinkToGroundStation.Matcher instantiate(final ViatraQueryEngine engine) { | ||
464 | return NoLinkToGroundStation.Matcher.on(engine); | ||
465 | } | ||
466 | |||
467 | @Override | ||
468 | public NoLinkToGroundStation.Matcher instantiate() { | ||
469 | return NoLinkToGroundStation.Matcher.create(); | ||
470 | } | ||
471 | |||
472 | @Override | ||
473 | public NoLinkToGroundStation.Match newEmptyMatch() { | ||
474 | return NoLinkToGroundStation.Match.newEmptyMatch(); | ||
475 | } | ||
476 | |||
477 | @Override | ||
478 | public NoLinkToGroundStation.Match newMatch(final Object... parameters) { | ||
479 | return NoLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]); | ||
480 | } | ||
481 | |||
482 | /** | ||
483 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation (visibility: PUBLIC, simpleName: NoLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
484 | * <b>not</b> at the class load time of the outer class, | ||
485 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation (visibility: PUBLIC, simpleName: NoLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
486 | * | ||
487 | * <p> This workaround is required e.g. to support recursion. | ||
488 | * | ||
489 | */ | ||
490 | private static class LazyHolder { | ||
491 | private static final NoLinkToGroundStation INSTANCE = new NoLinkToGroundStation(); | ||
492 | |||
493 | /** | ||
494 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
495 | * This initialization order is required to support indirect recursion. | ||
496 | * | ||
497 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
498 | * | ||
499 | */ | ||
500 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
501 | |||
502 | public static Object ensureInitialized() { | ||
503 | INSTANCE.ensureInitializedInternal(); | ||
504 | return null; | ||
505 | } | ||
506 | } | ||
507 | |||
508 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
509 | private static final NoLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
510 | |||
511 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
512 | |||
513 | private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft); | ||
514 | |||
515 | private GeneratedPQuery() { | ||
516 | super(PVisibility.PUBLIC); | ||
517 | } | ||
518 | |||
519 | @Override | ||
520 | public String getFullyQualifiedName() { | ||
521 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation"; | ||
522 | } | ||
523 | |||
524 | @Override | ||
525 | public List<String> getParameterNames() { | ||
526 | return Arrays.asList("Spacecraft"); | ||
527 | } | ||
528 | |||
529 | @Override | ||
530 | public List<PParameter> getParameters() { | ||
531 | return parameters; | ||
532 | } | ||
533 | |||
534 | @Override | ||
535 | public Set<PBody> doGetContainedBodies() { | ||
536 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
537 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
538 | { | ||
539 | PBody body = new PBody(this); | ||
540 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
541 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
542 | PVariable var_GroundStation = body.getOrCreateVariableByName("GroundStation"); | ||
543 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
544 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
545 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft) | ||
546 | )); | ||
547 | // ConstellationMission.groundStationNetwork(Mission, GroundStation) | ||
548 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
549 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "groundStationNetwork"))); | ||
551 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork"))); | ||
552 | new Equality(body, var__virtual_0_, var_GroundStation); | ||
553 | // ConstellationMission.spacecraft(Mission, Spacecraft) | ||
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
555 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft"))); | ||
557 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
558 | new Equality(body, var__virtual_1_, var_Spacecraft); | ||
559 | // neg find indirectCommunicationLink(Spacecraft, GroundStation) | ||
560 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_GroundStation), IndirectCommunicationLink.instance().getInternalQueryRepresentation()); | ||
561 | bodies.add(body); | ||
562 | } | ||
563 | { | ||
564 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
565 | annotation.addAttribute("severity", "error"); | ||
566 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
567 | new ParameterReference("Spacecraft") | ||
568 | })); | ||
569 | annotation.addAttribute("message", "Spacecraft has no communication path to the ground station."); | ||
570 | addAnnotation(annotation); | ||
571 | } | ||
572 | return bodies; | ||
573 | } | ||
574 | } | ||
575 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java deleted file mode 100644 index 3366de46..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java +++ /dev/null | |||
@@ -1,571 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
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.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
43 | import satellite.Spacecraft; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
51 | * message = "Spacecraft has no potential communication path to the ground station.") | ||
52 | * pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { | ||
53 | * ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
54 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
55 | * neg find indirectLinkAllowed(Spacecraft, GroundStation); | ||
56 | * } | ||
57 | * </pre></code> | ||
58 | * | ||
59 | * @see Matcher | ||
60 | * @see Match | ||
61 | * | ||
62 | */ | ||
63 | @SuppressWarnings("all") | ||
64 | public final class NoPotentialLinkToGroundStation extends BaseGeneratedEMFQuerySpecification<NoPotentialLinkToGroundStation.Matcher> { | ||
65 | /** | ||
66 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation pattern, | ||
67 | * to be used in conjunction with {@link Matcher}. | ||
68 | * | ||
69 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
70 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
71 | * usable to represent a match of the pattern in the result of a query, | ||
72 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
73 | * | ||
74 | * @see Matcher | ||
75 | * | ||
76 | */ | ||
77 | public static abstract class Match extends BasePatternMatch { | ||
78 | private Spacecraft fSpacecraft; | ||
79 | |||
80 | private static List<String> parameterNames = makeImmutableList("Spacecraft"); | ||
81 | |||
82 | private Match(final Spacecraft pSpacecraft) { | ||
83 | this.fSpacecraft = pSpacecraft; | ||
84 | } | ||
85 | |||
86 | @Override | ||
87 | public Object get(final String parameterName) { | ||
88 | if ("Spacecraft".equals(parameterName)) return this.fSpacecraft; | ||
89 | return null; | ||
90 | } | ||
91 | |||
92 | public Spacecraft getSpacecraft() { | ||
93 | return this.fSpacecraft; | ||
94 | } | ||
95 | |||
96 | @Override | ||
97 | public boolean set(final String parameterName, final Object newValue) { | ||
98 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
99 | if ("Spacecraft".equals(parameterName) ) { | ||
100 | this.fSpacecraft = (Spacecraft) newValue; | ||
101 | return true; | ||
102 | } | ||
103 | return false; | ||
104 | } | ||
105 | |||
106 | public void setSpacecraft(final Spacecraft pSpacecraft) { | ||
107 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
108 | this.fSpacecraft = pSpacecraft; | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public String patternName() { | ||
113 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation"; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public List<String> parameterNames() { | ||
118 | return NoPotentialLinkToGroundStation.Match.parameterNames; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public Object[] toArray() { | ||
123 | return new Object[]{fSpacecraft}; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public NoPotentialLinkToGroundStation.Match toImmutable() { | ||
128 | return isMutable() ? newMatch(fSpacecraft) : this; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public String prettyPrint() { | ||
133 | StringBuilder result = new StringBuilder(); | ||
134 | result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft)); | ||
135 | return result.toString(); | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public int hashCode() { | ||
140 | return Objects.hash(fSpacecraft); | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public boolean equals(final Object obj) { | ||
145 | if (this == obj) | ||
146 | return true; | ||
147 | if (obj == null) { | ||
148 | return false; | ||
149 | } | ||
150 | if ((obj instanceof NoPotentialLinkToGroundStation.Match)) { | ||
151 | NoPotentialLinkToGroundStation.Match other = (NoPotentialLinkToGroundStation.Match) obj; | ||
152 | return Objects.equals(fSpacecraft, other.fSpacecraft); | ||
153 | } else { | ||
154 | // this should be infrequent | ||
155 | if (!(obj instanceof IPatternMatch)) { | ||
156 | return false; | ||
157 | } | ||
158 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
159 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
160 | } | ||
161 | } | ||
162 | |||
163 | @Override | ||
164 | public NoPotentialLinkToGroundStation specification() { | ||
165 | return NoPotentialLinkToGroundStation.instance(); | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * Returns an empty, mutable match. | ||
170 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
171 | * | ||
172 | * @return the empty match. | ||
173 | * | ||
174 | */ | ||
175 | public static NoPotentialLinkToGroundStation.Match newEmptyMatch() { | ||
176 | return new Mutable(null); | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * Returns a mutable (partial) match. | ||
181 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
182 | * | ||
183 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
184 | * @return the new, mutable (partial) match object. | ||
185 | * | ||
186 | */ | ||
187 | public static NoPotentialLinkToGroundStation.Match newMutableMatch(final Spacecraft pSpacecraft) { | ||
188 | return new Mutable(pSpacecraft); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * Returns a new (partial) match. | ||
193 | * This can be used e.g. to call the matcher with a partial match. | ||
194 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
195 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
196 | * @return the (partial) match object. | ||
197 | * | ||
198 | */ | ||
199 | public static NoPotentialLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) { | ||
200 | return new Immutable(pSpacecraft); | ||
201 | } | ||
202 | |||
203 | private static final class Mutable extends NoPotentialLinkToGroundStation.Match { | ||
204 | Mutable(final Spacecraft pSpacecraft) { | ||
205 | super(pSpacecraft); | ||
206 | } | ||
207 | |||
208 | @Override | ||
209 | public boolean isMutable() { | ||
210 | return true; | ||
211 | } | ||
212 | } | ||
213 | |||
214 | private static final class Immutable extends NoPotentialLinkToGroundStation.Match { | ||
215 | Immutable(final Spacecraft pSpacecraft) { | ||
216 | super(pSpacecraft); | ||
217 | } | ||
218 | |||
219 | @Override | ||
220 | public boolean isMutable() { | ||
221 | return false; | ||
222 | } | ||
223 | } | ||
224 | } | ||
225 | |||
226 | /** | ||
227 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation pattern, | ||
228 | * providing pattern-specific query methods. | ||
229 | * | ||
230 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
231 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
232 | * | ||
233 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
234 | * | ||
235 | * <p>Original source: | ||
236 | * <code><pre> | ||
237 | * {@literal @}Constraint(severity = "error", key = {Spacecraft}, | ||
238 | * message = "Spacecraft has no potential communication path to the ground station.") | ||
239 | * pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { | ||
240 | * ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
241 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
242 | * neg find indirectLinkAllowed(Spacecraft, GroundStation); | ||
243 | * } | ||
244 | * </pre></code> | ||
245 | * | ||
246 | * @see Match | ||
247 | * @see NoPotentialLinkToGroundStation | ||
248 | * | ||
249 | */ | ||
250 | public static class Matcher extends BaseMatcher<NoPotentialLinkToGroundStation.Match> { | ||
251 | /** | ||
252 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
253 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
254 | * | ||
255 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
256 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
257 | * | ||
258 | */ | ||
259 | public static NoPotentialLinkToGroundStation.Matcher on(final ViatraQueryEngine engine) { | ||
260 | // check if matcher already exists | ||
261 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
262 | if (matcher == null) { | ||
263 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
264 | } | ||
265 | return matcher; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
270 | * @return an initialized matcher | ||
271 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
272 | * | ||
273 | */ | ||
274 | public static NoPotentialLinkToGroundStation.Matcher create() { | ||
275 | return new Matcher(); | ||
276 | } | ||
277 | |||
278 | private static final int POSITION_SPACECRAFT = 0; | ||
279 | |||
280 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NoPotentialLinkToGroundStation.Matcher.class); | ||
281 | |||
282 | /** | ||
283 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
284 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
285 | * | ||
286 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
287 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
288 | * | ||
289 | */ | ||
290 | private Matcher() { | ||
291 | super(querySpecification()); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
296 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
297 | * @return matches represented as a Match object. | ||
298 | * | ||
299 | */ | ||
300 | public Collection<NoPotentialLinkToGroundStation.Match> getAllMatches(final Spacecraft pSpacecraft) { | ||
301 | return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet()); | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
306 | * </p> | ||
307 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
308 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
309 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
310 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
311 | * @return a stream of matches represented as a Match object. | ||
312 | * | ||
313 | */ | ||
314 | public Stream<NoPotentialLinkToGroundStation.Match> streamAllMatches(final Spacecraft pSpacecraft) { | ||
315 | return rawStreamAllMatches(new Object[]{pSpacecraft}); | ||
316 | } | ||
317 | |||
318 | /** | ||
319 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
320 | * Neither determinism nor randomness of selection is guaranteed. | ||
321 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
322 | * @return a match represented as a Match object, or null if no match is found. | ||
323 | * | ||
324 | */ | ||
325 | public Optional<NoPotentialLinkToGroundStation.Match> getOneArbitraryMatch(final Spacecraft pSpacecraft) { | ||
326 | return rawGetOneArbitraryMatch(new Object[]{pSpacecraft}); | ||
327 | } | ||
328 | |||
329 | /** | ||
330 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
331 | * under any possible substitution of the unspecified parameters (if any). | ||
332 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
333 | * @return true if the input is a valid (partial) match of the pattern. | ||
334 | * | ||
335 | */ | ||
336 | public boolean hasMatch(final Spacecraft pSpacecraft) { | ||
337 | return rawHasMatch(new Object[]{pSpacecraft}); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
342 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
343 | * @return the number of pattern matches found. | ||
344 | * | ||
345 | */ | ||
346 | public int countMatches(final Spacecraft pSpacecraft) { | ||
347 | return rawCountMatches(new Object[]{pSpacecraft}); | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
352 | * Neither determinism nor randomness of selection is guaranteed. | ||
353 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
354 | * @param processor the action that will process the selected match. | ||
355 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
356 | * | ||
357 | */ | ||
358 | public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer<? super NoPotentialLinkToGroundStation.Match> processor) { | ||
359 | return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor); | ||
360 | } | ||
361 | |||
362 | /** | ||
363 | * Returns a new (partial) match. | ||
364 | * This can be used e.g. to call the matcher with a partial match. | ||
365 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
366 | * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound. | ||
367 | * @return the (partial) match object. | ||
368 | * | ||
369 | */ | ||
370 | public NoPotentialLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) { | ||
371 | return NoPotentialLinkToGroundStation.Match.newMatch(pSpacecraft); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | protected Stream<Spacecraft> rawStreamAllValuesOfSpacecraft(final Object[] parameters) { | ||
380 | return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Set<Spacecraft> getAllValuesOfSpacecraft() { | ||
389 | return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet()); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for Spacecraft. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | public Stream<Spacecraft> streamAllValuesOfSpacecraft() { | ||
398 | return rawStreamAllValuesOfSpacecraft(emptyArray()); | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected NoPotentialLinkToGroundStation.Match tupleToMatch(final Tuple t) { | ||
403 | try { | ||
404 | return NoPotentialLinkToGroundStation.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT)); | ||
405 | } catch(ClassCastException e) { | ||
406 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
407 | return null; | ||
408 | } | ||
409 | } | ||
410 | |||
411 | @Override | ||
412 | protected NoPotentialLinkToGroundStation.Match arrayToMatch(final Object[] match) { | ||
413 | try { | ||
414 | return NoPotentialLinkToGroundStation.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
415 | } catch(ClassCastException e) { | ||
416 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
417 | return null; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | @Override | ||
422 | protected NoPotentialLinkToGroundStation.Match arrayToMatchMutable(final Object[] match) { | ||
423 | try { | ||
424 | return NoPotentialLinkToGroundStation.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]); | ||
425 | } catch(ClassCastException e) { | ||
426 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
427 | return null; | ||
428 | } | ||
429 | } | ||
430 | |||
431 | /** | ||
432 | * @return the singleton instance of the query specification of this pattern | ||
433 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
434 | * | ||
435 | */ | ||
436 | public static IQuerySpecification<NoPotentialLinkToGroundStation.Matcher> querySpecification() { | ||
437 | return NoPotentialLinkToGroundStation.instance(); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | private NoPotentialLinkToGroundStation() { | ||
442 | super(GeneratedPQuery.INSTANCE); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * @return the singleton instance of the query specification | ||
447 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
448 | * | ||
449 | */ | ||
450 | public static NoPotentialLinkToGroundStation instance() { | ||
451 | try{ | ||
452 | return LazyHolder.INSTANCE; | ||
453 | } catch (ExceptionInInitializerError err) { | ||
454 | throw processInitializerError(err); | ||
455 | } | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | protected NoPotentialLinkToGroundStation.Matcher instantiate(final ViatraQueryEngine engine) { | ||
460 | return NoPotentialLinkToGroundStation.Matcher.on(engine); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public NoPotentialLinkToGroundStation.Matcher instantiate() { | ||
465 | return NoPotentialLinkToGroundStation.Matcher.create(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public NoPotentialLinkToGroundStation.Match newEmptyMatch() { | ||
470 | return NoPotentialLinkToGroundStation.Match.newEmptyMatch(); | ||
471 | } | ||
472 | |||
473 | @Override | ||
474 | public NoPotentialLinkToGroundStation.Match newMatch(final Object... parameters) { | ||
475 | return NoPotentialLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]); | ||
476 | } | ||
477 | |||
478 | /** | ||
479 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation (visibility: PUBLIC, simpleName: NoPotentialLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
480 | * <b>not</b> at the class load time of the outer class, | ||
481 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation (visibility: PUBLIC, simpleName: NoPotentialLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
482 | * | ||
483 | * <p> This workaround is required e.g. to support recursion. | ||
484 | * | ||
485 | */ | ||
486 | private static class LazyHolder { | ||
487 | private static final NoPotentialLinkToGroundStation INSTANCE = new NoPotentialLinkToGroundStation(); | ||
488 | |||
489 | /** | ||
490 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
491 | * This initialization order is required to support indirect recursion. | ||
492 | * | ||
493 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
494 | * | ||
495 | */ | ||
496 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
497 | |||
498 | public static Object ensureInitialized() { | ||
499 | INSTANCE.ensureInitializedInternal(); | ||
500 | return null; | ||
501 | } | ||
502 | } | ||
503 | |||
504 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
505 | private static final NoPotentialLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
506 | |||
507 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
508 | |||
509 | private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft); | ||
510 | |||
511 | private GeneratedPQuery() { | ||
512 | super(PVisibility.PUBLIC); | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public String getFullyQualifiedName() { | ||
517 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation"; | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<String> getParameterNames() { | ||
522 | return Arrays.asList("Spacecraft"); | ||
523 | } | ||
524 | |||
525 | @Override | ||
526 | public List<PParameter> getParameters() { | ||
527 | return parameters; | ||
528 | } | ||
529 | |||
530 | @Override | ||
531 | public Set<PBody> doGetContainedBodies() { | ||
532 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
533 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
534 | { | ||
535 | PBody body = new PBody(this); | ||
536 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
537 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
538 | PVariable var_GroundStation = body.getOrCreateVariableByName("GroundStation"); | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
540 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
541 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft) | ||
542 | )); | ||
543 | // ConstellationMission.groundStationNetwork(Mission, GroundStation) | ||
544 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
545 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
546 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "groundStationNetwork"))); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork"))); | ||
548 | new Equality(body, var__virtual_0_, var_GroundStation); | ||
549 | // ConstellationMission.spacecraft(Mission, Spacecraft) | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
551 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
552 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft"))); | ||
553 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
554 | new Equality(body, var__virtual_1_, var_Spacecraft); | ||
555 | // neg find indirectLinkAllowed(Spacecraft, GroundStation) | ||
556 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_GroundStation), IndirectLinkAllowed.instance().getInternalQueryRepresentation()); | ||
557 | bodies.add(body); | ||
558 | } | ||
559 | { | ||
560 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
561 | annotation.addAttribute("severity", "error"); | ||
562 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
563 | new ParameterReference("Spacecraft") | ||
564 | })); | ||
565 | annotation.addAttribute("message", "Spacecraft has no potential communication path to the ground station."); | ||
566 | addAnnotation(annotation); | ||
567 | } | ||
568 | return bodies; | ||
569 | } | ||
570 | } | ||
571 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java deleted file mode 100644 index bdd97100..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java +++ /dev/null | |||
@@ -1,559 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
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 | import satellite.InterferometryMission; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * // At least two spacecraft must have the interferometry payload configured | ||
49 | * | ||
50 | * {@literal @}Constraint(severity = "error", key = {Mission}, | ||
51 | * message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") | ||
52 | * pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { | ||
53 | * InterferometryMission(Mission); | ||
54 | * neg find atLeastTwoInterferometryPayloads(Mission); | ||
55 | * } | ||
56 | * </pre></code> | ||
57 | * | ||
58 | * @see Matcher | ||
59 | * @see Match | ||
60 | * | ||
61 | */ | ||
62 | @SuppressWarnings("all") | ||
63 | public final class NotEnoughInterferometryPayloads extends BaseGeneratedEMFQuerySpecification<NotEnoughInterferometryPayloads.Matcher> { | ||
64 | /** | ||
65 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads pattern, | ||
66 | * to be used in conjunction with {@link Matcher}. | ||
67 | * | ||
68 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
69 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
70 | * usable to represent a match of the pattern in the result of a query, | ||
71 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
72 | * | ||
73 | * @see Matcher | ||
74 | * | ||
75 | */ | ||
76 | public static abstract class Match extends BasePatternMatch { | ||
77 | private InterferometryMission fMission; | ||
78 | |||
79 | private static List<String> parameterNames = makeImmutableList("Mission"); | ||
80 | |||
81 | private Match(final InterferometryMission pMission) { | ||
82 | this.fMission = pMission; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public Object get(final String parameterName) { | ||
87 | if ("Mission".equals(parameterName)) return this.fMission; | ||
88 | return null; | ||
89 | } | ||
90 | |||
91 | public InterferometryMission getMission() { | ||
92 | return this.fMission; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("Mission".equals(parameterName) ) { | ||
99 | this.fMission = (InterferometryMission) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | return false; | ||
103 | } | ||
104 | |||
105 | public void setMission(final InterferometryMission pMission) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | this.fMission = pMission; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String patternName() { | ||
112 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> parameterNames() { | ||
117 | return NotEnoughInterferometryPayloads.Match.parameterNames; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public Object[] toArray() { | ||
122 | return new Object[]{fMission}; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public NotEnoughInterferometryPayloads.Match toImmutable() { | ||
127 | return isMutable() ? newMatch(fMission) : this; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String prettyPrint() { | ||
132 | StringBuilder result = new StringBuilder(); | ||
133 | result.append("\"Mission\"=" + prettyPrintValue(fMission)); | ||
134 | return result.toString(); | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public int hashCode() { | ||
139 | return Objects.hash(fMission); | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public boolean equals(final Object obj) { | ||
144 | if (this == obj) | ||
145 | return true; | ||
146 | if (obj == null) { | ||
147 | return false; | ||
148 | } | ||
149 | if ((obj instanceof NotEnoughInterferometryPayloads.Match)) { | ||
150 | NotEnoughInterferometryPayloads.Match other = (NotEnoughInterferometryPayloads.Match) obj; | ||
151 | return Objects.equals(fMission, other.fMission); | ||
152 | } else { | ||
153 | // this should be infrequent | ||
154 | if (!(obj instanceof IPatternMatch)) { | ||
155 | return false; | ||
156 | } | ||
157 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
158 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public NotEnoughInterferometryPayloads specification() { | ||
164 | return NotEnoughInterferometryPayloads.instance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Returns an empty, mutable match. | ||
169 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
170 | * | ||
171 | * @return the empty match. | ||
172 | * | ||
173 | */ | ||
174 | public static NotEnoughInterferometryPayloads.Match newEmptyMatch() { | ||
175 | return new Mutable(null); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns a mutable (partial) match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
183 | * @return the new, mutable (partial) match object. | ||
184 | * | ||
185 | */ | ||
186 | public static NotEnoughInterferometryPayloads.Match newMutableMatch(final InterferometryMission pMission) { | ||
187 | return new Mutable(pMission); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a new (partial) match. | ||
192 | * This can be used e.g. to call the matcher with a partial match. | ||
193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
194 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
195 | * @return the (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static NotEnoughInterferometryPayloads.Match newMatch(final InterferometryMission pMission) { | ||
199 | return new Immutable(pMission); | ||
200 | } | ||
201 | |||
202 | private static final class Mutable extends NotEnoughInterferometryPayloads.Match { | ||
203 | Mutable(final InterferometryMission pMission) { | ||
204 | super(pMission); | ||
205 | } | ||
206 | |||
207 | @Override | ||
208 | public boolean isMutable() { | ||
209 | return true; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | private static final class Immutable extends NotEnoughInterferometryPayloads.Match { | ||
214 | Immutable(final InterferometryMission pMission) { | ||
215 | super(pMission); | ||
216 | } | ||
217 | |||
218 | @Override | ||
219 | public boolean isMutable() { | ||
220 | return false; | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads pattern, | ||
227 | * providing pattern-specific query methods. | ||
228 | * | ||
229 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
230 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
231 | * | ||
232 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
233 | * | ||
234 | * <p>Original source: | ||
235 | * <code><pre> | ||
236 | * // At least two spacecraft must have the interferometry payload configured | ||
237 | * | ||
238 | * {@literal @}Constraint(severity = "error", key = {Mission}, | ||
239 | * message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") | ||
240 | * pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { | ||
241 | * InterferometryMission(Mission); | ||
242 | * neg find atLeastTwoInterferometryPayloads(Mission); | ||
243 | * } | ||
244 | * </pre></code> | ||
245 | * | ||
246 | * @see Match | ||
247 | * @see NotEnoughInterferometryPayloads | ||
248 | * | ||
249 | */ | ||
250 | public static class Matcher extends BaseMatcher<NotEnoughInterferometryPayloads.Match> { | ||
251 | /** | ||
252 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
253 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
254 | * | ||
255 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
256 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
257 | * | ||
258 | */ | ||
259 | public static NotEnoughInterferometryPayloads.Matcher on(final ViatraQueryEngine engine) { | ||
260 | // check if matcher already exists | ||
261 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
262 | if (matcher == null) { | ||
263 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
264 | } | ||
265 | return matcher; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
270 | * @return an initialized matcher | ||
271 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
272 | * | ||
273 | */ | ||
274 | public static NotEnoughInterferometryPayloads.Matcher create() { | ||
275 | return new Matcher(); | ||
276 | } | ||
277 | |||
278 | private static final int POSITION_MISSION = 0; | ||
279 | |||
280 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NotEnoughInterferometryPayloads.Matcher.class); | ||
281 | |||
282 | /** | ||
283 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
284 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
285 | * | ||
286 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
287 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
288 | * | ||
289 | */ | ||
290 | private Matcher() { | ||
291 | super(querySpecification()); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
296 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
297 | * @return matches represented as a Match object. | ||
298 | * | ||
299 | */ | ||
300 | public Collection<NotEnoughInterferometryPayloads.Match> getAllMatches(final InterferometryMission pMission) { | ||
301 | return rawStreamAllMatches(new Object[]{pMission}).collect(Collectors.toSet()); | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
306 | * </p> | ||
307 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
308 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
309 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
310 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
311 | * @return a stream of matches represented as a Match object. | ||
312 | * | ||
313 | */ | ||
314 | public Stream<NotEnoughInterferometryPayloads.Match> streamAllMatches(final InterferometryMission pMission) { | ||
315 | return rawStreamAllMatches(new Object[]{pMission}); | ||
316 | } | ||
317 | |||
318 | /** | ||
319 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
320 | * Neither determinism nor randomness of selection is guaranteed. | ||
321 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
322 | * @return a match represented as a Match object, or null if no match is found. | ||
323 | * | ||
324 | */ | ||
325 | public Optional<NotEnoughInterferometryPayloads.Match> getOneArbitraryMatch(final InterferometryMission pMission) { | ||
326 | return rawGetOneArbitraryMatch(new Object[]{pMission}); | ||
327 | } | ||
328 | |||
329 | /** | ||
330 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
331 | * under any possible substitution of the unspecified parameters (if any). | ||
332 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
333 | * @return true if the input is a valid (partial) match of the pattern. | ||
334 | * | ||
335 | */ | ||
336 | public boolean hasMatch(final InterferometryMission pMission) { | ||
337 | return rawHasMatch(new Object[]{pMission}); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
342 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
343 | * @return the number of pattern matches found. | ||
344 | * | ||
345 | */ | ||
346 | public int countMatches(final InterferometryMission pMission) { | ||
347 | return rawCountMatches(new Object[]{pMission}); | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
352 | * Neither determinism nor randomness of selection is guaranteed. | ||
353 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
354 | * @param processor the action that will process the selected match. | ||
355 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
356 | * | ||
357 | */ | ||
358 | public boolean forOneArbitraryMatch(final InterferometryMission pMission, final Consumer<? super NotEnoughInterferometryPayloads.Match> processor) { | ||
359 | return rawForOneArbitraryMatch(new Object[]{pMission}, processor); | ||
360 | } | ||
361 | |||
362 | /** | ||
363 | * Returns a new (partial) match. | ||
364 | * This can be used e.g. to call the matcher with a partial match. | ||
365 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
366 | * @param pMission the fixed value of pattern parameter Mission, or null if not bound. | ||
367 | * @return the (partial) match object. | ||
368 | * | ||
369 | */ | ||
370 | public NotEnoughInterferometryPayloads.Match newMatch(final InterferometryMission pMission) { | ||
371 | return NotEnoughInterferometryPayloads.Match.newMatch(pMission); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for Mission. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | protected Stream<InterferometryMission> rawStreamAllValuesOfMission(final Object[] parameters) { | ||
380 | return rawStreamAllValues(POSITION_MISSION, parameters).map(InterferometryMission.class::cast); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for Mission. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Set<InterferometryMission> getAllValuesOfMission() { | ||
389 | return rawStreamAllValuesOfMission(emptyArray()).collect(Collectors.toSet()); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for Mission. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | public Stream<InterferometryMission> streamAllValuesOfMission() { | ||
398 | return rawStreamAllValuesOfMission(emptyArray()); | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected NotEnoughInterferometryPayloads.Match tupleToMatch(final Tuple t) { | ||
403 | try { | ||
404 | return NotEnoughInterferometryPayloads.Match.newMatch((InterferometryMission) t.get(POSITION_MISSION)); | ||
405 | } catch(ClassCastException e) { | ||
406 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
407 | return null; | ||
408 | } | ||
409 | } | ||
410 | |||
411 | @Override | ||
412 | protected NotEnoughInterferometryPayloads.Match arrayToMatch(final Object[] match) { | ||
413 | try { | ||
414 | return NotEnoughInterferometryPayloads.Match.newMatch((InterferometryMission) match[POSITION_MISSION]); | ||
415 | } catch(ClassCastException e) { | ||
416 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
417 | return null; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | @Override | ||
422 | protected NotEnoughInterferometryPayloads.Match arrayToMatchMutable(final Object[] match) { | ||
423 | try { | ||
424 | return NotEnoughInterferometryPayloads.Match.newMutableMatch((InterferometryMission) match[POSITION_MISSION]); | ||
425 | } catch(ClassCastException e) { | ||
426 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
427 | return null; | ||
428 | } | ||
429 | } | ||
430 | |||
431 | /** | ||
432 | * @return the singleton instance of the query specification of this pattern | ||
433 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
434 | * | ||
435 | */ | ||
436 | public static IQuerySpecification<NotEnoughInterferometryPayloads.Matcher> querySpecification() { | ||
437 | return NotEnoughInterferometryPayloads.instance(); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | private NotEnoughInterferometryPayloads() { | ||
442 | super(GeneratedPQuery.INSTANCE); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * @return the singleton instance of the query specification | ||
447 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
448 | * | ||
449 | */ | ||
450 | public static NotEnoughInterferometryPayloads instance() { | ||
451 | try{ | ||
452 | return LazyHolder.INSTANCE; | ||
453 | } catch (ExceptionInInitializerError err) { | ||
454 | throw processInitializerError(err); | ||
455 | } | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | protected NotEnoughInterferometryPayloads.Matcher instantiate(final ViatraQueryEngine engine) { | ||
460 | return NotEnoughInterferometryPayloads.Matcher.on(engine); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public NotEnoughInterferometryPayloads.Matcher instantiate() { | ||
465 | return NotEnoughInterferometryPayloads.Matcher.create(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public NotEnoughInterferometryPayloads.Match newEmptyMatch() { | ||
470 | return NotEnoughInterferometryPayloads.Match.newEmptyMatch(); | ||
471 | } | ||
472 | |||
473 | @Override | ||
474 | public NotEnoughInterferometryPayloads.Match newMatch(final Object... parameters) { | ||
475 | return NotEnoughInterferometryPayloads.Match.newMatch((satellite.InterferometryMission) parameters[0]); | ||
476 | } | ||
477 | |||
478 | /** | ||
479 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads (visibility: PUBLIC, simpleName: NotEnoughInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
480 | * <b>not</b> at the class load time of the outer class, | ||
481 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads (visibility: PUBLIC, simpleName: NotEnoughInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
482 | * | ||
483 | * <p> This workaround is required e.g. to support recursion. | ||
484 | * | ||
485 | */ | ||
486 | private static class LazyHolder { | ||
487 | private static final NotEnoughInterferometryPayloads INSTANCE = new NotEnoughInterferometryPayloads(); | ||
488 | |||
489 | /** | ||
490 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
491 | * This initialization order is required to support indirect recursion. | ||
492 | * | ||
493 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
494 | * | ||
495 | */ | ||
496 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
497 | |||
498 | public static Object ensureInitialized() { | ||
499 | INSTANCE.ensureInitializedInternal(); | ||
500 | return null; | ||
501 | } | ||
502 | } | ||
503 | |||
504 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
505 | private static final NotEnoughInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
506 | |||
507 | private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); | ||
508 | |||
509 | private final List<PParameter> parameters = Arrays.asList(parameter_Mission); | ||
510 | |||
511 | private GeneratedPQuery() { | ||
512 | super(PVisibility.PUBLIC); | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public String getFullyQualifiedName() { | ||
517 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads"; | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<String> getParameterNames() { | ||
522 | return Arrays.asList("Mission"); | ||
523 | } | ||
524 | |||
525 | @Override | ||
526 | public List<PParameter> getParameters() { | ||
527 | return parameters; | ||
528 | } | ||
529 | |||
530 | @Override | ||
531 | public Set<PBody> doGetContainedBodies() { | ||
532 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
533 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
534 | { | ||
535 | PBody body = new PBody(this); | ||
536 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
537 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission"))); | ||
538 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
539 | new ExportedParameter(body, var_Mission, parameter_Mission) | ||
540 | )); | ||
541 | // InterferometryMission(Mission) | ||
542 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission"))); | ||
543 | // neg find atLeastTwoInterferometryPayloads(Mission) | ||
544 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Mission), AtLeastTwoInterferometryPayloads.instance().getInternalQueryRepresentation()); | ||
545 | bodies.add(body); | ||
546 | } | ||
547 | { | ||
548 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
549 | annotation.addAttribute("severity", "error"); | ||
550 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
551 | new ParameterReference("Mission") | ||
552 | })); | ||
553 | annotation.addAttribute("message", "Interferometry mission needs at least two spacecraft configured with the interferometry payload."); | ||
554 | addAnnotation(annotation); | ||
555 | } | ||
556 | return bodies; | ||
557 | } | ||
558 | } | ||
559 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java deleted file mode 100644 index 9025d93a..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java +++ /dev/null | |||
@@ -1,141 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink; | ||
15 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
16 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | ||
17 | |||
18 | /** | ||
19 | * A pattern group formed of all public patterns defined in SatelliteQueries.vql. | ||
20 | * | ||
21 | * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare | ||
22 | * a VIATRA Query engine for matching all patterns originally defined in file SatelliteQueries.vql, | ||
23 | * in order to achieve better performance than one-by-one on-demand matcher initialization. | ||
24 | * | ||
25 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns: <ul> | ||
26 | * <li>communicationLinkDoesNotStartAtContainingElement</li> | ||
27 | * <li>notEnoughInterferometryPayloads</li> | ||
28 | * <li>noLinkToGroundStation</li> | ||
29 | * <li>noPotentialLinkToGroundStation</li> | ||
30 | * <li>communicationLoop</li> | ||
31 | * <li>incompatibleSourceAndTargetBand</li> | ||
32 | * <li>threeUCubeSatWithNonUhfCrossLink</li> | ||
33 | * <li>cubeSatWithKaAntenna</li> | ||
34 | * <li>smallSat</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @see IQueryGroup | ||
38 | * | ||
39 | */ | ||
40 | @SuppressWarnings("all") | ||
41 | public final class SatelliteQueries extends BaseGeneratedPatternGroup { | ||
42 | /** | ||
43 | * Access the pattern group. | ||
44 | * | ||
45 | * @return the singleton instance of the group | ||
46 | * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications | ||
47 | * | ||
48 | */ | ||
49 | public static SatelliteQueries instance() { | ||
50 | if (INSTANCE == null) { | ||
51 | INSTANCE = new SatelliteQueries(); | ||
52 | } | ||
53 | return INSTANCE; | ||
54 | } | ||
55 | |||
56 | private static SatelliteQueries INSTANCE; | ||
57 | |||
58 | private SatelliteQueries() { | ||
59 | querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); | ||
60 | querySpecifications.add(NotEnoughInterferometryPayloads.instance()); | ||
61 | querySpecifications.add(NoLinkToGroundStation.instance()); | ||
62 | querySpecifications.add(NoPotentialLinkToGroundStation.instance()); | ||
63 | querySpecifications.add(CommunicationLoop.instance()); | ||
64 | querySpecifications.add(IncompatibleSourceAndTargetBand.instance()); | ||
65 | querySpecifications.add(ThreeUCubeSatWithNonUhfCrossLink.instance()); | ||
66 | querySpecifications.add(CubeSatWithKaAntenna.instance()); | ||
67 | querySpecifications.add(SmallSat.instance()); | ||
68 | } | ||
69 | |||
70 | public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() { | ||
71 | return CommunicationLinkDoesNotStartAtContainingElement.instance(); | ||
72 | } | ||
73 | |||
74 | public CommunicationLinkDoesNotStartAtContainingElement.Matcher getCommunicationLinkDoesNotStartAtContainingElement(final ViatraQueryEngine engine) { | ||
75 | return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine); | ||
76 | } | ||
77 | |||
78 | public NotEnoughInterferometryPayloads getNotEnoughInterferometryPayloads() { | ||
79 | return NotEnoughInterferometryPayloads.instance(); | ||
80 | } | ||
81 | |||
82 | public NotEnoughInterferometryPayloads.Matcher getNotEnoughInterferometryPayloads(final ViatraQueryEngine engine) { | ||
83 | return NotEnoughInterferometryPayloads.Matcher.on(engine); | ||
84 | } | ||
85 | |||
86 | public NoLinkToGroundStation getNoLinkToGroundStation() { | ||
87 | return NoLinkToGroundStation.instance(); | ||
88 | } | ||
89 | |||
90 | public NoLinkToGroundStation.Matcher getNoLinkToGroundStation(final ViatraQueryEngine engine) { | ||
91 | return NoLinkToGroundStation.Matcher.on(engine); | ||
92 | } | ||
93 | |||
94 | public NoPotentialLinkToGroundStation getNoPotentialLinkToGroundStation() { | ||
95 | return NoPotentialLinkToGroundStation.instance(); | ||
96 | } | ||
97 | |||
98 | public NoPotentialLinkToGroundStation.Matcher getNoPotentialLinkToGroundStation(final ViatraQueryEngine engine) { | ||
99 | return NoPotentialLinkToGroundStation.Matcher.on(engine); | ||
100 | } | ||
101 | |||
102 | public CommunicationLoop getCommunicationLoop() { | ||
103 | return CommunicationLoop.instance(); | ||
104 | } | ||
105 | |||
106 | public CommunicationLoop.Matcher getCommunicationLoop(final ViatraQueryEngine engine) { | ||
107 | return CommunicationLoop.Matcher.on(engine); | ||
108 | } | ||
109 | |||
110 | public IncompatibleSourceAndTargetBand getIncompatibleSourceAndTargetBand() { | ||
111 | return IncompatibleSourceAndTargetBand.instance(); | ||
112 | } | ||
113 | |||
114 | public IncompatibleSourceAndTargetBand.Matcher getIncompatibleSourceAndTargetBand(final ViatraQueryEngine engine) { | ||
115 | return IncompatibleSourceAndTargetBand.Matcher.on(engine); | ||
116 | } | ||
117 | |||
118 | public ThreeUCubeSatWithNonUhfCrossLink getThreeUCubeSatWithNonUhfCrossLink() { | ||
119 | return ThreeUCubeSatWithNonUhfCrossLink.instance(); | ||
120 | } | ||
121 | |||
122 | public ThreeUCubeSatWithNonUhfCrossLink.Matcher getThreeUCubeSatWithNonUhfCrossLink(final ViatraQueryEngine engine) { | ||
123 | return ThreeUCubeSatWithNonUhfCrossLink.Matcher.on(engine); | ||
124 | } | ||
125 | |||
126 | public CubeSatWithKaAntenna getCubeSatWithKaAntenna() { | ||
127 | return CubeSatWithKaAntenna.instance(); | ||
128 | } | ||
129 | |||
130 | public CubeSatWithKaAntenna.Matcher getCubeSatWithKaAntenna(final ViatraQueryEngine engine) { | ||
131 | return CubeSatWithKaAntenna.Matcher.on(engine); | ||
132 | } | ||
133 | |||
134 | public SmallSat getSmallSat() { | ||
135 | return SmallSat.instance(); | ||
136 | } | ||
137 | |||
138 | public SmallSat.Matcher getSmallSat(final ViatraQueryEngine engine) { | ||
139 | return SmallSat.Matcher.on(engine); | ||
140 | } | ||
141 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java deleted file mode 100644 index 4791740e..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java +++ /dev/null | |||
@@ -1,533 +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; | ||
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 smallSat(Sat : SmallSat) { | ||
44 | * SmallSat(Sat); | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see Matcher | ||
49 | * @see Match | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class SmallSat extends BaseGeneratedEMFQuerySpecification<SmallSat.Matcher> { | ||
54 | /** | ||
55 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat 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 satellite.SmallSat fSat; | ||
68 | |||
69 | private static List<String> parameterNames = makeImmutableList("Sat"); | ||
70 | |||
71 | private Match(final satellite.SmallSat pSat) { | ||
72 | this.fSat = pSat; | ||
73 | } | ||
74 | |||
75 | @Override | ||
76 | public Object get(final String parameterName) { | ||
77 | if ("Sat".equals(parameterName)) return this.fSat; | ||
78 | return null; | ||
79 | } | ||
80 | |||
81 | public satellite.SmallSat getSat() { | ||
82 | return this.fSat; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public boolean set(final String parameterName, final Object newValue) { | ||
87 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
88 | if ("Sat".equals(parameterName) ) { | ||
89 | this.fSat = (satellite.SmallSat) newValue; | ||
90 | return true; | ||
91 | } | ||
92 | return false; | ||
93 | } | ||
94 | |||
95 | public void setSat(final satellite.SmallSat pSat) { | ||
96 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
97 | this.fSat = pSat; | ||
98 | } | ||
99 | |||
100 | @Override | ||
101 | public String patternName() { | ||
102 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> parameterNames() { | ||
107 | return SmallSat.Match.parameterNames; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public Object[] toArray() { | ||
112 | return new Object[]{fSat}; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public SmallSat.Match toImmutable() { | ||
117 | return isMutable() ? newMatch(fSat) : this; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public String prettyPrint() { | ||
122 | StringBuilder result = new StringBuilder(); | ||
123 | result.append("\"Sat\"=" + prettyPrintValue(fSat)); | ||
124 | return result.toString(); | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public int hashCode() { | ||
129 | return Objects.hash(fSat); | ||
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 SmallSat.Match)) { | ||
140 | SmallSat.Match other = (SmallSat.Match) obj; | ||
141 | return Objects.equals(fSat, other.fSat); | ||
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 SmallSat specification() { | ||
154 | return SmallSat.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 SmallSat.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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
173 | * @return the new, mutable (partial) match object. | ||
174 | * | ||
175 | */ | ||
176 | public static SmallSat.Match newMutableMatch(final satellite.SmallSat pSat) { | ||
177 | return new Mutable(pSat); | ||
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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
185 | * @return the (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static SmallSat.Match newMatch(final satellite.SmallSat pSat) { | ||
189 | return new Immutable(pSat); | ||
190 | } | ||
191 | |||
192 | private static final class Mutable extends SmallSat.Match { | ||
193 | Mutable(final satellite.SmallSat pSat) { | ||
194 | super(pSat); | ||
195 | } | ||
196 | |||
197 | @Override | ||
198 | public boolean isMutable() { | ||
199 | return true; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | private static final class Immutable extends SmallSat.Match { | ||
204 | Immutable(final satellite.SmallSat pSat) { | ||
205 | super(pSat); | ||
206 | } | ||
207 | |||
208 | @Override | ||
209 | public boolean isMutable() { | ||
210 | return false; | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat 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 smallSat(Sat : SmallSat) { | ||
227 | * SmallSat(Sat); | ||
228 | * } | ||
229 | * </pre></code> | ||
230 | * | ||
231 | * @see Match | ||
232 | * @see SmallSat | ||
233 | * | ||
234 | */ | ||
235 | public static class Matcher extends BaseMatcher<SmallSat.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 SmallSat.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 SmallSat.Matcher create() { | ||
260 | return new Matcher(); | ||
261 | } | ||
262 | |||
263 | private static final int POSITION_SAT = 0; | ||
264 | |||
265 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(SmallSat.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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
282 | * @return matches represented as a Match object. | ||
283 | * | ||
284 | */ | ||
285 | public Collection<SmallSat.Match> getAllMatches(final satellite.SmallSat pSat) { | ||
286 | return rawStreamAllMatches(new Object[]{pSat}).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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
296 | * @return a stream of matches represented as a Match object. | ||
297 | * | ||
298 | */ | ||
299 | public Stream<SmallSat.Match> streamAllMatches(final satellite.SmallSat pSat) { | ||
300 | return rawStreamAllMatches(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, 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<SmallSat.Match> getOneArbitraryMatch(final satellite.SmallSat pSat) { | ||
311 | return rawGetOneArbitraryMatch(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, 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 satellite.SmallSat pSat) { | ||
322 | return rawHasMatch(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
328 | * @return the number of pattern matches found. | ||
329 | * | ||
330 | */ | ||
331 | public int countMatches(final satellite.SmallSat pSat) { | ||
332 | return rawCountMatches(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, 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 satellite.SmallSat pSat, final Consumer<? super SmallSat.Match> processor) { | ||
344 | return rawForOneArbitraryMatch(new Object[]{pSat}, 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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
352 | * @return the (partial) match object. | ||
353 | * | ||
354 | */ | ||
355 | public SmallSat.Match newMatch(final satellite.SmallSat pSat) { | ||
356 | return SmallSat.Match.newMatch(pSat); | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * Retrieve the set of values that occur in matches for Sat. | ||
361 | * @return the Set of all values or empty set if there are no matches | ||
362 | * | ||
363 | */ | ||
364 | protected Stream<satellite.SmallSat> rawStreamAllValuesOfSat(final Object[] parameters) { | ||
365 | return rawStreamAllValues(POSITION_SAT, parameters).map(satellite.SmallSat.class::cast); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * Retrieve the set of values that occur in matches for Sat. | ||
370 | * @return the Set of all values or empty set if there are no matches | ||
371 | * | ||
372 | */ | ||
373 | public Set<satellite.SmallSat> getAllValuesOfSat() { | ||
374 | return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet()); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Retrieve the set of values that occur in matches for Sat. | ||
379 | * @return the Set of all values or empty set if there are no matches | ||
380 | * | ||
381 | */ | ||
382 | public Stream<satellite.SmallSat> streamAllValuesOfSat() { | ||
383 | return rawStreamAllValuesOfSat(emptyArray()); | ||
384 | } | ||
385 | |||
386 | @Override | ||
387 | protected SmallSat.Match tupleToMatch(final Tuple t) { | ||
388 | try { | ||
389 | return SmallSat.Match.newMatch((satellite.SmallSat) t.get(POSITION_SAT)); | ||
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 SmallSat.Match arrayToMatch(final Object[] match) { | ||
398 | try { | ||
399 | return SmallSat.Match.newMatch((satellite.SmallSat) match[POSITION_SAT]); | ||
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 SmallSat.Match arrayToMatchMutable(final Object[] match) { | ||
408 | try { | ||
409 | return SmallSat.Match.newMutableMatch((satellite.SmallSat) match[POSITION_SAT]); | ||
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<SmallSat.Matcher> querySpecification() { | ||
422 | return SmallSat.instance(); | ||
423 | } | ||
424 | } | ||
425 | |||
426 | private SmallSat() { | ||
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 SmallSat instance() { | ||
436 | try{ | ||
437 | return LazyHolder.INSTANCE; | ||
438 | } catch (ExceptionInInitializerError err) { | ||
439 | throw processInitializerError(err); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | @Override | ||
444 | protected SmallSat.Matcher instantiate(final ViatraQueryEngine engine) { | ||
445 | return SmallSat.Matcher.on(engine); | ||
446 | } | ||
447 | |||
448 | @Override | ||
449 | public SmallSat.Matcher instantiate() { | ||
450 | return SmallSat.Matcher.create(); | ||
451 | } | ||
452 | |||
453 | @Override | ||
454 | public SmallSat.Match newEmptyMatch() { | ||
455 | return SmallSat.Match.newEmptyMatch(); | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | public SmallSat.Match newMatch(final Object... parameters) { | ||
460 | return SmallSat.Match.newMatch((satellite.SmallSat) parameters[0]); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat (visibility: PUBLIC, simpleName: SmallSat, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.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: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat (visibility: PUBLIC, simpleName: SmallSat, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.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 static final SmallSat INSTANCE = new SmallSat(); | ||
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 static final 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 static final SmallSat.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
491 | |||
492 | private final PParameter parameter_Sat = new PParameter("Sat", "satellite.SmallSat", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "SmallSat")), PParameterDirection.INOUT); | ||
493 | |||
494 | private final List<PParameter> parameters = Arrays.asList(parameter_Sat); | ||
495 | |||
496 | private GeneratedPQuery() { | ||
497 | super(PVisibility.PUBLIC); | ||
498 | } | ||
499 | |||
500 | @Override | ||
501 | public String getFullyQualifiedName() { | ||
502 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat"; | ||
503 | } | ||
504 | |||
505 | @Override | ||
506 | public List<String> getParameterNames() { | ||
507 | return Arrays.asList("Sat"); | ||
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_Sat = body.getOrCreateVariableByName("Sat"); | ||
522 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat"))); | ||
523 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
524 | new ExportedParameter(body, var_Sat, parameter_Sat) | ||
525 | )); | ||
526 | // SmallSat(Sat) | ||
527 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat"))); | ||
528 | bodies.add(body); | ||
529 | } | ||
530 | return bodies; | ||
531 | } | ||
532 | } | ||
533 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java deleted file mode 100644 index 0fe520c2..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java +++ /dev/null | |||
@@ -1,591 +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; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork; | ||
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.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
43 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
44 | import satellite.CubeSat3U; | ||
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 | * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter, | ||
52 | * // but cross-link using UHF | ||
53 | * | ||
54 | * {@literal @}Constraint(severity = "error", key = {Sat}, | ||
55 | * message = "3U CubeSats can only cross-link using UHF.") | ||
56 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | ||
57 | * CommunicatingElement.commSubsystem(Sat, SourceComm); | ||
58 | * neg find commSubsystemBandUhf(SourceComm); | ||
59 | * CommSubsystem.target(SourceComm, TargetComm); | ||
60 | * CommunicatingElement.commSubsystem(Target, TargetComm); | ||
61 | * neg find groundStationNetwork(Target); | ||
62 | * } | ||
63 | * </pre></code> | ||
64 | * | ||
65 | * @see Matcher | ||
66 | * @see Match | ||
67 | * | ||
68 | */ | ||
69 | @SuppressWarnings("all") | ||
70 | public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuerySpecification<ThreeUCubeSatWithNonUhfCrossLink.Matcher> { | ||
71 | /** | ||
72 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern, | ||
73 | * to be used in conjunction with {@link Matcher}. | ||
74 | * | ||
75 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
76 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
77 | * usable to represent a match of the pattern in the result of a query, | ||
78 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
79 | * | ||
80 | * @see Matcher | ||
81 | * | ||
82 | */ | ||
83 | public static abstract class Match extends BasePatternMatch { | ||
84 | private CubeSat3U fSat; | ||
85 | |||
86 | private static List<String> parameterNames = makeImmutableList("Sat"); | ||
87 | |||
88 | private Match(final CubeSat3U pSat) { | ||
89 | this.fSat = pSat; | ||
90 | } | ||
91 | |||
92 | @Override | ||
93 | public Object get(final String parameterName) { | ||
94 | if ("Sat".equals(parameterName)) return this.fSat; | ||
95 | return null; | ||
96 | } | ||
97 | |||
98 | public CubeSat3U getSat() { | ||
99 | return this.fSat; | ||
100 | } | ||
101 | |||
102 | @Override | ||
103 | public boolean set(final String parameterName, final Object newValue) { | ||
104 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
105 | if ("Sat".equals(parameterName) ) { | ||
106 | this.fSat = (CubeSat3U) newValue; | ||
107 | return true; | ||
108 | } | ||
109 | return false; | ||
110 | } | ||
111 | |||
112 | public void setSat(final CubeSat3U pSat) { | ||
113 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
114 | this.fSat = pSat; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public String patternName() { | ||
119 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink"; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public List<String> parameterNames() { | ||
124 | return ThreeUCubeSatWithNonUhfCrossLink.Match.parameterNames; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public Object[] toArray() { | ||
129 | return new Object[]{fSat}; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public ThreeUCubeSatWithNonUhfCrossLink.Match toImmutable() { | ||
134 | return isMutable() ? newMatch(fSat) : this; | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public String prettyPrint() { | ||
139 | StringBuilder result = new StringBuilder(); | ||
140 | result.append("\"Sat\"=" + prettyPrintValue(fSat)); | ||
141 | return result.toString(); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public int hashCode() { | ||
146 | return Objects.hash(fSat); | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public boolean equals(final Object obj) { | ||
151 | if (this == obj) | ||
152 | return true; | ||
153 | if (obj == null) { | ||
154 | return false; | ||
155 | } | ||
156 | if ((obj instanceof ThreeUCubeSatWithNonUhfCrossLink.Match)) { | ||
157 | ThreeUCubeSatWithNonUhfCrossLink.Match other = (ThreeUCubeSatWithNonUhfCrossLink.Match) obj; | ||
158 | return Objects.equals(fSat, other.fSat); | ||
159 | } else { | ||
160 | // this should be infrequent | ||
161 | if (!(obj instanceof IPatternMatch)) { | ||
162 | return false; | ||
163 | } | ||
164 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
165 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | @Override | ||
170 | public ThreeUCubeSatWithNonUhfCrossLink specification() { | ||
171 | return ThreeUCubeSatWithNonUhfCrossLink.instance(); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * Returns an empty, mutable match. | ||
176 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
177 | * | ||
178 | * @return the empty match. | ||
179 | * | ||
180 | */ | ||
181 | public static ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() { | ||
182 | return new Mutable(null); | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * Returns a mutable (partial) match. | ||
187 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
188 | * | ||
189 | * @param pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
190 | * @return the new, mutable (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static ThreeUCubeSatWithNonUhfCrossLink.Match newMutableMatch(final CubeSat3U pSat) { | ||
194 | return new Mutable(pSat); | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * Returns a new (partial) match. | ||
199 | * This can be used e.g. to call the matcher with a partial match. | ||
200 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
201 | * @param pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
202 | * @return the (partial) match object. | ||
203 | * | ||
204 | */ | ||
205 | public static ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) { | ||
206 | return new Immutable(pSat); | ||
207 | } | ||
208 | |||
209 | private static final class Mutable extends ThreeUCubeSatWithNonUhfCrossLink.Match { | ||
210 | Mutable(final CubeSat3U pSat) { | ||
211 | super(pSat); | ||
212 | } | ||
213 | |||
214 | @Override | ||
215 | public boolean isMutable() { | ||
216 | return true; | ||
217 | } | ||
218 | } | ||
219 | |||
220 | private static final class Immutable extends ThreeUCubeSatWithNonUhfCrossLink.Match { | ||
221 | Immutable(final CubeSat3U pSat) { | ||
222 | super(pSat); | ||
223 | } | ||
224 | |||
225 | @Override | ||
226 | public boolean isMutable() { | ||
227 | return false; | ||
228 | } | ||
229 | } | ||
230 | } | ||
231 | |||
232 | /** | ||
233 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern, | ||
234 | * providing pattern-specific query methods. | ||
235 | * | ||
236 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
237 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
238 | * | ||
239 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
240 | * | ||
241 | * <p>Original source: | ||
242 | * <code><pre> | ||
243 | * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter, | ||
244 | * // but cross-link using UHF | ||
245 | * | ||
246 | * {@literal @}Constraint(severity = "error", key = {Sat}, | ||
247 | * message = "3U CubeSats can only cross-link using UHF.") | ||
248 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | ||
249 | * CommunicatingElement.commSubsystem(Sat, SourceComm); | ||
250 | * neg find commSubsystemBandUhf(SourceComm); | ||
251 | * CommSubsystem.target(SourceComm, TargetComm); | ||
252 | * CommunicatingElement.commSubsystem(Target, TargetComm); | ||
253 | * neg find groundStationNetwork(Target); | ||
254 | * } | ||
255 | * </pre></code> | ||
256 | * | ||
257 | * @see Match | ||
258 | * @see ThreeUCubeSatWithNonUhfCrossLink | ||
259 | * | ||
260 | */ | ||
261 | public static class Matcher extends BaseMatcher<ThreeUCubeSatWithNonUhfCrossLink.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 ThreeUCubeSatWithNonUhfCrossLink.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 ThreeUCubeSatWithNonUhfCrossLink.Matcher create() { | ||
286 | return new Matcher(); | ||
287 | } | ||
288 | |||
289 | private static final int POSITION_SAT = 0; | ||
290 | |||
291 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ThreeUCubeSatWithNonUhfCrossLink.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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
308 | * @return matches represented as a Match object. | ||
309 | * | ||
310 | */ | ||
311 | public Collection<ThreeUCubeSatWithNonUhfCrossLink.Match> getAllMatches(final CubeSat3U pSat) { | ||
312 | return rawStreamAllMatches(new Object[]{pSat}).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 pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
322 | * @return a stream of matches represented as a Match object. | ||
323 | * | ||
324 | */ | ||
325 | public Stream<ThreeUCubeSatWithNonUhfCrossLink.Match> streamAllMatches(final CubeSat3U pSat) { | ||
326 | return rawStreamAllMatches(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, 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<ThreeUCubeSatWithNonUhfCrossLink.Match> getOneArbitraryMatch(final CubeSat3U pSat) { | ||
337 | return rawGetOneArbitraryMatch(new Object[]{pSat}); | ||
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 pSat the fixed value of pattern parameter Sat, 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(final CubeSat3U pSat) { | ||
348 | return rawHasMatch(new Object[]{pSat}); | ||
349 | } | ||
350 | |||
351 | /** | ||
352 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
353 | * @param pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
354 | * @return the number of pattern matches found. | ||
355 | * | ||
356 | */ | ||
357 | public int countMatches(final CubeSat3U pSat) { | ||
358 | return rawCountMatches(new Object[]{pSat}); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
363 | * Neither determinism nor randomness of selection is guaranteed. | ||
364 | * @param pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
365 | * @param processor the action that will process the selected match. | ||
366 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
367 | * | ||
368 | */ | ||
369 | public boolean forOneArbitraryMatch(final CubeSat3U pSat, final Consumer<? super ThreeUCubeSatWithNonUhfCrossLink.Match> processor) { | ||
370 | return rawForOneArbitraryMatch(new Object[]{pSat}, processor); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Returns a new (partial) match. | ||
375 | * This can be used e.g. to call the matcher with a partial match. | ||
376 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
377 | * @param pSat the fixed value of pattern parameter Sat, or null if not bound. | ||
378 | * @return the (partial) match object. | ||
379 | * | ||
380 | */ | ||
381 | public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) { | ||
382 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch(pSat); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for Sat. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | protected Stream<CubeSat3U> rawStreamAllValuesOfSat(final Object[] parameters) { | ||
391 | return rawStreamAllValues(POSITION_SAT, parameters).map(CubeSat3U.class::cast); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for Sat. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Set<CubeSat3U> getAllValuesOfSat() { | ||
400 | return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet()); | ||
401 | } | ||
402 | |||
403 | /** | ||
404 | * Retrieve the set of values that occur in matches for Sat. | ||
405 | * @return the Set of all values or empty set if there are no matches | ||
406 | * | ||
407 | */ | ||
408 | public Stream<CubeSat3U> streamAllValuesOfSat() { | ||
409 | return rawStreamAllValuesOfSat(emptyArray()); | ||
410 | } | ||
411 | |||
412 | @Override | ||
413 | protected ThreeUCubeSatWithNonUhfCrossLink.Match tupleToMatch(final Tuple t) { | ||
414 | try { | ||
415 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) t.get(POSITION_SAT)); | ||
416 | } catch(ClassCastException e) { | ||
417 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
418 | return null; | ||
419 | } | ||
420 | } | ||
421 | |||
422 | @Override | ||
423 | protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatch(final Object[] match) { | ||
424 | try { | ||
425 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) match[POSITION_SAT]); | ||
426 | } catch(ClassCastException e) { | ||
427 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
428 | return null; | ||
429 | } | ||
430 | } | ||
431 | |||
432 | @Override | ||
433 | protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatchMutable(final Object[] match) { | ||
434 | try { | ||
435 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newMutableMatch((CubeSat3U) match[POSITION_SAT]); | ||
436 | } catch(ClassCastException e) { | ||
437 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
438 | return null; | ||
439 | } | ||
440 | } | ||
441 | |||
442 | /** | ||
443 | * @return the singleton instance of the query specification of this pattern | ||
444 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
445 | * | ||
446 | */ | ||
447 | public static IQuerySpecification<ThreeUCubeSatWithNonUhfCrossLink.Matcher> querySpecification() { | ||
448 | return ThreeUCubeSatWithNonUhfCrossLink.instance(); | ||
449 | } | ||
450 | } | ||
451 | |||
452 | private ThreeUCubeSatWithNonUhfCrossLink() { | ||
453 | super(GeneratedPQuery.INSTANCE); | ||
454 | } | ||
455 | |||
456 | /** | ||
457 | * @return the singleton instance of the query specification | ||
458 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
459 | * | ||
460 | */ | ||
461 | public static ThreeUCubeSatWithNonUhfCrossLink instance() { | ||
462 | try{ | ||
463 | return LazyHolder.INSTANCE; | ||
464 | } catch (ExceptionInInitializerError err) { | ||
465 | throw processInitializerError(err); | ||
466 | } | ||
467 | } | ||
468 | |||
469 | @Override | ||
470 | protected ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate(final ViatraQueryEngine engine) { | ||
471 | return ThreeUCubeSatWithNonUhfCrossLink.Matcher.on(engine); | ||
472 | } | ||
473 | |||
474 | @Override | ||
475 | public ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate() { | ||
476 | return ThreeUCubeSatWithNonUhfCrossLink.Matcher.create(); | ||
477 | } | ||
478 | |||
479 | @Override | ||
480 | public ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() { | ||
481 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newEmptyMatch(); | ||
482 | } | ||
483 | |||
484 | @Override | ||
485 | public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Object... parameters) { | ||
486 | return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((satellite.CubeSat3U) parameters[0]); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
491 | * <b>not</b> at the class load time of the outer class, | ||
492 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
493 | * | ||
494 | * <p> This workaround is required e.g. to support recursion. | ||
495 | * | ||
496 | */ | ||
497 | private static class LazyHolder { | ||
498 | private static final ThreeUCubeSatWithNonUhfCrossLink INSTANCE = new ThreeUCubeSatWithNonUhfCrossLink(); | ||
499 | |||
500 | /** | ||
501 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
502 | * This initialization order is required to support indirect recursion. | ||
503 | * | ||
504 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
505 | * | ||
506 | */ | ||
507 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
508 | |||
509 | public static Object ensureInitialized() { | ||
510 | INSTANCE.ensureInitializedInternal(); | ||
511 | return null; | ||
512 | } | ||
513 | } | ||
514 | |||
515 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
516 | private static final ThreeUCubeSatWithNonUhfCrossLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
517 | |||
518 | private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); | ||
519 | |||
520 | private final List<PParameter> parameters = Arrays.asList(parameter_Sat); | ||
521 | |||
522 | private GeneratedPQuery() { | ||
523 | super(PVisibility.PUBLIC); | ||
524 | } | ||
525 | |||
526 | @Override | ||
527 | public String getFullyQualifiedName() { | ||
528 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink"; | ||
529 | } | ||
530 | |||
531 | @Override | ||
532 | public List<String> getParameterNames() { | ||
533 | return Arrays.asList("Sat"); | ||
534 | } | ||
535 | |||
536 | @Override | ||
537 | public List<PParameter> getParameters() { | ||
538 | return parameters; | ||
539 | } | ||
540 | |||
541 | @Override | ||
542 | public Set<PBody> doGetContainedBodies() { | ||
543 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
544 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
545 | { | ||
546 | PBody body = new PBody(this); | ||
547 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
548 | PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm"); | ||
549 | PVariable var_TargetComm = body.getOrCreateVariableByName("TargetComm"); | ||
550 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
551 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
552 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
553 | new ExportedParameter(body, var_Sat, parameter_Sat) | ||
554 | )); | ||
555 | // CommunicatingElement.commSubsystem(Sat, SourceComm) | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
557 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
559 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
560 | new Equality(body, var__virtual_0_, var_SourceComm); | ||
561 | // neg find commSubsystemBandUhf(SourceComm) | ||
562 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation()); | ||
563 | // CommSubsystem.target(SourceComm, TargetComm) | ||
564 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
565 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
566 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); | ||
567 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
568 | new Equality(body, var__virtual_1_, var_TargetComm); | ||
569 | // CommunicatingElement.commSubsystem(Target, TargetComm) | ||
570 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
571 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
572 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
573 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
574 | new Equality(body, var__virtual_2_, var_TargetComm); | ||
575 | // neg find groundStationNetwork(Target) | ||
576 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation()); | ||
577 | bodies.add(body); | ||
578 | } | ||
579 | { | ||
580 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
581 | annotation.addAttribute("severity", "error"); | ||
582 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
583 | new ParameterReference("Sat") | ||
584 | })); | ||
585 | annotation.addAttribute("message", "3U CubeSats can only cross-link using UHF."); | ||
586 | addAnnotation(annotation); | ||
587 | } | ||
588 | return bodies; | ||
589 | } | ||
590 | } | ||
591 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace deleted file mode 100644 index 09c00a25..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace +++ /dev/null | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace deleted file mode 100644 index 8b57b000..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace +++ /dev/null | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore deleted file mode 100644 index 2f9ae41d..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /.CommunicationLink.java._trace | ||
2 | /.SatelliteQueriesAll.java._trace | ||
3 | /.IndirectCommunicationLink.java._trace | ||
4 | /.DirectCommunicationLink.java._trace | ||
5 | /.SpacecraftWithInterferometryPayload.java._trace | ||
6 | /.SingleInterferometryPayload.java._trace | ||
7 | /.AtLeastTwoInterferometryPayloads.java._trace | ||
8 | /.DirectCommunicationLink2.java._trace | ||
9 | /.CommSubsystemBand.java._trace | ||
10 | /.CommSubsystemGain.java._trace | ||
11 | /.GroundStationNetwork.java._trace | ||
12 | /.SmallSat.java._trace | ||
13 | /.CommSubsystemGainLow.java._trace | ||
14 | /.CommSubsystemGainMedium.java._trace | ||
15 | /.CommSubsystemBandUhf.java._trace | ||
16 | /.MissionCoverage.java._trace | ||
17 | /.SatelliteMetricsAll.java._trace | ||
18 | /.MissionTime.java._trace | ||
19 | /.TimeMetric.java._trace | ||
20 | /.TransmitTime.java._trace | ||
21 | /.TransmitRate.java._trace | ||
22 | /.SpacecraftUplink.java._trace | ||
23 | /.MissionScienceData.java._trace | ||
24 | /.IndirectScienceData.java._trace | ||
25 | /.ScienceData.java._trace | ||
26 | /.IncomingData.java._trace | ||
27 | /.MissionCost.java._trace | ||
28 | /.BasePrice.java._trace | ||
29 | /.SpacecraftOfKind.java._trace | ||
30 | /.InterferometryPayloadCost.java._trace | ||
31 | /.AdditionalCommSubsystemCost.java._trace | ||
32 | /.SpacecraftWithTwoCommSubsystems.java._trace | ||
33 | /.SpacecraftCost.java._trace | ||
34 | /.CrossLinkAllowed.java._trace | ||
35 | /.MatchingAntenna.java._trace | ||
36 | /.CubeSat3U.java._trace | ||
37 | /.LinkAllowed.java._trace | ||
38 | /.IndirectLinkAllowed.java._trace | ||
39 | /AdditionalCommSubsystemCost.java | ||
40 | /AtLeastTwoInterferometryPayloads.java | ||
41 | /BasePrice.java | ||
42 | /CommSubsystemBand.java | ||
43 | /CommSubsystemBandUhf.java | ||
44 | /CommSubsystemGain.java | ||
45 | /CommSubsystemGainLow.java | ||
46 | /CommSubsystemGainMedium.java | ||
47 | /CubeSat3U.java | ||
48 | /DirectCommunicationLink.java | ||
49 | /GroundStationNetwork.java | ||
50 | /IncomingData.java | ||
51 | /IndirectCommunicationLink.java | ||
52 | /IndirectLinkAllowed.java | ||
53 | /InterferometryPayloadCost.java | ||
54 | /LinkAllowed.java | ||
55 | /MatchingAntenna.java | ||
56 | /MissionCost.java | ||
57 | /MissionCoverage.java | ||
58 | /MissionTime.java | ||
59 | /SatelliteQueriesAll.java | ||
60 | /ScienceData.java | ||
61 | /SpacecraftCost.java | ||
62 | /SpacecraftUplink.java | ||
63 | /SpacecraftWithInterferometryPayload.java | ||
64 | /SpacecraftWithTwoCommSubsystems.java | ||
65 | /TransmitRate.java | ||
66 | /TransmitTime.java | ||
67 | /.CubeSat6U.java._trace | ||
68 | /.MatchingCommSubsystem.java._trace | ||
69 | /.TransmittingCommSubsystem.java._trace | ||
70 | /.SpacecraftOfKindCount.java._trace | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java deleted file mode 100644 index 58e7e183..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java +++ /dev/null | |||
@@ -1,138 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
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.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
26 | |||
27 | /** | ||
28 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
29 | * | ||
30 | * <p>Original source: | ||
31 | * <code><pre> | ||
32 | * private pattern atLeastTwoInterferometryPayloads(Mission : InterferometryMission) { | ||
33 | * find spacecraftWithInterferometryPayload(Mission, Spacecraft1); | ||
34 | * find spacecraftWithInterferometryPayload(Mission, Spacecraft2); | ||
35 | * Spacecraft1 != Spacecraft2; | ||
36 | * } | ||
37 | * </pre></code> | ||
38 | * | ||
39 | * @see GenericPatternMatcher | ||
40 | * @see GenericPatternMatch | ||
41 | * | ||
42 | */ | ||
43 | @SuppressWarnings("all") | ||
44 | public final class AtLeastTwoInterferometryPayloads extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
45 | private AtLeastTwoInterferometryPayloads() { | ||
46 | super(GeneratedPQuery.INSTANCE); | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * @return the singleton instance of the query specification | ||
51 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
52 | * | ||
53 | */ | ||
54 | public static AtLeastTwoInterferometryPayloads instance() { | ||
55 | try{ | ||
56 | return LazyHolder.INSTANCE; | ||
57 | } catch (ExceptionInInitializerError err) { | ||
58 | throw processInitializerError(err); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads (visibility: PUBLIC, simpleName: AtLeastTwoInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads, 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 | ||
64 | * <b>not</b> at the class load time of the outer class, | ||
65 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads (visibility: PUBLIC, simpleName: AtLeastTwoInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads, 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()}. | ||
66 | * | ||
67 | * <p> This workaround is required e.g. to support recursion. | ||
68 | * | ||
69 | */ | ||
70 | private static class LazyHolder { | ||
71 | private static final AtLeastTwoInterferometryPayloads INSTANCE = new AtLeastTwoInterferometryPayloads(); | ||
72 | |||
73 | /** | ||
74 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
75 | * This initialization order is required to support indirect recursion. | ||
76 | * | ||
77 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
78 | * | ||
79 | */ | ||
80 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
81 | |||
82 | public static Object ensureInitialized() { | ||
83 | INSTANCE.ensureInitializedInternal(); | ||
84 | return null; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
89 | private static final AtLeastTwoInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
90 | |||
91 | private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); | ||
92 | |||
93 | private final List<PParameter> parameters = Arrays.asList(parameter_Mission); | ||
94 | |||
95 | private GeneratedPQuery() { | ||
96 | super(PVisibility.PRIVATE); | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public String getFullyQualifiedName() { | ||
101 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.atLeastTwoInterferometryPayloads"; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<String> getParameterNames() { | ||
106 | return Arrays.asList("Mission"); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public List<PParameter> getParameters() { | ||
111 | return parameters; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public Set<PBody> doGetContainedBodies() { | ||
116 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
117 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
118 | { | ||
119 | PBody body = new PBody(this); | ||
120 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
121 | PVariable var_Spacecraft1 = body.getOrCreateVariableByName("Spacecraft1"); | ||
122 | PVariable var_Spacecraft2 = body.getOrCreateVariableByName("Spacecraft2"); | ||
123 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission"))); | ||
124 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
125 | new ExportedParameter(body, var_Mission, parameter_Mission) | ||
126 | )); | ||
127 | // find spacecraftWithInterferometryPayload(Mission, Spacecraft1) | ||
128 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Mission, var_Spacecraft1), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation()); | ||
129 | // find spacecraftWithInterferometryPayload(Mission, Spacecraft2) | ||
130 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Mission, var_Spacecraft2), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation()); | ||
131 | // Spacecraft1 != Spacecraft2 | ||
132 | new Inequality(body, var_Spacecraft1, var_Spacecraft2); | ||
133 | bodies.add(body); | ||
134 | } | ||
135 | return bodies; | ||
136 | } | ||
137 | } | ||
138 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java deleted file mode 100644 index 6acd73c3..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java +++ /dev/null | |||
@@ -1,127 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
23 | |||
24 | /** | ||
25 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
26 | * | ||
27 | * <p>Original source: | ||
28 | * <code><pre> | ||
29 | * private pattern commSubsystemBandUhf(Comm : UHFCommSubsystem) { | ||
30 | * UHFCommSubsystem(Comm); | ||
31 | * } | ||
32 | * </pre></code> | ||
33 | * | ||
34 | * @see GenericPatternMatcher | ||
35 | * @see GenericPatternMatch | ||
36 | * | ||
37 | */ | ||
38 | @SuppressWarnings("all") | ||
39 | public final class CommSubsystemBandUhf extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
40 | private CommSubsystemBandUhf() { | ||
41 | super(GeneratedPQuery.INSTANCE); | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * @return the singleton instance of the query specification | ||
46 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
47 | * | ||
48 | */ | ||
49 | public static CommSubsystemBandUhf instance() { | ||
50 | try{ | ||
51 | return LazyHolder.INSTANCE; | ||
52 | } catch (ExceptionInInitializerError err) { | ||
53 | throw processInitializerError(err); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf (visibility: PUBLIC, simpleName: CommSubsystemBandUhf, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf, 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 | ||
59 | * <b>not</b> at the class load time of the outer class, | ||
60 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf (visibility: PUBLIC, simpleName: CommSubsystemBandUhf, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf, 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()}. | ||
61 | * | ||
62 | * <p> This workaround is required e.g. to support recursion. | ||
63 | * | ||
64 | */ | ||
65 | private static class LazyHolder { | ||
66 | private static final CommSubsystemBandUhf INSTANCE = new CommSubsystemBandUhf(); | ||
67 | |||
68 | /** | ||
69 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
70 | * This initialization order is required to support indirect recursion. | ||
71 | * | ||
72 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
73 | * | ||
74 | */ | ||
75 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
76 | |||
77 | public static Object ensureInitialized() { | ||
78 | INSTANCE.ensureInitializedInternal(); | ||
79 | return null; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
84 | private static final CommSubsystemBandUhf.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
85 | |||
86 | private final PParameter parameter_Comm = new PParameter("Comm", "satellite.UHFCommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "UHFCommSubsystem")), PParameterDirection.INOUT); | ||
87 | |||
88 | private final List<PParameter> parameters = Arrays.asList(parameter_Comm); | ||
89 | |||
90 | private GeneratedPQuery() { | ||
91 | super(PVisibility.PRIVATE); | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public String getFullyQualifiedName() { | ||
96 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.commSubsystemBandUhf"; | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public List<String> getParameterNames() { | ||
101 | return Arrays.asList("Comm"); | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<PParameter> getParameters() { | ||
106 | return parameters; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public Set<PBody> doGetContainedBodies() { | ||
111 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
112 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
113 | { | ||
114 | PBody body = new PBody(this); | ||
115 | PVariable var_Comm = body.getOrCreateVariableByName("Comm"); | ||
116 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem"))); | ||
117 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
118 | new ExportedParameter(body, var_Comm, parameter_Comm) | ||
119 | )); | ||
120 | // UHFCommSubsystem(Comm) | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem"))); | ||
122 | bodies.add(body); | ||
123 | } | ||
124 | return bodies; | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java deleted file mode 100644 index acc60475..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java +++ /dev/null | |||
@@ -1,127 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
23 | |||
24 | /** | ||
25 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
26 | * | ||
27 | * <p>Original source: | ||
28 | * <code><pre> | ||
29 | * private pattern cubeSat3U(Sat : CubeSat3U) { | ||
30 | * CubeSat3U(Sat); | ||
31 | * } | ||
32 | * </pre></code> | ||
33 | * | ||
34 | * @see GenericPatternMatcher | ||
35 | * @see GenericPatternMatch | ||
36 | * | ||
37 | */ | ||
38 | @SuppressWarnings("all") | ||
39 | public final class CubeSat3U extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
40 | private CubeSat3U() { | ||
41 | super(GeneratedPQuery.INSTANCE); | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * @return the singleton instance of the query specification | ||
46 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
47 | * | ||
48 | */ | ||
49 | public static CubeSat3U instance() { | ||
50 | try{ | ||
51 | return LazyHolder.INSTANCE; | ||
52 | } catch (ExceptionInInitializerError err) { | ||
53 | throw processInitializerError(err); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U (visibility: PUBLIC, simpleName: CubeSat3U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U, 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 | ||
59 | * <b>not</b> at the class load time of the outer class, | ||
60 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U (visibility: PUBLIC, simpleName: CubeSat3U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U, 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()}. | ||
61 | * | ||
62 | * <p> This workaround is required e.g. to support recursion. | ||
63 | * | ||
64 | */ | ||
65 | private static class LazyHolder { | ||
66 | private static final CubeSat3U INSTANCE = new CubeSat3U(); | ||
67 | |||
68 | /** | ||
69 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
70 | * This initialization order is required to support indirect recursion. | ||
71 | * | ||
72 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
73 | * | ||
74 | */ | ||
75 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
76 | |||
77 | public static Object ensureInitialized() { | ||
78 | INSTANCE.ensureInitializedInternal(); | ||
79 | return null; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
84 | private static final CubeSat3U.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
85 | |||
86 | private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); | ||
87 | |||
88 | private final List<PParameter> parameters = Arrays.asList(parameter_Sat); | ||
89 | |||
90 | private GeneratedPQuery() { | ||
91 | super(PVisibility.PRIVATE); | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public String getFullyQualifiedName() { | ||
96 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSat3U"; | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public List<String> getParameterNames() { | ||
101 | return Arrays.asList("Sat"); | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<PParameter> getParameters() { | ||
106 | return parameters; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public Set<PBody> doGetContainedBodies() { | ||
111 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
112 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
113 | { | ||
114 | PBody body = new PBody(this); | ||
115 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
116 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
117 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
118 | new ExportedParameter(body, var_Sat, parameter_Sat) | ||
119 | )); | ||
120 | // CubeSat3U(Sat) | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
122 | bodies.add(body); | ||
123 | } | ||
124 | return bodies; | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java deleted file mode 100644 index e4526a02..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java +++ /dev/null | |||
@@ -1,127 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
23 | |||
24 | /** | ||
25 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
26 | * | ||
27 | * <p>Original source: | ||
28 | * <code><pre> | ||
29 | * private pattern cubeSat6U(Sat : CubeSat6U) { | ||
30 | * CubeSat6U(Sat); | ||
31 | * } | ||
32 | * </pre></code> | ||
33 | * | ||
34 | * @see GenericPatternMatcher | ||
35 | * @see GenericPatternMatch | ||
36 | * | ||
37 | */ | ||
38 | @SuppressWarnings("all") | ||
39 | public final class CubeSat6U extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
40 | private CubeSat6U() { | ||
41 | super(GeneratedPQuery.INSTANCE); | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * @return the singleton instance of the query specification | ||
46 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
47 | * | ||
48 | */ | ||
49 | public static CubeSat6U instance() { | ||
50 | try{ | ||
51 | return LazyHolder.INSTANCE; | ||
52 | } catch (ExceptionInInitializerError err) { | ||
53 | throw processInitializerError(err); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U (visibility: PUBLIC, simpleName: CubeSat6U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U, 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 | ||
59 | * <b>not</b> at the class load time of the outer class, | ||
60 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U (visibility: PUBLIC, simpleName: CubeSat6U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U, 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()}. | ||
61 | * | ||
62 | * <p> This workaround is required e.g. to support recursion. | ||
63 | * | ||
64 | */ | ||
65 | private static class LazyHolder { | ||
66 | private static final CubeSat6U INSTANCE = new CubeSat6U(); | ||
67 | |||
68 | /** | ||
69 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
70 | * This initialization order is required to support indirect recursion. | ||
71 | * | ||
72 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
73 | * | ||
74 | */ | ||
75 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
76 | |||
77 | public static Object ensureInitialized() { | ||
78 | INSTANCE.ensureInitializedInternal(); | ||
79 | return null; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
84 | private static final CubeSat6U.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
85 | |||
86 | private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat6U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat6U")), PParameterDirection.INOUT); | ||
87 | |||
88 | private final List<PParameter> parameters = Arrays.asList(parameter_Sat); | ||
89 | |||
90 | private GeneratedPQuery() { | ||
91 | super(PVisibility.PRIVATE); | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public String getFullyQualifiedName() { | ||
96 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSat6U"; | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public List<String> getParameterNames() { | ||
101 | return Arrays.asList("Sat"); | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<PParameter> getParameters() { | ||
106 | return parameters; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public Set<PBody> doGetContainedBodies() { | ||
111 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
112 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
113 | { | ||
114 | PBody body = new PBody(this); | ||
115 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | ||
116 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U"))); | ||
117 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
118 | new ExportedParameter(body, var_Sat, parameter_Sat) | ||
119 | )); | ||
120 | // CubeSat6U(Sat) | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U"))); | ||
122 | bodies.add(body); | ||
123 | } | ||
124 | return bodies; | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java deleted file mode 100644 index ee4d8715..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java +++ /dev/null | |||
@@ -1,154 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
32 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); | ||
33 | * CommunicatingElement.commSubsystem(Source, SourceSubsystem); | ||
34 | * CommunicatingElement.commSubsystem(Target, TargetSubsystem); | ||
35 | * } | ||
36 | * </pre></code> | ||
37 | * | ||
38 | * @see GenericPatternMatcher | ||
39 | * @see GenericPatternMatch | ||
40 | * | ||
41 | */ | ||
42 | @SuppressWarnings("all") | ||
43 | public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
44 | private DirectCommunicationLink() { | ||
45 | super(GeneratedPQuery.INSTANCE); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @return the singleton instance of the query specification | ||
50 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
51 | * | ||
52 | */ | ||
53 | public static DirectCommunicationLink instance() { | ||
54 | try{ | ||
55 | return LazyHolder.INSTANCE; | ||
56 | } catch (ExceptionInInitializerError err) { | ||
57 | throw processInitializerError(err); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, 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 | ||
63 | * <b>not</b> at the class load time of the outer class, | ||
64 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, 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()}. | ||
65 | * | ||
66 | * <p> This workaround is required e.g. to support recursion. | ||
67 | * | ||
68 | */ | ||
69 | private static class LazyHolder { | ||
70 | private static final DirectCommunicationLink INSTANCE = new DirectCommunicationLink(); | ||
71 | |||
72 | /** | ||
73 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
74 | * This initialization order is required to support indirect recursion. | ||
75 | * | ||
76 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
77 | * | ||
78 | */ | ||
79 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
80 | |||
81 | public static Object ensureInitialized() { | ||
82 | INSTANCE.ensureInitializedInternal(); | ||
83 | return null; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
88 | private static final DirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
89 | |||
90 | private final PParameter parameter_Source = new PParameter("Source", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
91 | |||
92 | private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
93 | |||
94 | private final List<PParameter> parameters = Arrays.asList(parameter_Source, parameter_Target); | ||
95 | |||
96 | private GeneratedPQuery() { | ||
97 | super(PVisibility.PRIVATE); | ||
98 | } | ||
99 | |||
100 | @Override | ||
101 | public String getFullyQualifiedName() { | ||
102 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.directCommunicationLink"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> getParameterNames() { | ||
107 | return Arrays.asList("Source","Target"); | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<PParameter> getParameters() { | ||
112 | return parameters; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Set<PBody> doGetContainedBodies() { | ||
117 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
118 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
119 | { | ||
120 | PBody body = new PBody(this); | ||
121 | PVariable var_Source = body.getOrCreateVariableByName("Source"); | ||
122 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
123 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | ||
124 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | ||
125 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
126 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
127 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
128 | new ExportedParameter(body, var_Source, parameter_Source), | ||
129 | new ExportedParameter(body, var_Target, parameter_Target) | ||
130 | )); | ||
131 | // CommSubsystem.target(SourceSubsystem, TargetSubsystem) | ||
132 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
133 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); | ||
135 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
136 | new Equality(body, var__virtual_0_, var_TargetSubsystem); | ||
137 | // CommunicatingElement.commSubsystem(Source, SourceSubsystem) | ||
138 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
139 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
140 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
141 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
142 | new Equality(body, var__virtual_1_, var_SourceSubsystem); | ||
143 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem) | ||
144 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
145 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
146 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
147 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
148 | new Equality(body, var__virtual_2_, var_TargetSubsystem); | ||
149 | bodies.add(body); | ||
150 | } | ||
151 | return bodies; | ||
152 | } | ||
153 | } | ||
154 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java deleted file mode 100644 index 606cdfed..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java +++ /dev/null | |||
@@ -1,127 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
23 | |||
24 | /** | ||
25 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
26 | * | ||
27 | * <p>Original source: | ||
28 | * <code><pre> | ||
29 | * private pattern groundStationNetwork(Network : GroundStationNetwork) { | ||
30 | * GroundStationNetwork(Network); | ||
31 | * } | ||
32 | * </pre></code> | ||
33 | * | ||
34 | * @see GenericPatternMatcher | ||
35 | * @see GenericPatternMatch | ||
36 | * | ||
37 | */ | ||
38 | @SuppressWarnings("all") | ||
39 | public final class GroundStationNetwork extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
40 | private GroundStationNetwork() { | ||
41 | super(GeneratedPQuery.INSTANCE); | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * @return the singleton instance of the query specification | ||
46 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
47 | * | ||
48 | */ | ||
49 | public static GroundStationNetwork instance() { | ||
50 | try{ | ||
51 | return LazyHolder.INSTANCE; | ||
52 | } catch (ExceptionInInitializerError err) { | ||
53 | throw processInitializerError(err); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork (visibility: PUBLIC, simpleName: GroundStationNetwork, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork, 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 | ||
59 | * <b>not</b> at the class load time of the outer class, | ||
60 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork (visibility: PUBLIC, simpleName: GroundStationNetwork, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork, 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()}. | ||
61 | * | ||
62 | * <p> This workaround is required e.g. to support recursion. | ||
63 | * | ||
64 | */ | ||
65 | private static class LazyHolder { | ||
66 | private static final GroundStationNetwork INSTANCE = new GroundStationNetwork(); | ||
67 | |||
68 | /** | ||
69 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
70 | * This initialization order is required to support indirect recursion. | ||
71 | * | ||
72 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
73 | * | ||
74 | */ | ||
75 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
76 | |||
77 | public static Object ensureInitialized() { | ||
78 | INSTANCE.ensureInitializedInternal(); | ||
79 | return null; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
84 | private static final GroundStationNetwork.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
85 | |||
86 | private final PParameter parameter_Network = new PParameter("Network", "satellite.GroundStationNetwork", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "GroundStationNetwork")), PParameterDirection.INOUT); | ||
87 | |||
88 | private final List<PParameter> parameters = Arrays.asList(parameter_Network); | ||
89 | |||
90 | private GeneratedPQuery() { | ||
91 | super(PVisibility.PRIVATE); | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public String getFullyQualifiedName() { | ||
96 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.groundStationNetwork"; | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public List<String> getParameterNames() { | ||
101 | return Arrays.asList("Network"); | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<PParameter> getParameters() { | ||
106 | return parameters; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public Set<PBody> doGetContainedBodies() { | ||
111 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
112 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
113 | { | ||
114 | PBody body = new PBody(this); | ||
115 | PVariable var_Network = body.getOrCreateVariableByName("Network"); | ||
116 | new TypeConstraint(body, Tuples.flatTupleOf(var_Network), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork"))); | ||
117 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
118 | new ExportedParameter(body, var_Network, parameter_Network) | ||
119 | )); | ||
120 | // GroundStationNetwork(Network) | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Network), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork"))); | ||
122 | bodies.add(body); | ||
123 | } | ||
124 | return bodies; | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java deleted file mode 100644 index dee8a83c..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java +++ /dev/null | |||
@@ -1,134 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
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.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern indirectCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
32 | * find directCommunicationLink+(Source, Target); | ||
33 | * } | ||
34 | * </pre></code> | ||
35 | * | ||
36 | * @see GenericPatternMatcher | ||
37 | * @see GenericPatternMatch | ||
38 | * | ||
39 | */ | ||
40 | @SuppressWarnings("all") | ||
41 | public final class IndirectCommunicationLink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
42 | private IndirectCommunicationLink() { | ||
43 | super(GeneratedPQuery.INSTANCE); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * @return the singleton instance of the query specification | ||
48 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
49 | * | ||
50 | */ | ||
51 | public static IndirectCommunicationLink instance() { | ||
52 | try{ | ||
53 | return LazyHolder.INSTANCE; | ||
54 | } catch (ExceptionInInitializerError err) { | ||
55 | throw processInitializerError(err); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink (visibility: PUBLIC, simpleName: IndirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink, 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 | ||
61 | * <b>not</b> at the class load time of the outer class, | ||
62 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink (visibility: PUBLIC, simpleName: IndirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink, 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()}. | ||
63 | * | ||
64 | * <p> This workaround is required e.g. to support recursion. | ||
65 | * | ||
66 | */ | ||
67 | private static class LazyHolder { | ||
68 | private static final IndirectCommunicationLink INSTANCE = new IndirectCommunicationLink(); | ||
69 | |||
70 | /** | ||
71 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
72 | * This initialization order is required to support indirect recursion. | ||
73 | * | ||
74 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
75 | * | ||
76 | */ | ||
77 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
78 | |||
79 | public static Object ensureInitialized() { | ||
80 | INSTANCE.ensureInitializedInternal(); | ||
81 | return null; | ||
82 | } | ||
83 | } | ||
84 | |||
85 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
86 | private static final IndirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
87 | |||
88 | private final PParameter parameter_Source = new PParameter("Source", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
89 | |||
90 | private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
91 | |||
92 | private final List<PParameter> parameters = Arrays.asList(parameter_Source, parameter_Target); | ||
93 | |||
94 | private GeneratedPQuery() { | ||
95 | super(PVisibility.PRIVATE); | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public String getFullyQualifiedName() { | ||
100 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.indirectCommunicationLink"; | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public List<String> getParameterNames() { | ||
105 | return Arrays.asList("Source","Target"); | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<PParameter> getParameters() { | ||
110 | return parameters; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public Set<PBody> doGetContainedBodies() { | ||
115 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
116 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
117 | { | ||
118 | PBody body = new PBody(this); | ||
119 | PVariable var_Source = body.getOrCreateVariableByName("Source"); | ||
120 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
122 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
123 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
124 | new ExportedParameter(body, var_Source, parameter_Source), | ||
125 | new ExportedParameter(body, var_Target, parameter_Target) | ||
126 | )); | ||
127 | // find directCommunicationLink+(Source, Target) | ||
128 | new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_Source, var_Target), DirectCommunicationLink.instance().getInternalQueryRepresentation()); | ||
129 | bodies.add(body); | ||
130 | } | ||
131 | return bodies; | ||
132 | } | ||
133 | } | ||
134 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java deleted file mode 100644 index 31381a09..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java +++ /dev/null | |||
@@ -1,134 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
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.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
32 | * find linkAllowed+(From, To); | ||
33 | * } | ||
34 | * </pre></code> | ||
35 | * | ||
36 | * @see GenericPatternMatcher | ||
37 | * @see GenericPatternMatch | ||
38 | * | ||
39 | */ | ||
40 | @SuppressWarnings("all") | ||
41 | public final class IndirectLinkAllowed extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
42 | private IndirectLinkAllowed() { | ||
43 | super(GeneratedPQuery.INSTANCE); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * @return the singleton instance of the query specification | ||
48 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
49 | * | ||
50 | */ | ||
51 | public static IndirectLinkAllowed instance() { | ||
52 | try{ | ||
53 | return LazyHolder.INSTANCE; | ||
54 | } catch (ExceptionInInitializerError err) { | ||
55 | throw processInitializerError(err); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed (visibility: PUBLIC, simpleName: IndirectLinkAllowed, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed, 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 | ||
61 | * <b>not</b> at the class load time of the outer class, | ||
62 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed (visibility: PUBLIC, simpleName: IndirectLinkAllowed, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed, 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()}. | ||
63 | * | ||
64 | * <p> This workaround is required e.g. to support recursion. | ||
65 | * | ||
66 | */ | ||
67 | private static class LazyHolder { | ||
68 | private static final IndirectLinkAllowed INSTANCE = new IndirectLinkAllowed(); | ||
69 | |||
70 | /** | ||
71 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
72 | * This initialization order is required to support indirect recursion. | ||
73 | * | ||
74 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
75 | * | ||
76 | */ | ||
77 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
78 | |||
79 | public static Object ensureInitialized() { | ||
80 | INSTANCE.ensureInitializedInternal(); | ||
81 | return null; | ||
82 | } | ||
83 | } | ||
84 | |||
85 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
86 | private static final IndirectLinkAllowed.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
87 | |||
88 | private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
89 | |||
90 | private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
91 | |||
92 | private final List<PParameter> parameters = Arrays.asList(parameter_From, parameter_To); | ||
93 | |||
94 | private GeneratedPQuery() { | ||
95 | super(PVisibility.PRIVATE); | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public String getFullyQualifiedName() { | ||
100 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.indirectLinkAllowed"; | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public List<String> getParameterNames() { | ||
105 | return Arrays.asList("From","To"); | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<PParameter> getParameters() { | ||
110 | return parameters; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public Set<PBody> doGetContainedBodies() { | ||
115 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
116 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
117 | { | ||
118 | PBody body = new PBody(this); | ||
119 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
120 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
122 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
123 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
124 | new ExportedParameter(body, var_From, parameter_From), | ||
125 | new ExportedParameter(body, var_To, parameter_To) | ||
126 | )); | ||
127 | // find linkAllowed+(From, To) | ||
128 | new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_From, var_To), LinkAllowed.instance().getInternalQueryRepresentation()); | ||
129 | bodies.add(body); | ||
130 | } | ||
131 | return bodies; | ||
132 | } | ||
133 | } | ||
134 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java deleted file mode 100644 index c3f6bb82..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java +++ /dev/null | |||
@@ -1,180 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
27 | |||
28 | /** | ||
29 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
30 | * | ||
31 | * <p>Original source: | ||
32 | * <code><pre> | ||
33 | * private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
34 | * find matchingAntenna(From, To); | ||
35 | * neg find cubeSat3U(From); | ||
36 | * } or { | ||
37 | * find matchingAntenna(From, To); | ||
38 | * CubeSat3U(From); | ||
39 | * } or { | ||
40 | * find matchingAntenna(From, To); | ||
41 | * CubeSat3U(From); | ||
42 | * GroundStationNetwork(To); | ||
43 | * } | ||
44 | * </pre></code> | ||
45 | * | ||
46 | * @see GenericPatternMatcher | ||
47 | * @see GenericPatternMatch | ||
48 | * | ||
49 | */ | ||
50 | @SuppressWarnings("all") | ||
51 | public final class LinkAllowed extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
52 | private LinkAllowed() { | ||
53 | super(GeneratedPQuery.INSTANCE); | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * @return the singleton instance of the query specification | ||
58 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
59 | * | ||
60 | */ | ||
61 | public static LinkAllowed instance() { | ||
62 | try{ | ||
63 | return LazyHolder.INSTANCE; | ||
64 | } catch (ExceptionInInitializerError err) { | ||
65 | throw processInitializerError(err); | ||
66 | } | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed (visibility: PUBLIC, simpleName: LinkAllowed, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed, 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 | ||
71 | * <b>not</b> at the class load time of the outer class, | ||
72 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed (visibility: PUBLIC, simpleName: LinkAllowed, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed, 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()}. | ||
73 | * | ||
74 | * <p> This workaround is required e.g. to support recursion. | ||
75 | * | ||
76 | */ | ||
77 | private static class LazyHolder { | ||
78 | private static final LinkAllowed INSTANCE = new LinkAllowed(); | ||
79 | |||
80 | /** | ||
81 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
82 | * This initialization order is required to support indirect recursion. | ||
83 | * | ||
84 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
85 | * | ||
86 | */ | ||
87 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
88 | |||
89 | public static Object ensureInitialized() { | ||
90 | INSTANCE.ensureInitializedInternal(); | ||
91 | return null; | ||
92 | } | ||
93 | } | ||
94 | |||
95 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
96 | private static final LinkAllowed.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
97 | |||
98 | private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
99 | |||
100 | private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
101 | |||
102 | private final List<PParameter> parameters = Arrays.asList(parameter_From, parameter_To); | ||
103 | |||
104 | private GeneratedPQuery() { | ||
105 | super(PVisibility.PRIVATE); | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public String getFullyQualifiedName() { | ||
110 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.linkAllowed"; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public List<String> getParameterNames() { | ||
115 | return Arrays.asList("From","To"); | ||
116 | } | ||
117 | |||
118 | @Override | ||
119 | public List<PParameter> getParameters() { | ||
120 | return parameters; | ||
121 | } | ||
122 | |||
123 | @Override | ||
124 | public Set<PBody> doGetContainedBodies() { | ||
125 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
126 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
127 | { | ||
128 | PBody body = new PBody(this); | ||
129 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
130 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
131 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
132 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
133 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
134 | new ExportedParameter(body, var_From, parameter_From), | ||
135 | new ExportedParameter(body, var_To, parameter_To) | ||
136 | )); | ||
137 | // find matchingAntenna(From, To) | ||
138 | new PositivePatternCall(body, Tuples.flatTupleOf(var_From, var_To), MatchingAntenna.instance().getInternalQueryRepresentation()); | ||
139 | // neg find cubeSat3U(From) | ||
140 | new NegativePatternCall(body, Tuples.flatTupleOf(var_From), CubeSat3U.instance().getInternalQueryRepresentation()); | ||
141 | bodies.add(body); | ||
142 | } | ||
143 | { | ||
144 | PBody body = new PBody(this); | ||
145 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
146 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
147 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
148 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
149 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
150 | new ExportedParameter(body, var_From, parameter_From), | ||
151 | new ExportedParameter(body, var_To, parameter_To) | ||
152 | )); | ||
153 | // find matchingAntenna(From, To) | ||
154 | new PositivePatternCall(body, Tuples.flatTupleOf(var_From, var_To), MatchingAntenna.instance().getInternalQueryRepresentation()); | ||
155 | // CubeSat3U(From) | ||
156 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
157 | bodies.add(body); | ||
158 | } | ||
159 | { | ||
160 | PBody body = new PBody(this); | ||
161 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
162 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
163 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
164 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
165 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
166 | new ExportedParameter(body, var_From, parameter_From), | ||
167 | new ExportedParameter(body, var_To, parameter_To) | ||
168 | )); | ||
169 | // find matchingAntenna(From, To) | ||
170 | new PositivePatternCall(body, Tuples.flatTupleOf(var_From, var_To), MatchingAntenna.instance().getInternalQueryRepresentation()); | ||
171 | // CubeSat3U(From) | ||
172 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | ||
173 | // GroundStationNetwork(To) | ||
174 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork"))); | ||
175 | bodies.add(body); | ||
176 | } | ||
177 | return bodies; | ||
178 | } | ||
179 | } | ||
180 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java deleted file mode 100644 index 6ee10814..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java +++ /dev/null | |||
@@ -1,152 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
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.EStructuralFeatureInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
27 | |||
28 | /** | ||
29 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
30 | * | ||
31 | * <p>Original source: | ||
32 | * <code><pre> | ||
33 | * private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { | ||
34 | * CommunicatingElement.commSubsystem(From, FromSys); | ||
35 | * CommunicatingElement.commSubsystem(To, ToSys); | ||
36 | * find matchingCommSubsystem(FromSys, ToSys); | ||
37 | * } | ||
38 | * </pre></code> | ||
39 | * | ||
40 | * @see GenericPatternMatcher | ||
41 | * @see GenericPatternMatch | ||
42 | * | ||
43 | */ | ||
44 | @SuppressWarnings("all") | ||
45 | public final class MatchingAntenna extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
46 | private MatchingAntenna() { | ||
47 | super(GeneratedPQuery.INSTANCE); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * @return the singleton instance of the query specification | ||
52 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
53 | * | ||
54 | */ | ||
55 | public static MatchingAntenna instance() { | ||
56 | try{ | ||
57 | return LazyHolder.INSTANCE; | ||
58 | } catch (ExceptionInInitializerError err) { | ||
59 | throw processInitializerError(err); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna (visibility: PUBLIC, simpleName: MatchingAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna, 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 | ||
65 | * <b>not</b> at the class load time of the outer class, | ||
66 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna (visibility: PUBLIC, simpleName: MatchingAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna, 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()}. | ||
67 | * | ||
68 | * <p> This workaround is required e.g. to support recursion. | ||
69 | * | ||
70 | */ | ||
71 | private static class LazyHolder { | ||
72 | private static final MatchingAntenna INSTANCE = new MatchingAntenna(); | ||
73 | |||
74 | /** | ||
75 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
76 | * This initialization order is required to support indirect recursion. | ||
77 | * | ||
78 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
79 | * | ||
80 | */ | ||
81 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
82 | |||
83 | public static Object ensureInitialized() { | ||
84 | INSTANCE.ensureInitializedInternal(); | ||
85 | return null; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
90 | private static final MatchingAntenna.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
91 | |||
92 | private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
93 | |||
94 | private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
95 | |||
96 | private final List<PParameter> parameters = Arrays.asList(parameter_From, parameter_To); | ||
97 | |||
98 | private GeneratedPQuery() { | ||
99 | super(PVisibility.PRIVATE); | ||
100 | } | ||
101 | |||
102 | @Override | ||
103 | public String getFullyQualifiedName() { | ||
104 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.matchingAntenna"; | ||
105 | } | ||
106 | |||
107 | @Override | ||
108 | public List<String> getParameterNames() { | ||
109 | return Arrays.asList("From","To"); | ||
110 | } | ||
111 | |||
112 | @Override | ||
113 | public List<PParameter> getParameters() { | ||
114 | return parameters; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public Set<PBody> doGetContainedBodies() { | ||
119 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
120 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
121 | { | ||
122 | PBody body = new PBody(this); | ||
123 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
124 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
125 | PVariable var_FromSys = body.getOrCreateVariableByName("FromSys"); | ||
126 | PVariable var_ToSys = body.getOrCreateVariableByName("ToSys"); | ||
127 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
128 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
129 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
130 | new ExportedParameter(body, var_From, parameter_From), | ||
131 | new ExportedParameter(body, var_To, parameter_To) | ||
132 | )); | ||
133 | // CommunicatingElement.commSubsystem(From, FromSys) | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
135 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_From, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
137 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
138 | new Equality(body, var__virtual_0_, var_FromSys); | ||
139 | // CommunicatingElement.commSubsystem(To, ToSys) | ||
140 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
141 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
142 | new TypeConstraint(body, Tuples.flatTupleOf(var_To, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
143 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
144 | new Equality(body, var__virtual_1_, var_ToSys); | ||
145 | // find matchingCommSubsystem(FromSys, ToSys) | ||
146 | new PositivePatternCall(body, Tuples.flatTupleOf(var_FromSys, var_ToSys), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); | ||
147 | bodies.add(body); | ||
148 | } | ||
149 | return bodies; | ||
150 | } | ||
151 | } | ||
152 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingCommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingCommSubsystem.java deleted file mode 100644 index 24726d21..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingCommSubsystem.java +++ /dev/null | |||
@@ -1,173 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
23 | |||
24 | /** | ||
25 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
26 | * | ||
27 | * <p>Original source: | ||
28 | * <code><pre> | ||
29 | * private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) { | ||
30 | * UHFCommSubsystem(From); | ||
31 | * UHFCommSubsystem(To); | ||
32 | * } or { | ||
33 | * XCommSubsystem(From); | ||
34 | * XCommSubsystem(To); | ||
35 | * } or { | ||
36 | * KaCommSubsystem(From); | ||
37 | * KaCommSubsystem(To); | ||
38 | * } | ||
39 | * </pre></code> | ||
40 | * | ||
41 | * @see GenericPatternMatcher | ||
42 | * @see GenericPatternMatch | ||
43 | * | ||
44 | */ | ||
45 | @SuppressWarnings("all") | ||
46 | public final class MatchingCommSubsystem extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
47 | private MatchingCommSubsystem() { | ||
48 | super(GeneratedPQuery.INSTANCE); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * @return the singleton instance of the query specification | ||
53 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
54 | * | ||
55 | */ | ||
56 | public static MatchingCommSubsystem instance() { | ||
57 | try{ | ||
58 | return LazyHolder.INSTANCE; | ||
59 | } catch (ExceptionInInitializerError err) { | ||
60 | throw processInitializerError(err); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem (visibility: PUBLIC, simpleName: MatchingCommSubsystem, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem, 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 | ||
66 | * <b>not</b> at the class load time of the outer class, | ||
67 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem (visibility: PUBLIC, simpleName: MatchingCommSubsystem, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem, 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()}. | ||
68 | * | ||
69 | * <p> This workaround is required e.g. to support recursion. | ||
70 | * | ||
71 | */ | ||
72 | private static class LazyHolder { | ||
73 | private static final MatchingCommSubsystem INSTANCE = new MatchingCommSubsystem(); | ||
74 | |||
75 | /** | ||
76 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
77 | * This initialization order is required to support indirect recursion. | ||
78 | * | ||
79 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
80 | * | ||
81 | */ | ||
82 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
83 | |||
84 | public static Object ensureInitialized() { | ||
85 | INSTANCE.ensureInitializedInternal(); | ||
86 | return null; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
91 | private static final MatchingCommSubsystem.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
92 | |||
93 | private final PParameter parameter_From = new PParameter("From", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); | ||
94 | |||
95 | private final PParameter parameter_To = new PParameter("To", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); | ||
96 | |||
97 | private final List<PParameter> parameters = Arrays.asList(parameter_From, parameter_To); | ||
98 | |||
99 | private GeneratedPQuery() { | ||
100 | super(PVisibility.PRIVATE); | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public String getFullyQualifiedName() { | ||
105 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.matchingCommSubsystem"; | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<String> getParameterNames() { | ||
110 | return Arrays.asList("From","To"); | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public List<PParameter> getParameters() { | ||
115 | return parameters; | ||
116 | } | ||
117 | |||
118 | @Override | ||
119 | public Set<PBody> doGetContainedBodies() { | ||
120 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
121 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
122 | { | ||
123 | PBody body = new PBody(this); | ||
124 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
125 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
126 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
127 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
128 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
129 | new ExportedParameter(body, var_From, parameter_From), | ||
130 | new ExportedParameter(body, var_To, parameter_To) | ||
131 | )); | ||
132 | // UHFCommSubsystem(From) | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem"))); | ||
134 | // UHFCommSubsystem(To) | ||
135 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem"))); | ||
136 | bodies.add(body); | ||
137 | } | ||
138 | { | ||
139 | PBody body = new PBody(this); | ||
140 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
141 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
142 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
143 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
144 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
145 | new ExportedParameter(body, var_From, parameter_From), | ||
146 | new ExportedParameter(body, var_To, parameter_To) | ||
147 | )); | ||
148 | // XCommSubsystem(From) | ||
149 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "XCommSubsystem"))); | ||
150 | // XCommSubsystem(To) | ||
151 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "XCommSubsystem"))); | ||
152 | bodies.add(body); | ||
153 | } | ||
154 | { | ||
155 | PBody body = new PBody(this); | ||
156 | PVariable var_From = body.getOrCreateVariableByName("From"); | ||
157 | PVariable var_To = body.getOrCreateVariableByName("To"); | ||
158 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
159 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
160 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
161 | new ExportedParameter(body, var_From, parameter_From), | ||
162 | new ExportedParameter(body, var_To, parameter_To) | ||
163 | )); | ||
164 | // KaCommSubsystem(From) | ||
165 | new TypeConstraint(body, Tuples.flatTupleOf(var_From), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "KaCommSubsystem"))); | ||
166 | // KaCommSubsystem(To) | ||
167 | new TypeConstraint(body, Tuples.flatTupleOf(var_To), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "KaCommSubsystem"))); | ||
168 | bodies.add(body); | ||
169 | } | ||
170 | return bodies; | ||
171 | } | ||
172 | } | ||
173 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java deleted file mode 100644 index 4093e2b2..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java +++ /dev/null | |||
@@ -1,105 +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 hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink; | ||
15 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads; | ||
16 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf; | ||
17 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U; | ||
18 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U; | ||
19 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink; | ||
20 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork; | ||
21 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; | ||
22 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed; | ||
23 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed; | ||
24 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna; | ||
25 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem; | ||
26 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload; | ||
27 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem; | ||
28 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | ||
29 | |||
30 | /** | ||
31 | * A pattern group formed of all patterns defined in SatelliteQueries.vql. | ||
32 | * | ||
33 | * <p>A private group that includes private patterns as well. Only intended use case is for pattern testing. | ||
34 | * | ||
35 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns: <ul> | ||
36 | * <li>communicationLinkDoesNotStartAtContainingElement</li> | ||
37 | * <li>transmittingCommSubsystem</li> | ||
38 | * <li>notEnoughInterferometryPayloads</li> | ||
39 | * <li>atLeastTwoInterferometryPayloads</li> | ||
40 | * <li>spacecraftWithInterferometryPayload</li> | ||
41 | * <li>noLinkToGroundStation</li> | ||
42 | * <li>noPotentialLinkToGroundStation</li> | ||
43 | * <li>indirectLinkAllowed</li> | ||
44 | * <li>linkAllowed</li> | ||
45 | * <li>matchingAntenna</li> | ||
46 | * <li>matchingCommSubsystem</li> | ||
47 | * <li>cubeSat3U</li> | ||
48 | * <li>cubeSat6U</li> | ||
49 | * <li>communicationLoop</li> | ||
50 | * <li>indirectCommunicationLink</li> | ||
51 | * <li>directCommunicationLink</li> | ||
52 | * <li>incompatibleSourceAndTargetBand</li> | ||
53 | * <li>threeUCubeSatWithNonUhfCrossLink</li> | ||
54 | * <li>commSubsystemBandUhf</li> | ||
55 | * <li>groundStationNetwork</li> | ||
56 | * <li>cubeSatWithKaAntenna</li> | ||
57 | * <li>smallSat</li> | ||
58 | * </ul> | ||
59 | * | ||
60 | * @see IQueryGroup | ||
61 | * | ||
62 | */ | ||
63 | @SuppressWarnings("all") | ||
64 | public final class SatelliteQueriesAll extends BaseGeneratedPatternGroup { | ||
65 | /** | ||
66 | * Access the pattern group. | ||
67 | * | ||
68 | * @return the singleton instance of the group | ||
69 | * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications | ||
70 | * | ||
71 | */ | ||
72 | public static SatelliteQueriesAll instance() { | ||
73 | if (INSTANCE == null) { | ||
74 | INSTANCE = new SatelliteQueriesAll(); | ||
75 | } | ||
76 | return INSTANCE; | ||
77 | } | ||
78 | |||
79 | private static SatelliteQueriesAll INSTANCE; | ||
80 | |||
81 | private SatelliteQueriesAll() { | ||
82 | querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); | ||
83 | querySpecifications.add(TransmittingCommSubsystem.instance()); | ||
84 | querySpecifications.add(NotEnoughInterferometryPayloads.instance()); | ||
85 | querySpecifications.add(AtLeastTwoInterferometryPayloads.instance()); | ||
86 | querySpecifications.add(SpacecraftWithInterferometryPayload.instance()); | ||
87 | querySpecifications.add(NoLinkToGroundStation.instance()); | ||
88 | querySpecifications.add(NoPotentialLinkToGroundStation.instance()); | ||
89 | querySpecifications.add(IndirectLinkAllowed.instance()); | ||
90 | querySpecifications.add(LinkAllowed.instance()); | ||
91 | querySpecifications.add(MatchingAntenna.instance()); | ||
92 | querySpecifications.add(MatchingCommSubsystem.instance()); | ||
93 | querySpecifications.add(CubeSat3U.instance()); | ||
94 | querySpecifications.add(CubeSat6U.instance()); | ||
95 | querySpecifications.add(CommunicationLoop.instance()); | ||
96 | querySpecifications.add(IndirectCommunicationLink.instance()); | ||
97 | querySpecifications.add(DirectCommunicationLink.instance()); | ||
98 | querySpecifications.add(IncompatibleSourceAndTargetBand.instance()); | ||
99 | querySpecifications.add(ThreeUCubeSatWithNonUhfCrossLink.instance()); | ||
100 | querySpecifications.add(CommSubsystemBandUhf.instance()); | ||
101 | querySpecifications.add(GroundStationNetwork.instance()); | ||
102 | querySpecifications.add(CubeSatWithKaAntenna.instance()); | ||
103 | querySpecifications.add(SmallSat.instance()); | ||
104 | } | ||
105 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java deleted file mode 100644 index 9566c4c5..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java +++ /dev/null | |||
@@ -1,149 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern spacecraftWithInterferometryPayload(Mission : ConstellationMission, Spacecraft : Spacecraft) { | ||
32 | * ConstellationMission.spacecraft(Mission, Spacecraft); | ||
33 | * Spacecraft.payload(Spacecraft, Payload); | ||
34 | * InterferometryPayload(Payload); | ||
35 | * } | ||
36 | * </pre></code> | ||
37 | * | ||
38 | * @see GenericPatternMatcher | ||
39 | * @see GenericPatternMatch | ||
40 | * | ||
41 | */ | ||
42 | @SuppressWarnings("all") | ||
43 | public final class SpacecraftWithInterferometryPayload extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
44 | private SpacecraftWithInterferometryPayload() { | ||
45 | super(GeneratedPQuery.INSTANCE); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @return the singleton instance of the query specification | ||
50 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
51 | * | ||
52 | */ | ||
53 | public static SpacecraftWithInterferometryPayload instance() { | ||
54 | try{ | ||
55 | return LazyHolder.INSTANCE; | ||
56 | } catch (ExceptionInInitializerError err) { | ||
57 | throw processInitializerError(err); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload (visibility: PUBLIC, simpleName: SpacecraftWithInterferometryPayload, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload, 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 | ||
63 | * <b>not</b> at the class load time of the outer class, | ||
64 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload (visibility: PUBLIC, simpleName: SpacecraftWithInterferometryPayload, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload, 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()}. | ||
65 | * | ||
66 | * <p> This workaround is required e.g. to support recursion. | ||
67 | * | ||
68 | */ | ||
69 | private static class LazyHolder { | ||
70 | private static final SpacecraftWithInterferometryPayload INSTANCE = new SpacecraftWithInterferometryPayload(); | ||
71 | |||
72 | /** | ||
73 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
74 | * This initialization order is required to support indirect recursion. | ||
75 | * | ||
76 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
77 | * | ||
78 | */ | ||
79 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
80 | |||
81 | public static Object ensureInitialized() { | ||
82 | INSTANCE.ensureInitializedInternal(); | ||
83 | return null; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
88 | private static final SpacecraftWithInterferometryPayload.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
89 | |||
90 | private final PParameter parameter_Mission = new PParameter("Mission", "satellite.ConstellationMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "ConstellationMission")), PParameterDirection.INOUT); | ||
91 | |||
92 | private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); | ||
93 | |||
94 | private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft); | ||
95 | |||
96 | private GeneratedPQuery() { | ||
97 | super(PVisibility.PRIVATE); | ||
98 | } | ||
99 | |||
100 | @Override | ||
101 | public String getFullyQualifiedName() { | ||
102 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftWithInterferometryPayload"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> getParameterNames() { | ||
107 | return Arrays.asList("Mission","Spacecraft"); | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<PParameter> getParameters() { | ||
112 | return parameters; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Set<PBody> doGetContainedBodies() { | ||
117 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
118 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
119 | { | ||
120 | PBody body = new PBody(this); | ||
121 | PVariable var_Mission = body.getOrCreateVariableByName("Mission"); | ||
122 | PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft"); | ||
123 | PVariable var_Payload = body.getOrCreateVariableByName("Payload"); | ||
124 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
125 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
126 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
127 | new ExportedParameter(body, var_Mission, parameter_Mission), | ||
128 | new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft) | ||
129 | )); | ||
130 | // ConstellationMission.spacecraft(Mission, Spacecraft) | ||
131 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission"))); | ||
132 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft"))); | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
135 | new Equality(body, var__virtual_0_, var_Spacecraft); | ||
136 | // Spacecraft.payload(Spacecraft, Payload) | ||
137 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft"))); | ||
138 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
139 | new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "payload"))); | ||
140 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Payload"))); | ||
141 | new Equality(body, var__virtual_1_, var_Payload); | ||
142 | // InterferometryPayload(Payload) | ||
143 | new TypeConstraint(body, Tuples.flatTupleOf(var_Payload), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryPayload"))); | ||
144 | bodies.add(body); | ||
145 | } | ||
146 | return bodies; | ||
147 | } | ||
148 | } | ||
149 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmittingCommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmittingCommSubsystem.java deleted file mode 100644 index a50536f5..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmittingCommSubsystem.java +++ /dev/null | |||
@@ -1,146 +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.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern transmittingCommSubsystem(Element : CommunicatingElement, Comm : CommSubsystem) { | ||
32 | * CommunicatingElement.commSubsystem(Element, Comm); | ||
33 | * CommSubsystem.target(Comm, _); | ||
34 | * } | ||
35 | * </pre></code> | ||
36 | * | ||
37 | * @see GenericPatternMatcher | ||
38 | * @see GenericPatternMatch | ||
39 | * | ||
40 | */ | ||
41 | @SuppressWarnings("all") | ||
42 | public final class TransmittingCommSubsystem extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
43 | private TransmittingCommSubsystem() { | ||
44 | super(GeneratedPQuery.INSTANCE); | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * @return the singleton instance of the query specification | ||
49 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
50 | * | ||
51 | */ | ||
52 | public static TransmittingCommSubsystem instance() { | ||
53 | try{ | ||
54 | return LazyHolder.INSTANCE; | ||
55 | } catch (ExceptionInInitializerError err) { | ||
56 | throw processInitializerError(err); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem (visibility: PUBLIC, simpleName: TransmittingCommSubsystem, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem, 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 | ||
62 | * <b>not</b> at the class load time of the outer class, | ||
63 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem (visibility: PUBLIC, simpleName: TransmittingCommSubsystem, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem, 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()}. | ||
64 | * | ||
65 | * <p> This workaround is required e.g. to support recursion. | ||
66 | * | ||
67 | */ | ||
68 | private static class LazyHolder { | ||
69 | private static final TransmittingCommSubsystem INSTANCE = new TransmittingCommSubsystem(); | ||
70 | |||
71 | /** | ||
72 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
73 | * This initialization order is required to support indirect recursion. | ||
74 | * | ||
75 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
76 | * | ||
77 | */ | ||
78 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
79 | |||
80 | public static Object ensureInitialized() { | ||
81 | INSTANCE.ensureInitializedInternal(); | ||
82 | return null; | ||
83 | } | ||
84 | } | ||
85 | |||
86 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
87 | private static final TransmittingCommSubsystem.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
88 | |||
89 | private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
90 | |||
91 | private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); | ||
92 | |||
93 | private final List<PParameter> parameters = Arrays.asList(parameter_Element, parameter_Comm); | ||
94 | |||
95 | private GeneratedPQuery() { | ||
96 | super(PVisibility.PRIVATE); | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public String getFullyQualifiedName() { | ||
101 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmittingCommSubsystem"; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<String> getParameterNames() { | ||
106 | return Arrays.asList("Element","Comm"); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public List<PParameter> getParameters() { | ||
111 | return parameters; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public Set<PBody> doGetContainedBodies() { | ||
116 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
117 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
118 | { | ||
119 | PBody body = new PBody(this); | ||
120 | PVariable var_Element = body.getOrCreateVariableByName("Element"); | ||
121 | PVariable var_Comm = body.getOrCreateVariableByName("Comm"); | ||
122 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
123 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
124 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
125 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
126 | new ExportedParameter(body, var_Element, parameter_Element), | ||
127 | new ExportedParameter(body, var_Comm, parameter_Comm) | ||
128 | )); | ||
129 | // CommunicatingElement.commSubsystem(Element, Comm) | ||
130 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
131 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
132 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
134 | new Equality(body, var__virtual_0_, var_Comm); | ||
135 | // CommSubsystem.target(Comm, _) | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
137 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
138 | new TypeConstraint(body, Tuples.flatTupleOf(var_Comm, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); | ||
139 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
140 | new Equality(body, var__virtual_1_, var___0_); | ||
141 | bodies.add(body); | ||
142 | } | ||
143 | return bodies; | ||
144 | } | ||
145 | } | ||
146 | } | ||