diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit')
9 files changed, 343 insertions, 234 deletions
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 index 8d27a262..a23cb415 100644 --- 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 | |||
@@ -3,6 +3,7 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; | 4 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem; | ||
6 | import java.util.Arrays; | 7 | import java.util.Arrays; |
7 | import java.util.Collection; | 8 | import java.util.Collection; |
8 | import java.util.LinkedHashSet; | 9 | import java.util.LinkedHashSet; |
@@ -23,15 +24,14 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificat | |||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | 24 | 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.api.impl.BasePatternMatch; |
25 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | 26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; |
26 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | 27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; |
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | 28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; |
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | 29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; |
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | 30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; |
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | 31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; |
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | 32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; |
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | 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; | 35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; |
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | 36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; |
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | 37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; |
@@ -39,20 +39,19 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | |||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | 39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; |
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | 40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; |
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | 41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; |
42 | import satellite.DirectedCommunicationLink; | 42 | import satellite.CommunicatingElement; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | 45 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. |
46 | * | 46 | * |
47 | * <p>Original source: | 47 | * <p>Original source: |
48 | * <code><pre> | 48 | * <code><pre> |
49 | * {@literal @}Constraint(severity = "error", key = {Link}, | 49 | * {@literal @}Constraint(severity = "error", key = {Element}, |
50 | * message = "Communication links must start from the containing element.") | 50 | * message = "A communicating element may not have two transmitting communication subsystems..") |
51 | * pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) { | 51 | * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { |
52 | * CommunicatingElement.communicationLink(Element, Link); | 52 | * find transmittingCommSubsystem(Element, Comm1); |
53 | * DirectedCommunicationLink.source(Link, SourceComm); | 53 | * find transmittingCommSubsystem(Element, Comm2); |
54 | * CommunicatingElement.commSubsystem(SourceElement, SourceComm); | 54 | * Comm1 != Comm2; |
55 | * Element != SourceElement; | ||
56 | * } | 55 | * } |
57 | * </pre></code> | 56 | * </pre></code> |
58 | * | 57 | * |
@@ -75,37 +74,37 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
75 | * | 74 | * |
76 | */ | 75 | */ |
77 | public static abstract class Match extends BasePatternMatch { | 76 | public static abstract class Match extends BasePatternMatch { |
78 | private DirectedCommunicationLink fLink; | 77 | private CommunicatingElement fElement; |
79 | 78 | ||
80 | private static List<String> parameterNames = makeImmutableList("Link"); | 79 | private static List<String> parameterNames = makeImmutableList("Element"); |
81 | 80 | ||
82 | private Match(final DirectedCommunicationLink pLink) { | 81 | private Match(final CommunicatingElement pElement) { |
83 | this.fLink = pLink; | 82 | this.fElement = pElement; |
84 | } | 83 | } |
85 | 84 | ||
86 | @Override | 85 | @Override |
87 | public Object get(final String parameterName) { | 86 | public Object get(final String parameterName) { |
88 | if ("Link".equals(parameterName)) return this.fLink; | 87 | if ("Element".equals(parameterName)) return this.fElement; |
89 | return null; | 88 | return null; |
90 | } | 89 | } |
91 | 90 | ||
92 | public DirectedCommunicationLink getLink() { | 91 | public CommunicatingElement getElement() { |
93 | return this.fLink; | 92 | return this.fElement; |
94 | } | 93 | } |
95 | 94 | ||
96 | @Override | 95 | @Override |
97 | public boolean set(final String parameterName, final Object newValue) { | 96 | public boolean set(final String parameterName, final Object newValue) { |
98 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
99 | if ("Link".equals(parameterName) ) { | 98 | if ("Element".equals(parameterName) ) { |
100 | this.fLink = (DirectedCommunicationLink) newValue; | 99 | this.fElement = (CommunicatingElement) newValue; |
101 | return true; | 100 | return true; |
102 | } | 101 | } |
103 | return false; | 102 | return false; |
104 | } | 103 | } |
105 | 104 | ||
106 | public void setLink(final DirectedCommunicationLink pLink) { | 105 | public void setElement(final CommunicatingElement pElement) { |
107 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
108 | this.fLink = pLink; | 107 | this.fElement = pElement; |
109 | } | 108 | } |
110 | 109 | ||
111 | @Override | 110 | @Override |
@@ -120,24 +119,24 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
120 | 119 | ||
121 | @Override | 120 | @Override |
122 | public Object[] toArray() { | 121 | public Object[] toArray() { |
123 | return new Object[]{fLink}; | 122 | return new Object[]{fElement}; |
124 | } | 123 | } |
125 | 124 | ||
126 | @Override | 125 | @Override |
127 | public CommunicationLinkDoesNotStartAtContainingElement.Match toImmutable() { | 126 | public CommunicationLinkDoesNotStartAtContainingElement.Match toImmutable() { |
128 | return isMutable() ? newMatch(fLink) : this; | 127 | return isMutable() ? newMatch(fElement) : this; |
129 | } | 128 | } |
130 | 129 | ||
131 | @Override | 130 | @Override |
132 | public String prettyPrint() { | 131 | public String prettyPrint() { |
133 | StringBuilder result = new StringBuilder(); | 132 | StringBuilder result = new StringBuilder(); |
134 | result.append("\"Link\"=" + prettyPrintValue(fLink)); | 133 | result.append("\"Element\"=" + prettyPrintValue(fElement)); |
135 | return result.toString(); | 134 | return result.toString(); |
136 | } | 135 | } |
137 | 136 | ||
138 | @Override | 137 | @Override |
139 | public int hashCode() { | 138 | public int hashCode() { |
140 | return Objects.hash(fLink); | 139 | return Objects.hash(fElement); |
141 | } | 140 | } |
142 | 141 | ||
143 | @Override | 142 | @Override |
@@ -149,7 +148,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
149 | } | 148 | } |
150 | if ((obj instanceof CommunicationLinkDoesNotStartAtContainingElement.Match)) { | 149 | if ((obj instanceof CommunicationLinkDoesNotStartAtContainingElement.Match)) { |
151 | CommunicationLinkDoesNotStartAtContainingElement.Match other = (CommunicationLinkDoesNotStartAtContainingElement.Match) obj; | 150 | CommunicationLinkDoesNotStartAtContainingElement.Match other = (CommunicationLinkDoesNotStartAtContainingElement.Match) obj; |
152 | return Objects.equals(fLink, other.fLink); | 151 | return Objects.equals(fElement, other.fElement); |
153 | } else { | 152 | } else { |
154 | // this should be infrequent | 153 | // this should be infrequent |
155 | if (!(obj instanceof IPatternMatch)) { | 154 | if (!(obj instanceof IPatternMatch)) { |
@@ -180,29 +179,29 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
180 | * Returns a mutable (partial) match. | 179 | * Returns a mutable (partial) match. |
181 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | 180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. |
182 | * | 181 | * |
183 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 182 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
184 | * @return the new, mutable (partial) match object. | 183 | * @return the new, mutable (partial) match object. |
185 | * | 184 | * |
186 | */ | 185 | */ |
187 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMutableMatch(final DirectedCommunicationLink pLink) { | 186 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMutableMatch(final CommunicatingElement pElement) { |
188 | return new Mutable(pLink); | 187 | return new Mutable(pElement); |
189 | } | 188 | } |
190 | 189 | ||
191 | /** | 190 | /** |
192 | * Returns a new (partial) match. | 191 | * Returns a new (partial) match. |
193 | * This can be used e.g. to call the matcher with a partial match. | 192 | * 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. | 193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
195 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 194 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
196 | * @return the (partial) match object. | 195 | * @return the (partial) match object. |
197 | * | 196 | * |
198 | */ | 197 | */ |
199 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final DirectedCommunicationLink pLink) { | 198 | public static CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) { |
200 | return new Immutable(pLink); | 199 | return new Immutable(pElement); |
201 | } | 200 | } |
202 | 201 | ||
203 | private static final class Mutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { | 202 | private static final class Mutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { |
204 | Mutable(final DirectedCommunicationLink pLink) { | 203 | Mutable(final CommunicatingElement pElement) { |
205 | super(pLink); | 204 | super(pElement); |
206 | } | 205 | } |
207 | 206 | ||
208 | @Override | 207 | @Override |
@@ -212,8 +211,8 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
212 | } | 211 | } |
213 | 212 | ||
214 | private static final class Immutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { | 213 | private static final class Immutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { |
215 | Immutable(final DirectedCommunicationLink pLink) { | 214 | Immutable(final CommunicatingElement pElement) { |
216 | super(pLink); | 215 | super(pElement); |
217 | } | 216 | } |
218 | 217 | ||
219 | @Override | 218 | @Override |
@@ -234,13 +233,12 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
234 | * | 233 | * |
235 | * <p>Original source: | 234 | * <p>Original source: |
236 | * <code><pre> | 235 | * <code><pre> |
237 | * {@literal @}Constraint(severity = "error", key = {Link}, | 236 | * {@literal @}Constraint(severity = "error", key = {Element}, |
238 | * message = "Communication links must start from the containing element.") | 237 | * message = "A communicating element may not have two transmitting communication subsystems..") |
239 | * pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) { | 238 | * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { |
240 | * CommunicatingElement.communicationLink(Element, Link); | 239 | * find transmittingCommSubsystem(Element, Comm1); |
241 | * DirectedCommunicationLink.source(Link, SourceComm); | 240 | * find transmittingCommSubsystem(Element, Comm2); |
242 | * CommunicatingElement.commSubsystem(SourceElement, SourceComm); | 241 | * Comm1 != Comm2; |
243 | * Element != SourceElement; | ||
244 | * } | 242 | * } |
245 | * </pre></code> | 243 | * </pre></code> |
246 | * | 244 | * |
@@ -276,7 +274,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
276 | return new Matcher(); | 274 | return new Matcher(); |
277 | } | 275 | } |
278 | 276 | ||
279 | private static final int POSITION_LINK = 0; | 277 | private static final int POSITION_ELEMENT = 0; |
280 | 278 | ||
281 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkDoesNotStartAtContainingElement.Matcher.class); | 279 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkDoesNotStartAtContainingElement.Matcher.class); |
282 | 280 | ||
@@ -294,12 +292,12 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
294 | 292 | ||
295 | /** | 293 | /** |
296 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | 294 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. |
297 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 295 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
298 | * @return matches represented as a Match object. | 296 | * @return matches represented as a Match object. |
299 | * | 297 | * |
300 | */ | 298 | */ |
301 | public Collection<CommunicationLinkDoesNotStartAtContainingElement.Match> getAllMatches(final DirectedCommunicationLink pLink) { | 299 | public Collection<CommunicationLinkDoesNotStartAtContainingElement.Match> getAllMatches(final CommunicatingElement pElement) { |
302 | return rawStreamAllMatches(new Object[]{pLink}).collect(Collectors.toSet()); | 300 | return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet()); |
303 | } | 301 | } |
304 | 302 | ||
305 | /** | 303 | /** |
@@ -308,101 +306,101 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
308 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | 306 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. |
309 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | 307 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. |
310 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | 308 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. |
311 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 309 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
312 | * @return a stream of matches represented as a Match object. | 310 | * @return a stream of matches represented as a Match object. |
313 | * | 311 | * |
314 | */ | 312 | */ |
315 | public Stream<CommunicationLinkDoesNotStartAtContainingElement.Match> streamAllMatches(final DirectedCommunicationLink pLink) { | 313 | public Stream<CommunicationLinkDoesNotStartAtContainingElement.Match> streamAllMatches(final CommunicatingElement pElement) { |
316 | return rawStreamAllMatches(new Object[]{pLink}); | 314 | return rawStreamAllMatches(new Object[]{pElement}); |
317 | } | 315 | } |
318 | 316 | ||
319 | /** | 317 | /** |
320 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 318 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. |
321 | * Neither determinism nor randomness of selection is guaranteed. | 319 | * Neither determinism nor randomness of selection is guaranteed. |
322 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 320 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
323 | * @return a match represented as a Match object, or null if no match is found. | 321 | * @return a match represented as a Match object, or null if no match is found. |
324 | * | 322 | * |
325 | */ | 323 | */ |
326 | public Optional<CommunicationLinkDoesNotStartAtContainingElement.Match> getOneArbitraryMatch(final DirectedCommunicationLink pLink) { | 324 | public Optional<CommunicationLinkDoesNotStartAtContainingElement.Match> getOneArbitraryMatch(final CommunicatingElement pElement) { |
327 | return rawGetOneArbitraryMatch(new Object[]{pLink}); | 325 | return rawGetOneArbitraryMatch(new Object[]{pElement}); |
328 | } | 326 | } |
329 | 327 | ||
330 | /** | 328 | /** |
331 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | 329 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, |
332 | * under any possible substitution of the unspecified parameters (if any). | 330 | * under any possible substitution of the unspecified parameters (if any). |
333 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 331 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
334 | * @return true if the input is a valid (partial) match of the pattern. | 332 | * @return true if the input is a valid (partial) match of the pattern. |
335 | * | 333 | * |
336 | */ | 334 | */ |
337 | public boolean hasMatch(final DirectedCommunicationLink pLink) { | 335 | public boolean hasMatch(final CommunicatingElement pElement) { |
338 | return rawHasMatch(new Object[]{pLink}); | 336 | return rawHasMatch(new Object[]{pElement}); |
339 | } | 337 | } |
340 | 338 | ||
341 | /** | 339 | /** |
342 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | 340 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. |
343 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 341 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
344 | * @return the number of pattern matches found. | 342 | * @return the number of pattern matches found. |
345 | * | 343 | * |
346 | */ | 344 | */ |
347 | public int countMatches(final DirectedCommunicationLink pLink) { | 345 | public int countMatches(final CommunicatingElement pElement) { |
348 | return rawCountMatches(new Object[]{pLink}); | 346 | return rawCountMatches(new Object[]{pElement}); |
349 | } | 347 | } |
350 | 348 | ||
351 | /** | 349 | /** |
352 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 350 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. |
353 | * Neither determinism nor randomness of selection is guaranteed. | 351 | * Neither determinism nor randomness of selection is guaranteed. |
354 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 352 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
355 | * @param processor the action that will process the selected match. | 353 | * @param processor the action that will process the selected match. |
356 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | 354 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked |
357 | * | 355 | * |
358 | */ | 356 | */ |
359 | public boolean forOneArbitraryMatch(final DirectedCommunicationLink pLink, final Consumer<? super CommunicationLinkDoesNotStartAtContainingElement.Match> processor) { | 357 | public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer<? super CommunicationLinkDoesNotStartAtContainingElement.Match> processor) { |
360 | return rawForOneArbitraryMatch(new Object[]{pLink}, processor); | 358 | return rawForOneArbitraryMatch(new Object[]{pElement}, processor); |
361 | } | 359 | } |
362 | 360 | ||
363 | /** | 361 | /** |
364 | * Returns a new (partial) match. | 362 | * Returns a new (partial) match. |
365 | * This can be used e.g. to call the matcher with a partial match. | 363 | * This can be used e.g. to call the matcher with a partial match. |
366 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | 364 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
367 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 365 | * @param pElement the fixed value of pattern parameter Element, or null if not bound. |
368 | * @return the (partial) match object. | 366 | * @return the (partial) match object. |
369 | * | 367 | * |
370 | */ | 368 | */ |
371 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final DirectedCommunicationLink pLink) { | 369 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) { |
372 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch(pLink); | 370 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch(pElement); |
373 | } | 371 | } |
374 | 372 | ||
375 | /** | 373 | /** |
376 | * Retrieve the set of values that occur in matches for Link. | 374 | * Retrieve the set of values that occur in matches for Element. |
377 | * @return the Set of all values or empty set if there are no matches | 375 | * @return the Set of all values or empty set if there are no matches |
378 | * | 376 | * |
379 | */ | 377 | */ |
380 | protected Stream<DirectedCommunicationLink> rawStreamAllValuesOfLink(final Object[] parameters) { | 378 | protected Stream<CommunicatingElement> rawStreamAllValuesOfElement(final Object[] parameters) { |
381 | return rawStreamAllValues(POSITION_LINK, parameters).map(DirectedCommunicationLink.class::cast); | 379 | return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast); |
382 | } | 380 | } |
383 | 381 | ||
384 | /** | 382 | /** |
385 | * Retrieve the set of values that occur in matches for Link. | 383 | * Retrieve the set of values that occur in matches for Element. |
386 | * @return the Set of all values or empty set if there are no matches | 384 | * @return the Set of all values or empty set if there are no matches |
387 | * | 385 | * |
388 | */ | 386 | */ |
389 | public Set<DirectedCommunicationLink> getAllValuesOfLink() { | 387 | public Set<CommunicatingElement> getAllValuesOfElement() { |
390 | return rawStreamAllValuesOfLink(emptyArray()).collect(Collectors.toSet()); | 388 | return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet()); |
391 | } | 389 | } |
392 | 390 | ||
393 | /** | 391 | /** |
394 | * Retrieve the set of values that occur in matches for Link. | 392 | * Retrieve the set of values that occur in matches for Element. |
395 | * @return the Set of all values or empty set if there are no matches | 393 | * @return the Set of all values or empty set if there are no matches |
396 | * | 394 | * |
397 | */ | 395 | */ |
398 | public Stream<DirectedCommunicationLink> streamAllValuesOfLink() { | 396 | public Stream<CommunicatingElement> streamAllValuesOfElement() { |
399 | return rawStreamAllValuesOfLink(emptyArray()); | 397 | return rawStreamAllValuesOfElement(emptyArray()); |
400 | } | 398 | } |
401 | 399 | ||
402 | @Override | 400 | @Override |
403 | protected CommunicationLinkDoesNotStartAtContainingElement.Match tupleToMatch(final Tuple t) { | 401 | protected CommunicationLinkDoesNotStartAtContainingElement.Match tupleToMatch(final Tuple t) { |
404 | try { | 402 | try { |
405 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((DirectedCommunicationLink) t.get(POSITION_LINK)); | 403 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT)); |
406 | } catch(ClassCastException e) { | 404 | } catch(ClassCastException e) { |
407 | LOGGER.error("Element(s) in tuple not properly typed!",e); | 405 | LOGGER.error("Element(s) in tuple not properly typed!",e); |
408 | return null; | 406 | return null; |
@@ -412,7 +410,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
412 | @Override | 410 | @Override |
413 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatch(final Object[] match) { | 411 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatch(final Object[] match) { |
414 | try { | 412 | try { |
415 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 413 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]); |
416 | } catch(ClassCastException e) { | 414 | } catch(ClassCastException e) { |
417 | LOGGER.error("Element(s) in array not properly typed!",e); | 415 | LOGGER.error("Element(s) in array not properly typed!",e); |
418 | return null; | 416 | return null; |
@@ -422,7 +420,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
422 | @Override | 420 | @Override |
423 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatchMutable(final Object[] match) { | 421 | protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatchMutable(final Object[] match) { |
424 | try { | 422 | try { |
425 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMutableMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 423 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]); |
426 | } catch(ClassCastException e) { | 424 | } catch(ClassCastException e) { |
427 | LOGGER.error("Element(s) in array not properly typed!",e); | 425 | LOGGER.error("Element(s) in array not properly typed!",e); |
428 | return null; | 426 | return null; |
@@ -473,7 +471,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
473 | 471 | ||
474 | @Override | 472 | @Override |
475 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final Object... parameters) { | 473 | public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final Object... parameters) { |
476 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((satellite.DirectedCommunicationLink) parameters[0]); | 474 | return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((satellite.CommunicatingElement) parameters[0]); |
477 | } | 475 | } |
478 | 476 | ||
479 | /** | 477 | /** |
@@ -505,9 +503,9 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
505 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | 503 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { |
506 | private static final CommunicationLinkDoesNotStartAtContainingElement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | 504 | private static final CommunicationLinkDoesNotStartAtContainingElement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); |
507 | 505 | ||
508 | private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); | 506 | private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); |
509 | 507 | ||
510 | private final List<PParameter> parameters = Arrays.asList(parameter_Link); | 508 | private final List<PParameter> parameters = Arrays.asList(parameter_Element); |
511 | 509 | ||
512 | private GeneratedPQuery() { | 510 | private GeneratedPQuery() { |
513 | super(PVisibility.PUBLIC); | 511 | super(PVisibility.PUBLIC); |
@@ -520,7 +518,7 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
520 | 518 | ||
521 | @Override | 519 | @Override |
522 | public List<String> getParameterNames() { | 520 | public List<String> getParameterNames() { |
523 | return Arrays.asList("Link"); | 521 | return Arrays.asList("Element"); |
524 | } | 522 | } |
525 | 523 | ||
526 | @Override | 524 | @Override |
@@ -534,43 +532,28 @@ public final class CommunicationLinkDoesNotStartAtContainingElement extends Base | |||
534 | Set<PBody> bodies = new LinkedHashSet<>(); | 532 | Set<PBody> bodies = new LinkedHashSet<>(); |
535 | { | 533 | { |
536 | PBody body = new PBody(this); | 534 | PBody body = new PBody(this); |
537 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
538 | PVariable var_Element = body.getOrCreateVariableByName("Element"); | 535 | PVariable var_Element = body.getOrCreateVariableByName("Element"); |
539 | PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm"); | 536 | PVariable var_Comm1 = body.getOrCreateVariableByName("Comm1"); |
540 | PVariable var_SourceElement = body.getOrCreateVariableByName("SourceElement"); | 537 | PVariable var_Comm2 = body.getOrCreateVariableByName("Comm2"); |
541 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 538 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); |
542 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | 539 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( |
543 | new ExportedParameter(body, var_Link, parameter_Link) | 540 | new ExportedParameter(body, var_Element, parameter_Element) |
544 | )); | 541 | )); |
545 | // CommunicatingElement.communicationLink(Element, Link) | 542 | // find transmittingCommSubsystem(Element, Comm1) |
546 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | 543 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm1), TransmittingCommSubsystem.instance().getInternalQueryRepresentation()); |
547 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | 544 | // find transmittingCommSubsystem(Element, Comm2) |
548 | new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "communicationLink"))); | 545 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm2), TransmittingCommSubsystem.instance().getInternalQueryRepresentation()); |
549 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 546 | // Comm1 != Comm2 |
550 | new Equality(body, var__virtual_0_, var_Link); | 547 | new Inequality(body, var_Comm1, var_Comm2); |
551 | // DirectedCommunicationLink.source(Link, SourceComm) | ||
552 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
553 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | ||
555 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
556 | new Equality(body, var__virtual_1_, var_SourceComm); | ||
557 | // CommunicatingElement.commSubsystem(SourceElement, SourceComm) | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceElement), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
559 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
560 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceElement, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
561 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
562 | new Equality(body, var__virtual_2_, var_SourceComm); | ||
563 | // Element != SourceElement | ||
564 | new Inequality(body, var_Element, var_SourceElement); | ||
565 | bodies.add(body); | 548 | bodies.add(body); |
566 | } | 549 | } |
567 | { | 550 | { |
568 | PAnnotation annotation = new PAnnotation("Constraint"); | 551 | PAnnotation annotation = new PAnnotation("Constraint"); |
569 | annotation.addAttribute("severity", "error"); | 552 | annotation.addAttribute("severity", "error"); |
570 | annotation.addAttribute("key", Arrays.asList(new Object[] { | 553 | annotation.addAttribute("key", Arrays.asList(new Object[] { |
571 | new ParameterReference("Link") | 554 | new ParameterReference("Element") |
572 | })); | 555 | })); |
573 | annotation.addAttribute("message", "Communication links must start from the containing element."); | 556 | annotation.addAttribute("message", "A communicating element may not have two transmitting communication subsystems.."); |
574 | addAnnotation(annotation); | 557 | addAnnotation(annotation); |
575 | } | 558 | } |
576 | return bodies; | 559 | return bodies; |
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 index c9dd1e58..af53fc9f 100644 --- 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 | |||
@@ -40,7 +40,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | |||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | 40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; |
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | 41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; |
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | 42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; |
43 | import satellite.DirectedCommunicationLink; | 43 | import satellite.CommSubsystem; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | 46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. |
@@ -49,11 +49,10 @@ import satellite.DirectedCommunicationLink; | |||
49 | * <code><pre> | 49 | * <code><pre> |
50 | * // Source and target communication systems must be compatible. | 50 | * // Source and target communication systems must be compatible. |
51 | * | 51 | * |
52 | * {@literal @}Constraint(severity = "error", key = {Link}, | 52 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, |
53 | * message = "Two ends of a communication link must use the same band.") | 53 | * message = "Two ends of a communication link must use the same band.") |
54 | * pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | 54 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { |
55 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | 55 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
56 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
57 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | 56 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); |
58 | * } | 57 | * } |
59 | * </pre></code> | 58 | * </pre></code> |
@@ -77,37 +76,37 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
77 | * | 76 | * |
78 | */ | 77 | */ |
79 | public static abstract class Match extends BasePatternMatch { | 78 | public static abstract class Match extends BasePatternMatch { |
80 | private DirectedCommunicationLink fLink; | 79 | private CommSubsystem fSourceSubsystem; |
81 | 80 | ||
82 | private static List<String> parameterNames = makeImmutableList("Link"); | 81 | private static List<String> parameterNames = makeImmutableList("SourceSubsystem"); |
83 | 82 | ||
84 | private Match(final DirectedCommunicationLink pLink) { | 83 | private Match(final CommSubsystem pSourceSubsystem) { |
85 | this.fLink = pLink; | 84 | this.fSourceSubsystem = pSourceSubsystem; |
86 | } | 85 | } |
87 | 86 | ||
88 | @Override | 87 | @Override |
89 | public Object get(final String parameterName) { | 88 | public Object get(final String parameterName) { |
90 | if ("Link".equals(parameterName)) return this.fLink; | 89 | if ("SourceSubsystem".equals(parameterName)) return this.fSourceSubsystem; |
91 | return null; | 90 | return null; |
92 | } | 91 | } |
93 | 92 | ||
94 | public DirectedCommunicationLink getLink() { | 93 | public CommSubsystem getSourceSubsystem() { |
95 | return this.fLink; | 94 | return this.fSourceSubsystem; |
96 | } | 95 | } |
97 | 96 | ||
98 | @Override | 97 | @Override |
99 | public boolean set(final String parameterName, final Object newValue) { | 98 | public boolean set(final String parameterName, final Object newValue) { |
100 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
101 | if ("Link".equals(parameterName) ) { | 100 | if ("SourceSubsystem".equals(parameterName) ) { |
102 | this.fLink = (DirectedCommunicationLink) newValue; | 101 | this.fSourceSubsystem = (CommSubsystem) newValue; |
103 | return true; | 102 | return true; |
104 | } | 103 | } |
105 | return false; | 104 | return false; |
106 | } | 105 | } |
107 | 106 | ||
108 | public void setLink(final DirectedCommunicationLink pLink) { | 107 | public void setSourceSubsystem(final CommSubsystem pSourceSubsystem) { |
109 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
110 | this.fLink = pLink; | 109 | this.fSourceSubsystem = pSourceSubsystem; |
111 | } | 110 | } |
112 | 111 | ||
113 | @Override | 112 | @Override |
@@ -122,24 +121,24 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
122 | 121 | ||
123 | @Override | 122 | @Override |
124 | public Object[] toArray() { | 123 | public Object[] toArray() { |
125 | return new Object[]{fLink}; | 124 | return new Object[]{fSourceSubsystem}; |
126 | } | 125 | } |
127 | 126 | ||
128 | @Override | 127 | @Override |
129 | public IncompatibleSourceAndTargetBand.Match toImmutable() { | 128 | public IncompatibleSourceAndTargetBand.Match toImmutable() { |
130 | return isMutable() ? newMatch(fLink) : this; | 129 | return isMutable() ? newMatch(fSourceSubsystem) : this; |
131 | } | 130 | } |
132 | 131 | ||
133 | @Override | 132 | @Override |
134 | public String prettyPrint() { | 133 | public String prettyPrint() { |
135 | StringBuilder result = new StringBuilder(); | 134 | StringBuilder result = new StringBuilder(); |
136 | result.append("\"Link\"=" + prettyPrintValue(fLink)); | 135 | result.append("\"SourceSubsystem\"=" + prettyPrintValue(fSourceSubsystem)); |
137 | return result.toString(); | 136 | return result.toString(); |
138 | } | 137 | } |
139 | 138 | ||
140 | @Override | 139 | @Override |
141 | public int hashCode() { | 140 | public int hashCode() { |
142 | return Objects.hash(fLink); | 141 | return Objects.hash(fSourceSubsystem); |
143 | } | 142 | } |
144 | 143 | ||
145 | @Override | 144 | @Override |
@@ -151,7 +150,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
151 | } | 150 | } |
152 | if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) { | 151 | if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) { |
153 | IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj; | 152 | IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj; |
154 | return Objects.equals(fLink, other.fLink); | 153 | return Objects.equals(fSourceSubsystem, other.fSourceSubsystem); |
155 | } else { | 154 | } else { |
156 | // this should be infrequent | 155 | // this should be infrequent |
157 | if (!(obj instanceof IPatternMatch)) { | 156 | if (!(obj instanceof IPatternMatch)) { |
@@ -182,29 +181,29 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
182 | * Returns a mutable (partial) match. | 181 | * Returns a mutable (partial) match. |
183 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | 182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. |
184 | * | 183 | * |
185 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 184 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
186 | * @return the new, mutable (partial) match object. | 185 | * @return the new, mutable (partial) match object. |
187 | * | 186 | * |
188 | */ | 187 | */ |
189 | public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final DirectedCommunicationLink pLink) { | 188 | public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final CommSubsystem pSourceSubsystem) { |
190 | return new Mutable(pLink); | 189 | return new Mutable(pSourceSubsystem); |
191 | } | 190 | } |
192 | 191 | ||
193 | /** | 192 | /** |
194 | * Returns a new (partial) match. | 193 | * Returns a new (partial) match. |
195 | * This can be used e.g. to call the matcher with a partial match. | 194 | * 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. | 195 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
197 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 196 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
198 | * @return the (partial) match object. | 197 | * @return the (partial) match object. |
199 | * | 198 | * |
200 | */ | 199 | */ |
201 | public static IncompatibleSourceAndTargetBand.Match newMatch(final DirectedCommunicationLink pLink) { | 200 | public static IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { |
202 | return new Immutable(pLink); | 201 | return new Immutable(pSourceSubsystem); |
203 | } | 202 | } |
204 | 203 | ||
205 | private static final class Mutable extends IncompatibleSourceAndTargetBand.Match { | 204 | private static final class Mutable extends IncompatibleSourceAndTargetBand.Match { |
206 | Mutable(final DirectedCommunicationLink pLink) { | 205 | Mutable(final CommSubsystem pSourceSubsystem) { |
207 | super(pLink); | 206 | super(pSourceSubsystem); |
208 | } | 207 | } |
209 | 208 | ||
210 | @Override | 209 | @Override |
@@ -214,8 +213,8 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
214 | } | 213 | } |
215 | 214 | ||
216 | private static final class Immutable extends IncompatibleSourceAndTargetBand.Match { | 215 | private static final class Immutable extends IncompatibleSourceAndTargetBand.Match { |
217 | Immutable(final DirectedCommunicationLink pLink) { | 216 | Immutable(final CommSubsystem pSourceSubsystem) { |
218 | super(pLink); | 217 | super(pSourceSubsystem); |
219 | } | 218 | } |
220 | 219 | ||
221 | @Override | 220 | @Override |
@@ -238,11 +237,10 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
238 | * <code><pre> | 237 | * <code><pre> |
239 | * // Source and target communication systems must be compatible. | 238 | * // Source and target communication systems must be compatible. |
240 | * | 239 | * |
241 | * {@literal @}Constraint(severity = "error", key = {Link}, | 240 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, |
242 | * message = "Two ends of a communication link must use the same band.") | 241 | * message = "Two ends of a communication link must use the same band.") |
243 | * pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | 242 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { |
244 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | 243 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
245 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
246 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | 244 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); |
247 | * } | 245 | * } |
248 | * </pre></code> | 246 | * </pre></code> |
@@ -279,7 +277,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
279 | return new Matcher(); | 277 | return new Matcher(); |
280 | } | 278 | } |
281 | 279 | ||
282 | private static final int POSITION_LINK = 0; | 280 | private static final int POSITION_SOURCESUBSYSTEM = 0; |
283 | 281 | ||
284 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class); | 282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class); |
285 | 283 | ||
@@ -297,12 +295,12 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
297 | 295 | ||
298 | /** | 296 | /** |
299 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | 297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. |
300 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 298 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
301 | * @return matches represented as a Match object. | 299 | * @return matches represented as a Match object. |
302 | * | 300 | * |
303 | */ | 301 | */ |
304 | public Collection<IncompatibleSourceAndTargetBand.Match> getAllMatches(final DirectedCommunicationLink pLink) { | 302 | public Collection<IncompatibleSourceAndTargetBand.Match> getAllMatches(final CommSubsystem pSourceSubsystem) { |
305 | return rawStreamAllMatches(new Object[]{pLink}).collect(Collectors.toSet()); | 303 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}).collect(Collectors.toSet()); |
306 | } | 304 | } |
307 | 305 | ||
308 | /** | 306 | /** |
@@ -311,101 +309,101 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
311 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | 309 | * <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>. | 310 | * 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. | 311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. |
314 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 312 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
315 | * @return a stream of matches represented as a Match object. | 313 | * @return a stream of matches represented as a Match object. |
316 | * | 314 | * |
317 | */ | 315 | */ |
318 | public Stream<IncompatibleSourceAndTargetBand.Match> streamAllMatches(final DirectedCommunicationLink pLink) { | 316 | public Stream<IncompatibleSourceAndTargetBand.Match> streamAllMatches(final CommSubsystem pSourceSubsystem) { |
319 | return rawStreamAllMatches(new Object[]{pLink}); | 317 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}); |
320 | } | 318 | } |
321 | 319 | ||
322 | /** | 320 | /** |
323 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 321 | * 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. | 322 | * Neither determinism nor randomness of selection is guaranteed. |
325 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 323 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
326 | * @return a match represented as a Match object, or null if no match is found. | 324 | * @return a match represented as a Match object, or null if no match is found. |
327 | * | 325 | * |
328 | */ | 326 | */ |
329 | public Optional<IncompatibleSourceAndTargetBand.Match> getOneArbitraryMatch(final DirectedCommunicationLink pLink) { | 327 | public Optional<IncompatibleSourceAndTargetBand.Match> getOneArbitraryMatch(final CommSubsystem pSourceSubsystem) { |
330 | return rawGetOneArbitraryMatch(new Object[]{pLink}); | 328 | return rawGetOneArbitraryMatch(new Object[]{pSourceSubsystem}); |
331 | } | 329 | } |
332 | 330 | ||
333 | /** | 331 | /** |
334 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | 332 | * 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). | 333 | * under any possible substitution of the unspecified parameters (if any). |
336 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 334 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
337 | * @return true if the input is a valid (partial) match of the pattern. | 335 | * @return true if the input is a valid (partial) match of the pattern. |
338 | * | 336 | * |
339 | */ | 337 | */ |
340 | public boolean hasMatch(final DirectedCommunicationLink pLink) { | 338 | public boolean hasMatch(final CommSubsystem pSourceSubsystem) { |
341 | return rawHasMatch(new Object[]{pLink}); | 339 | return rawHasMatch(new Object[]{pSourceSubsystem}); |
342 | } | 340 | } |
343 | 341 | ||
344 | /** | 342 | /** |
345 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | 343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. |
346 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 344 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
347 | * @return the number of pattern matches found. | 345 | * @return the number of pattern matches found. |
348 | * | 346 | * |
349 | */ | 347 | */ |
350 | public int countMatches(final DirectedCommunicationLink pLink) { | 348 | public int countMatches(final CommSubsystem pSourceSubsystem) { |
351 | return rawCountMatches(new Object[]{pLink}); | 349 | return rawCountMatches(new Object[]{pSourceSubsystem}); |
352 | } | 350 | } |
353 | 351 | ||
354 | /** | 352 | /** |
355 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 353 | * 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. | 354 | * Neither determinism nor randomness of selection is guaranteed. |
357 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 355 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
358 | * @param processor the action that will process the selected match. | 356 | * @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 | 357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked |
360 | * | 358 | * |
361 | */ | 359 | */ |
362 | public boolean forOneArbitraryMatch(final DirectedCommunicationLink pLink, final Consumer<? super IncompatibleSourceAndTargetBand.Match> processor) { | 360 | public boolean forOneArbitraryMatch(final CommSubsystem pSourceSubsystem, final Consumer<? super IncompatibleSourceAndTargetBand.Match> processor) { |
363 | return rawForOneArbitraryMatch(new Object[]{pLink}, processor); | 361 | return rawForOneArbitraryMatch(new Object[]{pSourceSubsystem}, processor); |
364 | } | 362 | } |
365 | 363 | ||
366 | /** | 364 | /** |
367 | * Returns a new (partial) match. | 365 | * Returns a new (partial) match. |
368 | * This can be used e.g. to call the matcher with a partial match. | 366 | * 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. | 367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
370 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 368 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
371 | * @return the (partial) match object. | 369 | * @return the (partial) match object. |
372 | * | 370 | * |
373 | */ | 371 | */ |
374 | public IncompatibleSourceAndTargetBand.Match newMatch(final DirectedCommunicationLink pLink) { | 372 | public IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { |
375 | return IncompatibleSourceAndTargetBand.Match.newMatch(pLink); | 373 | return IncompatibleSourceAndTargetBand.Match.newMatch(pSourceSubsystem); |
376 | } | 374 | } |
377 | 375 | ||
378 | /** | 376 | /** |
379 | * Retrieve the set of values that occur in matches for Link. | 377 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
380 | * @return the Set of all values or empty set if there are no matches | 378 | * @return the Set of all values or empty set if there are no matches |
381 | * | 379 | * |
382 | */ | 380 | */ |
383 | protected Stream<DirectedCommunicationLink> rawStreamAllValuesOfLink(final Object[] parameters) { | 381 | protected Stream<CommSubsystem> rawStreamAllValuesOfSourceSubsystem(final Object[] parameters) { |
384 | return rawStreamAllValues(POSITION_LINK, parameters).map(DirectedCommunicationLink.class::cast); | 382 | return rawStreamAllValues(POSITION_SOURCESUBSYSTEM, parameters).map(CommSubsystem.class::cast); |
385 | } | 383 | } |
386 | 384 | ||
387 | /** | 385 | /** |
388 | * Retrieve the set of values that occur in matches for Link. | 386 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
389 | * @return the Set of all values or empty set if there are no matches | 387 | * @return the Set of all values or empty set if there are no matches |
390 | * | 388 | * |
391 | */ | 389 | */ |
392 | public Set<DirectedCommunicationLink> getAllValuesOfLink() { | 390 | public Set<CommSubsystem> getAllValuesOfSourceSubsystem() { |
393 | return rawStreamAllValuesOfLink(emptyArray()).collect(Collectors.toSet()); | 391 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()).collect(Collectors.toSet()); |
394 | } | 392 | } |
395 | 393 | ||
396 | /** | 394 | /** |
397 | * Retrieve the set of values that occur in matches for Link. | 395 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
398 | * @return the Set of all values or empty set if there are no matches | 396 | * @return the Set of all values or empty set if there are no matches |
399 | * | 397 | * |
400 | */ | 398 | */ |
401 | public Stream<DirectedCommunicationLink> streamAllValuesOfLink() { | 399 | public Stream<CommSubsystem> streamAllValuesOfSourceSubsystem() { |
402 | return rawStreamAllValuesOfLink(emptyArray()); | 400 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()); |
403 | } | 401 | } |
404 | 402 | ||
405 | @Override | 403 | @Override |
406 | protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) { | 404 | protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) { |
407 | try { | 405 | try { |
408 | return IncompatibleSourceAndTargetBand.Match.newMatch((DirectedCommunicationLink) t.get(POSITION_LINK)); | 406 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) t.get(POSITION_SOURCESUBSYSTEM)); |
409 | } catch(ClassCastException e) { | 407 | } catch(ClassCastException e) { |
410 | LOGGER.error("Element(s) in tuple not properly typed!",e); | 408 | LOGGER.error("Element(s) in tuple not properly typed!",e); |
411 | return null; | 409 | return null; |
@@ -415,7 +413,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
415 | @Override | 413 | @Override |
416 | protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) { | 414 | protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) { |
417 | try { | 415 | try { |
418 | return IncompatibleSourceAndTargetBand.Match.newMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 416 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); |
419 | } catch(ClassCastException e) { | 417 | } catch(ClassCastException e) { |
420 | LOGGER.error("Element(s) in array not properly typed!",e); | 418 | LOGGER.error("Element(s) in array not properly typed!",e); |
421 | return null; | 419 | return null; |
@@ -425,7 +423,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
425 | @Override | 423 | @Override |
426 | protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) { | 424 | protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) { |
427 | try { | 425 | try { |
428 | return IncompatibleSourceAndTargetBand.Match.newMutableMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 426 | return IncompatibleSourceAndTargetBand.Match.newMutableMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); |
429 | } catch(ClassCastException e) { | 427 | } catch(ClassCastException e) { |
430 | LOGGER.error("Element(s) in array not properly typed!",e); | 428 | LOGGER.error("Element(s) in array not properly typed!",e); |
431 | return null; | 429 | return null; |
@@ -476,7 +474,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
476 | 474 | ||
477 | @Override | 475 | @Override |
478 | public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { | 476 | public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { |
479 | return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.DirectedCommunicationLink) parameters[0]); | 477 | return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.CommSubsystem) parameters[0]); |
480 | } | 478 | } |
481 | 479 | ||
482 | /** | 480 | /** |
@@ -508,9 +506,9 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
508 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | 506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { |
509 | private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | 507 | private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); |
510 | 508 | ||
511 | private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); | 509 | private final PParameter parameter_SourceSubsystem = new PParameter("SourceSubsystem", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); |
512 | 510 | ||
513 | private final List<PParameter> parameters = Arrays.asList(parameter_Link); | 511 | private final List<PParameter> parameters = Arrays.asList(parameter_SourceSubsystem); |
514 | 512 | ||
515 | private GeneratedPQuery() { | 513 | private GeneratedPQuery() { |
516 | super(PVisibility.PUBLIC); | 514 | super(PVisibility.PUBLIC); |
@@ -523,7 +521,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
523 | 521 | ||
524 | @Override | 522 | @Override |
525 | public List<String> getParameterNames() { | 523 | public List<String> getParameterNames() { |
526 | return Arrays.asList("Link"); | 524 | return Arrays.asList("SourceSubsystem"); |
527 | } | 525 | } |
528 | 526 | ||
529 | @Override | 527 | @Override |
@@ -537,25 +535,18 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
537 | Set<PBody> bodies = new LinkedHashSet<>(); | 535 | Set<PBody> bodies = new LinkedHashSet<>(); |
538 | { | 536 | { |
539 | PBody body = new PBody(this); | 537 | PBody body = new PBody(this); |
540 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
541 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | 538 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); |
542 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | 539 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); |
543 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 540 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
544 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | 541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( |
545 | new ExportedParameter(body, var_Link, parameter_Link) | 542 | new ExportedParameter(body, var_SourceSubsystem, parameter_SourceSubsystem) |
546 | )); | 543 | )); |
547 | // DirectedCommunicationLink.source(Link, SourceSubsystem) | 544 | // CommSubsystem.target(SourceSubsystem, TargetSubsystem) |
548 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 545 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
549 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | 546 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); |
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | 547 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); |
551 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 548 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
552 | new Equality(body, var__virtual_0_, var_SourceSubsystem); | 549 | new Equality(body, var__virtual_0_, var_TargetSubsystem); |
553 | // DirectedCommunicationLink.target(Link, TargetSubsystem) | ||
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
555 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target"))); | ||
557 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
558 | new Equality(body, var__virtual_1_, var_TargetSubsystem); | ||
559 | // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem) | 550 | // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem) |
560 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); | 551 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); |
561 | bodies.add(body); | 552 | bodies.add(body); |
@@ -564,7 +555,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
564 | PAnnotation annotation = new PAnnotation("Constraint"); | 555 | PAnnotation annotation = new PAnnotation("Constraint"); |
565 | annotation.addAttribute("severity", "error"); | 556 | annotation.addAttribute("severity", "error"); |
566 | annotation.addAttribute("key", Arrays.asList(new Object[] { | 557 | annotation.addAttribute("key", Arrays.asList(new Object[] { |
567 | new ParameterReference("Link") | 558 | new ParameterReference("SourceSubsystem") |
568 | })); | 559 | })); |
569 | annotation.addAttribute("message", "Two ends of a communication link must use the same band."); | 560 | annotation.addAttribute("message", "Two ends of a communication link must use the same band."); |
570 | addAnnotation(annotation); | 561 | addAnnotation(annotation); |
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 index 51b224b1..0fe520c2 100644 --- 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 | |||
@@ -56,8 +56,7 @@ import satellite.CubeSat3U; | |||
56 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | 56 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { |
57 | * CommunicatingElement.commSubsystem(Sat, SourceComm); | 57 | * CommunicatingElement.commSubsystem(Sat, SourceComm); |
58 | * neg find commSubsystemBandUhf(SourceComm); | 58 | * neg find commSubsystemBandUhf(SourceComm); |
59 | * DirectedCommunicationLink.source(Link, SourceComm); | 59 | * CommSubsystem.target(SourceComm, TargetComm); |
60 | * DirectedCommunicationLink.target(Link, TargetComm); | ||
61 | * CommunicatingElement.commSubsystem(Target, TargetComm); | 60 | * CommunicatingElement.commSubsystem(Target, TargetComm); |
62 | * neg find groundStationNetwork(Target); | 61 | * neg find groundStationNetwork(Target); |
63 | * } | 62 | * } |
@@ -249,8 +248,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer | |||
249 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | 248 | * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { |
250 | * CommunicatingElement.commSubsystem(Sat, SourceComm); | 249 | * CommunicatingElement.commSubsystem(Sat, SourceComm); |
251 | * neg find commSubsystemBandUhf(SourceComm); | 250 | * neg find commSubsystemBandUhf(SourceComm); |
252 | * DirectedCommunicationLink.source(Link, SourceComm); | 251 | * CommSubsystem.target(SourceComm, TargetComm); |
253 | * DirectedCommunicationLink.target(Link, TargetComm); | ||
254 | * CommunicatingElement.commSubsystem(Target, TargetComm); | 252 | * CommunicatingElement.commSubsystem(Target, TargetComm); |
255 | * neg find groundStationNetwork(Target); | 253 | * neg find groundStationNetwork(Target); |
256 | * } | 254 | * } |
@@ -548,7 +546,6 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer | |||
548 | PBody body = new PBody(this); | 546 | PBody body = new PBody(this); |
549 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); | 547 | PVariable var_Sat = body.getOrCreateVariableByName("Sat"); |
550 | PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm"); | 548 | PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm"); |
551 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
552 | PVariable var_TargetComm = body.getOrCreateVariableByName("TargetComm"); | 549 | PVariable var_TargetComm = body.getOrCreateVariableByName("TargetComm"); |
553 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | 550 | PVariable var_Target = body.getOrCreateVariableByName("Target"); |
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); | 551 | new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U"))); |
@@ -563,24 +560,18 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer | |||
563 | new Equality(body, var__virtual_0_, var_SourceComm); | 560 | new Equality(body, var__virtual_0_, var_SourceComm); |
564 | // neg find commSubsystemBandUhf(SourceComm) | 561 | // neg find commSubsystemBandUhf(SourceComm) |
565 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation()); | 562 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation()); |
566 | // DirectedCommunicationLink.source(Link, SourceComm) | 563 | // CommSubsystem.target(SourceComm, TargetComm) |
567 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 564 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
568 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | 565 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); |
569 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | 566 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); |
570 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 567 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
571 | new Equality(body, var__virtual_1_, var_SourceComm); | 568 | new Equality(body, var__virtual_1_, var_TargetComm); |
572 | // DirectedCommunicationLink.target(Link, TargetComm) | 569 | // CommunicatingElement.commSubsystem(Target, TargetComm) |
573 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 570 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); |
574 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | 571 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); |
575 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target"))); | 572 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); |
576 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 573 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
577 | new Equality(body, var__virtual_2_, var_TargetComm); | 574 | new Equality(body, var__virtual_2_, var_TargetComm); |
578 | // CommunicatingElement.commSubsystem(Target, TargetComm) | ||
579 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
580 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
581 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
582 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
583 | new Equality(body, var__virtual_3_, var_TargetComm); | ||
584 | // neg find groundStationNetwork(Target) | 575 | // neg find groundStationNetwork(Target) |
585 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation()); | 576 | new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation()); |
586 | bodies.add(body); | 577 | bodies.add(body); |
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 index d0140d1a..09c00a25 100644 --- 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 | |||
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 index 7cab430c..8b57b000 100644 --- 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 | |||
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 index ea4a15d7..58443486 100644 --- 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 | |||
@@ -64,3 +64,6 @@ | |||
64 | /SpacecraftWithTwoCommSubsystems.java | 64 | /SpacecraftWithTwoCommSubsystems.java |
65 | /TransmitRate.java | 65 | /TransmitRate.java |
66 | /TransmitTime.java | 66 | /TransmitTime.java |
67 | /.CubeSat6U.java._trace | ||
68 | /.MatchingCommSubsystem.java._trace | ||
69 | /.TransmittingCommSubsystem.java._trace | ||
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 index a2123354..ee4d8715 100644 --- 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 | |||
@@ -29,8 +29,7 @@ import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | |||
29 | * <p>Original source: | 29 | * <p>Original source: |
30 | * <code><pre> | 30 | * <code><pre> |
31 | * private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | 31 | * private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { |
32 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | 32 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
33 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
34 | * CommunicatingElement.commSubsystem(Source, SourceSubsystem); | 33 | * CommunicatingElement.commSubsystem(Source, SourceSubsystem); |
35 | * CommunicatingElement.commSubsystem(Target, TargetSubsystem); | 34 | * CommunicatingElement.commSubsystem(Target, TargetSubsystem); |
36 | * } | 35 | * } |
@@ -121,7 +120,6 @@ public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecific | |||
121 | PBody body = new PBody(this); | 120 | PBody body = new PBody(this); |
122 | PVariable var_Source = body.getOrCreateVariableByName("Source"); | 121 | PVariable var_Source = body.getOrCreateVariableByName("Source"); |
123 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | 122 | PVariable var_Target = body.getOrCreateVariableByName("Target"); |
124 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
125 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | 123 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); |
126 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | 124 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); |
127 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | 125 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); |
@@ -130,30 +128,24 @@ public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecific | |||
130 | new ExportedParameter(body, var_Source, parameter_Source), | 128 | new ExportedParameter(body, var_Source, parameter_Source), |
131 | new ExportedParameter(body, var_Target, parameter_Target) | 129 | new ExportedParameter(body, var_Target, parameter_Target) |
132 | )); | 130 | )); |
133 | // DirectedCommunicationLink.source(Link, SourceSubsystem) | 131 | // CommSubsystem.target(SourceSubsystem, TargetSubsystem) |
134 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 132 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
135 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | 133 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); |
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | 134 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); |
137 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 135 | 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_SourceSubsystem); | 136 | new Equality(body, var__virtual_0_, var_TargetSubsystem); |
139 | // DirectedCommunicationLink.target(Link, TargetSubsystem) | ||
140 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
141 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
142 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target"))); | ||
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_TargetSubsystem); | ||
145 | // CommunicatingElement.commSubsystem(Source, SourceSubsystem) | 137 | // CommunicatingElement.commSubsystem(Source, SourceSubsystem) |
146 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | 138 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); |
147 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | 139 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); |
148 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | 140 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); |
149 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 141 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
150 | new Equality(body, var__virtual_2_, var_SourceSubsystem); | 142 | new Equality(body, var__virtual_1_, var_SourceSubsystem); |
151 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem) | 143 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem) |
152 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | 144 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); |
153 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | 145 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); |
154 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | 146 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); |
155 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 147 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
156 | new Equality(body, var__virtual_3_, var_TargetSubsystem); | 148 | new Equality(body, var__virtual_2_, var_TargetSubsystem); |
157 | bodies.add(body); | 149 | bodies.add(body); |
158 | } | 150 | } |
159 | return bodies; | 151 | return bodies; |
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 index 66ea8361..4093e2b2 100644 --- 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 | |||
@@ -24,6 +24,7 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed | |||
24 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna; | 24 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna; |
25 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem; | 25 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem; |
26 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload; | 26 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload; |
27 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | 28 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; |
28 | 29 | ||
29 | /** | 30 | /** |
@@ -33,6 +34,7 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | |||
33 | * | 34 | * |
34 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns: <ul> | 35 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns: <ul> |
35 | * <li>communicationLinkDoesNotStartAtContainingElement</li> | 36 | * <li>communicationLinkDoesNotStartAtContainingElement</li> |
37 | * <li>transmittingCommSubsystem</li> | ||
36 | * <li>notEnoughInterferometryPayloads</li> | 38 | * <li>notEnoughInterferometryPayloads</li> |
37 | * <li>atLeastTwoInterferometryPayloads</li> | 39 | * <li>atLeastTwoInterferometryPayloads</li> |
38 | * <li>spacecraftWithInterferometryPayload</li> | 40 | * <li>spacecraftWithInterferometryPayload</li> |
@@ -78,6 +80,7 @@ public final class SatelliteQueriesAll extends BaseGeneratedPatternGroup { | |||
78 | 80 | ||
79 | private SatelliteQueriesAll() { | 81 | private SatelliteQueriesAll() { |
80 | querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); | 82 | querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); |
83 | querySpecifications.add(TransmittingCommSubsystem.instance()); | ||
81 | querySpecifications.add(NotEnoughInterferometryPayloads.instance()); | 84 | querySpecifications.add(NotEnoughInterferometryPayloads.instance()); |
82 | querySpecifications.add(AtLeastTwoInterferometryPayloads.instance()); | 85 | querySpecifications.add(AtLeastTwoInterferometryPayloads.instance()); |
83 | querySpecifications.add(SpacecraftWithInterferometryPayload.instance()); | 86 | querySpecifications.add(SpacecraftWithInterferometryPayload.instance()); |
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 new file mode 100644 index 00000000..a50536f5 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmittingCommSubsystem.java | |||
@@ -0,0 +1,146 @@ | |||
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 | } | ||