+
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace
deleted file mode 100644
index 8fb61263..00000000
Binary files a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.CommunicationLinkOfElement.java._trace and /dev/null differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace
deleted file mode 100644
index 64b692d3..00000000
Binary files a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.MultipleCommunicationLinks.java._trace and /dev/null differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore
deleted file mode 100644
index f6cfd36a..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore
+++ /dev/null
@@ -1,43 +0,0 @@
-/.SatelliteQueries.java._trace
-/.NoLinkToGroundStation.java._trace
-/.CommunicationLoop.java._trace
-/.SingleInterferometryPayload.java._trace
-/.NoInterferometryPayload.java._trace
-/.NotENoughInterferometryPayloads.java._trace
-/.NotEnoughInterferometryPayloads.java._trace
-/.UhfAntennaGainNotLow.java._trace
-/.XAntennaGainNotMedium.java._trace
-/.KaAntennaGainLow.java._trace
-/.IncompatibleSourceAndTarget.java._trace
-/.IncompatibleSourceAndTargetBand.java._trace
-/.IncompatibleSourceAndTargetGain.java._trace
-/.CubeSatWithKaAntenna.java._trace
-/.ThreeUCubeSatWithNonUhfCrossLink.java._trace
-/.CommunicationLinkDoesNotStartAtContainingElement.java._trace
-/.SpacecraftWithInterferometryPayload.java._trace
-/.SatelliteMetrics.java._trace
-/.CoverageMetric.java._trace
-/.TimeMetric.java._trace
-/.CostMetric.java._trace
-/.SpacecraftCost.java._trace
-/.SpacecraftOfKind.java._trace
-/.NoPotentialLinkToGroundStation.java._trace
-/.SmallSat.java._trace
-/CommunicationLinkDoesNotStartAtContainingElement.java
-/CommunicationLoop.java
-/CostMetric.java
-/CoverageMetric.java
-/CubeSatWithKaAntenna.java
-/IncompatibleSourceAndTargetBand.java
-/IncompatibleSourceAndTargetGain.java
-/KaAntennaGainLow.java
-/NoLinkToGroundStation.java
-/NoPotentialLinkToGroundStation.java
-/NotEnoughInterferometryPayloads.java
-/SatelliteQueries.java
-/SmallSat.java
-/SpacecraftOfKind.java
-/ThreeUCubeSatWithNonUhfCrossLink.java
-/TimeMetric.java
-/UhfAntennaGainNotLow.java
-/XAntennaGainNotMedium.java
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java
deleted file mode 100644
index a23cb415..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java
+++ /dev/null
@@ -1,562 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmittingCommSubsystem;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.CommunicatingElement;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * {@literal @}Constraint(severity = "error", key = {Element},
- * message = "A communicating element may not have two transmitting communication subsystems..")
- * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) {
- * find transmittingCommSubsystem(Element, Comm1);
- * find transmittingCommSubsystem(Element, Comm2);
- * Comm1 != Comm2;
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class CommunicationLinkDoesNotStartAtContainingElement extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private CommunicatingElement fElement;
-
- private static List parameterNames = makeImmutableList("Element");
-
- private Match(final CommunicatingElement pElement) {
- this.fElement = pElement;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Element".equals(parameterName)) return this.fElement;
- return null;
- }
-
- public CommunicatingElement getElement() {
- return this.fElement;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Element".equals(parameterName) ) {
- this.fElement = (CommunicatingElement) newValue;
- return true;
- }
- return false;
- }
-
- public void setElement(final CommunicatingElement pElement) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fElement = pElement;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement";
- }
-
- @Override
- public List parameterNames() {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fElement};
- }
-
- @Override
- public CommunicationLinkDoesNotStartAtContainingElement.Match toImmutable() {
- return isMutable() ? newMatch(fElement) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Element\"=" + prettyPrintValue(fElement));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fElement);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof CommunicationLinkDoesNotStartAtContainingElement.Match)) {
- CommunicationLinkDoesNotStartAtContainingElement.Match other = (CommunicationLinkDoesNotStartAtContainingElement.Match) obj;
- return Objects.equals(fElement, other.fElement);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public CommunicationLinkDoesNotStartAtContainingElement specification() {
- return CommunicationLinkDoesNotStartAtContainingElement.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement.Match newMutableMatch(final CommunicatingElement pElement) {
- return new Mutable(pElement);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) {
- return new Immutable(pElement);
- }
-
- private static final class Mutable extends CommunicationLinkDoesNotStartAtContainingElement.Match {
- Mutable(final CommunicatingElement pElement) {
- super(pElement);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends CommunicationLinkDoesNotStartAtContainingElement.Match {
- Immutable(final CommunicatingElement pElement) {
- super(pElement);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * {@literal @}Constraint(severity = "error", key = {Element},
- * message = "A communicating element may not have two transmitting communication subsystems..")
- * pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) {
- * find transmittingCommSubsystem(Element, Comm1);
- * find transmittingCommSubsystem(Element, Comm2);
- * Comm1 != Comm2;
- * }
- *
- *
- * @see Match
- * @see CommunicationLinkDoesNotStartAtContainingElement
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_ELEMENT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkDoesNotStartAtContainingElement.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final CommunicatingElement pElement) {
- return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final CommunicatingElement pElement) {
- return rawStreamAllMatches(new Object[]{pElement});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final CommunicatingElement pElement) {
- return rawGetOneArbitraryMatch(new Object[]{pElement});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final CommunicatingElement pElement) {
- return rawHasMatch(new Object[]{pElement});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final CommunicatingElement pElement) {
- return rawCountMatches(new Object[]{pElement});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer super CommunicationLinkDoesNotStartAtContainingElement.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pElement}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final CommunicatingElement pElement) {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch(pElement);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfElement(final Object[] parameters) {
- return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfElement() {
- return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfElement() {
- return rawStreamAllValuesOfElement(emptyArray());
- }
-
- @Override
- protected CommunicationLinkDoesNotStartAtContainingElement.Match tupleToMatch(final Tuple t) {
- try {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatch(final Object[] match) {
- try {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatchMutable(final Object[] match) {
- try {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return CommunicationLinkDoesNotStartAtContainingElement.instance();
- }
- }
-
- private CommunicationLinkDoesNotStartAtContainingElement() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CommunicationLinkDoesNotStartAtContainingElement instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate(final ViatraQueryEngine engine) {
- return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine);
- }
-
- @Override
- public CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate() {
- return CommunicationLinkDoesNotStartAtContainingElement.Matcher.create();
- }
-
- @Override
- public CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newEmptyMatch();
- }
-
- @Override
- public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final Object... parameters) {
- return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((satellite.CommunicatingElement) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CommunicationLinkDoesNotStartAtContainingElement INSTANCE = new CommunicationLinkDoesNotStartAtContainingElement();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CommunicationLinkDoesNotStartAtContainingElement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Element);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Element");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Element = body.getOrCreateVariableByName("Element");
- PVariable var_Comm1 = body.getOrCreateVariableByName("Comm1");
- PVariable var_Comm2 = body.getOrCreateVariableByName("Comm2");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Element, parameter_Element)
- ));
- // find transmittingCommSubsystem(Element, Comm1)
- new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm1), TransmittingCommSubsystem.instance().getInternalQueryRepresentation());
- // find transmittingCommSubsystem(Element, Comm2)
- new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Comm2), TransmittingCommSubsystem.instance().getInternalQueryRepresentation());
- // Comm1 != Comm2
- new Inequality(body, var_Comm1, var_Comm2);
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Element")
- }));
- annotation.addAttribute("message", "A communicating element may not have two transmitting communication subsystems..");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java
deleted file mode 100644
index ede57df8..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.CommunicatingElement;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // No communication loops may exist
- * // No spacecraft may directly communicate with itself
- *
- * {@literal @}Constraint(severity = "error", key = {Element},
- * message = "Communication loop.")
- * pattern communicationLoop(Element : CommunicatingElement) {
- * find indirectCommunicationLink(Element, Element);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class CommunicationLoop extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private CommunicatingElement fElement;
-
- private static List parameterNames = makeImmutableList("Element");
-
- private Match(final CommunicatingElement pElement) {
- this.fElement = pElement;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Element".equals(parameterName)) return this.fElement;
- return null;
- }
-
- public CommunicatingElement getElement() {
- return this.fElement;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Element".equals(parameterName) ) {
- this.fElement = (CommunicatingElement) newValue;
- return true;
- }
- return false;
- }
-
- public void setElement(final CommunicatingElement pElement) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fElement = pElement;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop";
- }
-
- @Override
- public List parameterNames() {
- return CommunicationLoop.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fElement};
- }
-
- @Override
- public CommunicationLoop.Match toImmutable() {
- return isMutable() ? newMatch(fElement) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Element\"=" + prettyPrintValue(fElement));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fElement);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof CommunicationLoop.Match)) {
- CommunicationLoop.Match other = (CommunicationLoop.Match) obj;
- return Objects.equals(fElement, other.fElement);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public CommunicationLoop specification() {
- return CommunicationLoop.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static CommunicationLoop.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static CommunicationLoop.Match newMutableMatch(final CommunicatingElement pElement) {
- return new Mutable(pElement);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static CommunicationLoop.Match newMatch(final CommunicatingElement pElement) {
- return new Immutable(pElement);
- }
-
- private static final class Mutable extends CommunicationLoop.Match {
- Mutable(final CommunicatingElement pElement) {
- super(pElement);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends CommunicationLoop.Match {
- Immutable(final CommunicatingElement pElement) {
- super(pElement);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // No communication loops may exist
- * // No spacecraft may directly communicate with itself
- *
- * {@literal @}Constraint(severity = "error", key = {Element},
- * message = "Communication loop.")
- * pattern communicationLoop(Element : CommunicatingElement) {
- * find indirectCommunicationLink(Element, Element);
- * }
- *
- *
- * @see Match
- * @see CommunicationLoop
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static CommunicationLoop.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static CommunicationLoop.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_ELEMENT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLoop.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final CommunicatingElement pElement) {
- return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final CommunicatingElement pElement) {
- return rawStreamAllMatches(new Object[]{pElement});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final CommunicatingElement pElement) {
- return rawGetOneArbitraryMatch(new Object[]{pElement});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final CommunicatingElement pElement) {
- return rawHasMatch(new Object[]{pElement});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final CommunicatingElement pElement) {
- return rawCountMatches(new Object[]{pElement});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer super CommunicationLoop.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pElement}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pElement the fixed value of pattern parameter Element, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public CommunicationLoop.Match newMatch(final CommunicatingElement pElement) {
- return CommunicationLoop.Match.newMatch(pElement);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfElement(final Object[] parameters) {
- return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfElement() {
- return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Element.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfElement() {
- return rawStreamAllValuesOfElement(emptyArray());
- }
-
- @Override
- protected CommunicationLoop.Match tupleToMatch(final Tuple t) {
- try {
- return CommunicationLoop.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CommunicationLoop.Match arrayToMatch(final Object[] match) {
- try {
- return CommunicationLoop.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CommunicationLoop.Match arrayToMatchMutable(final Object[] match) {
- try {
- return CommunicationLoop.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return CommunicationLoop.instance();
- }
- }
-
- private CommunicationLoop() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CommunicationLoop instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected CommunicationLoop.Matcher instantiate(final ViatraQueryEngine engine) {
- return CommunicationLoop.Matcher.on(engine);
- }
-
- @Override
- public CommunicationLoop.Matcher instantiate() {
- return CommunicationLoop.Matcher.create();
- }
-
- @Override
- public CommunicationLoop.Match newEmptyMatch() {
- return CommunicationLoop.Match.newEmptyMatch();
- }
-
- @Override
- public CommunicationLoop.Match newMatch(final Object... parameters) {
- return CommunicationLoop.Match.newMatch((satellite.CommunicatingElement) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop (visibility: PUBLIC, simpleName: CommunicationLoop, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop (visibility: PUBLIC, simpleName: CommunicationLoop, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CommunicationLoop INSTANCE = new CommunicationLoop();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CommunicationLoop.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Element);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Element");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Element = body.getOrCreateVariableByName("Element");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Element, parameter_Element)
- ));
- // find indirectCommunicationLink(Element, Element)
- new PositivePatternCall(body, Tuples.flatTupleOf(var_Element, var_Element), IndirectCommunicationLink.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Element")
- }));
- annotation.addAttribute("message", "Communication loop.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java
deleted file mode 100644
index f372da70..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java
+++ /dev/null
@@ -1,570 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.Spacecraft;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // Only a Small Satellite can be configured with a Ka-band communication system
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Only a Small Satellite can be configured with a Ka-band communication system.")
- * pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) {
- * CommunicatingElement.commSubsystem(Spacecraft, Comm);
- * KaCommSubsystem(Comm);
- * neg find smallSat(Spacecraft);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class CubeSatWithKaAntenna extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private Spacecraft fSpacecraft;
-
- private static List parameterNames = makeImmutableList("Spacecraft");
-
- private Match(final Spacecraft pSpacecraft) {
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Spacecraft".equals(parameterName)) return this.fSpacecraft;
- return null;
- }
-
- public Spacecraft getSpacecraft() {
- return this.fSpacecraft;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Spacecraft".equals(parameterName) ) {
- this.fSpacecraft = (Spacecraft) newValue;
- return true;
- }
- return false;
- }
-
- public void setSpacecraft(final Spacecraft pSpacecraft) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna";
- }
-
- @Override
- public List parameterNames() {
- return CubeSatWithKaAntenna.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSpacecraft};
- }
-
- @Override
- public CubeSatWithKaAntenna.Match toImmutable() {
- return isMutable() ? newMatch(fSpacecraft) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSpacecraft);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof CubeSatWithKaAntenna.Match)) {
- CubeSatWithKaAntenna.Match other = (CubeSatWithKaAntenna.Match) obj;
- return Objects.equals(fSpacecraft, other.fSpacecraft);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public CubeSatWithKaAntenna specification() {
- return CubeSatWithKaAntenna.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static CubeSatWithKaAntenna.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static CubeSatWithKaAntenna.Match newMutableMatch(final Spacecraft pSpacecraft) {
- return new Mutable(pSpacecraft);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static CubeSatWithKaAntenna.Match newMatch(final Spacecraft pSpacecraft) {
- return new Immutable(pSpacecraft);
- }
-
- private static final class Mutable extends CubeSatWithKaAntenna.Match {
- Mutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends CubeSatWithKaAntenna.Match {
- Immutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // Only a Small Satellite can be configured with a Ka-band communication system
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Only a Small Satellite can be configured with a Ka-band communication system.")
- * pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) {
- * CommunicatingElement.commSubsystem(Spacecraft, Comm);
- * KaCommSubsystem(Comm);
- * neg find smallSat(Spacecraft);
- * }
- *
- *
- * @see Match
- * @see CubeSatWithKaAntenna
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static CubeSatWithKaAntenna.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static CubeSatWithKaAntenna.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SPACECRAFT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CubeSatWithKaAntenna.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final Spacecraft pSpacecraft) {
- return rawGetOneArbitraryMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Spacecraft pSpacecraft) {
- return rawHasMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Spacecraft pSpacecraft) {
- return rawCountMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer super CubeSatWithKaAntenna.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public CubeSatWithKaAntenna.Match newMatch(final Spacecraft pSpacecraft) {
- return CubeSatWithKaAntenna.Match.newMatch(pSpacecraft);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSpacecraft(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray());
- }
-
- @Override
- protected CubeSatWithKaAntenna.Match tupleToMatch(final Tuple t) {
- try {
- return CubeSatWithKaAntenna.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CubeSatWithKaAntenna.Match arrayToMatch(final Object[] match) {
- try {
- return CubeSatWithKaAntenna.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CubeSatWithKaAntenna.Match arrayToMatchMutable(final Object[] match) {
- try {
- return CubeSatWithKaAntenna.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return CubeSatWithKaAntenna.instance();
- }
- }
-
- private CubeSatWithKaAntenna() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CubeSatWithKaAntenna instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected CubeSatWithKaAntenna.Matcher instantiate(final ViatraQueryEngine engine) {
- return CubeSatWithKaAntenna.Matcher.on(engine);
- }
-
- @Override
- public CubeSatWithKaAntenna.Matcher instantiate() {
- return CubeSatWithKaAntenna.Matcher.create();
- }
-
- @Override
- public CubeSatWithKaAntenna.Match newEmptyMatch() {
- return CubeSatWithKaAntenna.Match.newEmptyMatch();
- }
-
- @Override
- public CubeSatWithKaAntenna.Match newMatch(final Object... parameters) {
- return CubeSatWithKaAntenna.Match.newMatch((satellite.Spacecraft) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna (visibility: PUBLIC, simpleName: CubeSatWithKaAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna (visibility: PUBLIC, simpleName: CubeSatWithKaAntenna, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CubeSatWithKaAntenna INSTANCE = new CubeSatWithKaAntenna();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CubeSatWithKaAntenna.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Spacecraft);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Spacecraft");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
- PVariable var_Comm = body.getOrCreateVariableByName("Comm");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft)
- ));
- // CommunicatingElement.commSubsystem(Spacecraft, Comm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_0_, var_Comm);
- // KaCommSubsystem(Comm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "KaCommSubsystem")));
- // neg find smallSat(Spacecraft)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SmallSat.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Spacecraft")
- }));
- annotation.addAttribute("message", "Only a Small Satellite can be configured with a Ka-band communication system.");
- addAnnotation(annotation);
- }
- 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
deleted file mode 100644
index af53fc9f..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingCommSubsystem;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.CommSubsystem;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // Source and target communication systems must be compatible.
- *
- * {@literal @}Constraint(severity = "error", key = {SourceSubsystem},
- * message = "Two ends of a communication link must use the same band.")
- * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) {
- * CommSubsystem.target(SourceSubsystem, TargetSubsystem);
- * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private CommSubsystem fSourceSubsystem;
-
- private static List parameterNames = makeImmutableList("SourceSubsystem");
-
- private Match(final CommSubsystem pSourceSubsystem) {
- this.fSourceSubsystem = pSourceSubsystem;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("SourceSubsystem".equals(parameterName)) return this.fSourceSubsystem;
- return null;
- }
-
- public CommSubsystem getSourceSubsystem() {
- return this.fSourceSubsystem;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("SourceSubsystem".equals(parameterName) ) {
- this.fSourceSubsystem = (CommSubsystem) newValue;
- return true;
- }
- return false;
- }
-
- public void setSourceSubsystem(final CommSubsystem pSourceSubsystem) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSourceSubsystem = pSourceSubsystem;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand";
- }
-
- @Override
- public List parameterNames() {
- return IncompatibleSourceAndTargetBand.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSourceSubsystem};
- }
-
- @Override
- public IncompatibleSourceAndTargetBand.Match toImmutable() {
- return isMutable() ? newMatch(fSourceSubsystem) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"SourceSubsystem\"=" + prettyPrintValue(fSourceSubsystem));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSourceSubsystem);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) {
- IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj;
- return Objects.equals(fSourceSubsystem, other.fSourceSubsystem);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public IncompatibleSourceAndTargetBand specification() {
- return IncompatibleSourceAndTargetBand.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static IncompatibleSourceAndTargetBand.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final CommSubsystem pSourceSubsystem) {
- return new Mutable(pSourceSubsystem);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) {
- return new Immutable(pSourceSubsystem);
- }
-
- private static final class Mutable extends IncompatibleSourceAndTargetBand.Match {
- Mutable(final CommSubsystem pSourceSubsystem) {
- super(pSourceSubsystem);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends IncompatibleSourceAndTargetBand.Match {
- Immutable(final CommSubsystem pSourceSubsystem) {
- super(pSourceSubsystem);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // Source and target communication systems must be compatible.
- *
- * {@literal @}Constraint(severity = "error", key = {SourceSubsystem},
- * message = "Two ends of a communication link must use the same band.")
- * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) {
- * CommSubsystem.target(SourceSubsystem, TargetSubsystem);
- * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem);
- * }
- *
- *
- * @see Match
- * @see IncompatibleSourceAndTargetBand
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static IncompatibleSourceAndTargetBand.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static IncompatibleSourceAndTargetBand.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SOURCESUBSYSTEM = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final CommSubsystem pSourceSubsystem) {
- return rawStreamAllMatches(new Object[]{pSourceSubsystem}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final CommSubsystem pSourceSubsystem) {
- return rawStreamAllMatches(new Object[]{pSourceSubsystem});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final CommSubsystem pSourceSubsystem) {
- return rawGetOneArbitraryMatch(new Object[]{pSourceSubsystem});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final CommSubsystem pSourceSubsystem) {
- return rawHasMatch(new Object[]{pSourceSubsystem});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final CommSubsystem pSourceSubsystem) {
- return rawCountMatches(new Object[]{pSourceSubsystem});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final CommSubsystem pSourceSubsystem, final Consumer super IncompatibleSourceAndTargetBand.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSourceSubsystem}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) {
- return IncompatibleSourceAndTargetBand.Match.newMatch(pSourceSubsystem);
- }
-
- /**
- * Retrieve the set of values that occur in matches for SourceSubsystem.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSourceSubsystem(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SOURCESUBSYSTEM, parameters).map(CommSubsystem.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for SourceSubsystem.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSourceSubsystem() {
- return rawStreamAllValuesOfSourceSubsystem(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for SourceSubsystem.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSourceSubsystem() {
- return rawStreamAllValuesOfSourceSubsystem(emptyArray());
- }
-
- @Override
- protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) {
- try {
- return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) t.get(POSITION_SOURCESUBSYSTEM));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) {
- try {
- return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) {
- try {
- return IncompatibleSourceAndTargetBand.Match.newMutableMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return IncompatibleSourceAndTargetBand.instance();
- }
- }
-
- private IncompatibleSourceAndTargetBand() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IncompatibleSourceAndTargetBand instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected IncompatibleSourceAndTargetBand.Matcher instantiate(final ViatraQueryEngine engine) {
- return IncompatibleSourceAndTargetBand.Matcher.on(engine);
- }
-
- @Override
- public IncompatibleSourceAndTargetBand.Matcher instantiate() {
- return IncompatibleSourceAndTargetBand.Matcher.create();
- }
-
- @Override
- public IncompatibleSourceAndTargetBand.Match newEmptyMatch() {
- return IncompatibleSourceAndTargetBand.Match.newEmptyMatch();
- }
-
- @Override
- public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) {
- return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.CommSubsystem) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand (visibility: PUBLIC, simpleName: IncompatibleSourceAndTargetBand, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand (visibility: PUBLIC, simpleName: IncompatibleSourceAndTargetBand, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final IncompatibleSourceAndTargetBand INSTANCE = new IncompatibleSourceAndTargetBand();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_SourceSubsystem = new PParameter("SourceSubsystem", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_SourceSubsystem);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("SourceSubsystem");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem");
- PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem");
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_SourceSubsystem, parameter_SourceSubsystem)
- ));
- // CommSubsystem.target(SourceSubsystem, TargetSubsystem)
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_0_, var_TargetSubsystem);
- // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("SourceSubsystem")
- }));
- annotation.addAttribute("message", "Two ends of a communication link must use the same band.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java
deleted file mode 100644
index 45952f33..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.Spacecraft;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // All spacecraft must have some communication path to the ground station
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Spacecraft has no communication path to the ground station.")
- * pattern noLinkToGroundStation(Spacecraft : Spacecraft) {
- * ConstellationMission.groundStationNetwork(Mission, GroundStation);
- * ConstellationMission.spacecraft(Mission, Spacecraft);
- * neg find indirectCommunicationLink(Spacecraft, GroundStation);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class NoLinkToGroundStation extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private Spacecraft fSpacecraft;
-
- private static List parameterNames = makeImmutableList("Spacecraft");
-
- private Match(final Spacecraft pSpacecraft) {
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Spacecraft".equals(parameterName)) return this.fSpacecraft;
- return null;
- }
-
- public Spacecraft getSpacecraft() {
- return this.fSpacecraft;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Spacecraft".equals(parameterName) ) {
- this.fSpacecraft = (Spacecraft) newValue;
- return true;
- }
- return false;
- }
-
- public void setSpacecraft(final Spacecraft pSpacecraft) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation";
- }
-
- @Override
- public List parameterNames() {
- return NoLinkToGroundStation.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSpacecraft};
- }
-
- @Override
- public NoLinkToGroundStation.Match toImmutable() {
- return isMutable() ? newMatch(fSpacecraft) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSpacecraft);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof NoLinkToGroundStation.Match)) {
- NoLinkToGroundStation.Match other = (NoLinkToGroundStation.Match) obj;
- return Objects.equals(fSpacecraft, other.fSpacecraft);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public NoLinkToGroundStation specification() {
- return NoLinkToGroundStation.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static NoLinkToGroundStation.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static NoLinkToGroundStation.Match newMutableMatch(final Spacecraft pSpacecraft) {
- return new Mutable(pSpacecraft);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static NoLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) {
- return new Immutable(pSpacecraft);
- }
-
- private static final class Mutable extends NoLinkToGroundStation.Match {
- Mutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends NoLinkToGroundStation.Match {
- Immutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // All spacecraft must have some communication path to the ground station
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Spacecraft has no communication path to the ground station.")
- * pattern noLinkToGroundStation(Spacecraft : Spacecraft) {
- * ConstellationMission.groundStationNetwork(Mission, GroundStation);
- * ConstellationMission.spacecraft(Mission, Spacecraft);
- * neg find indirectCommunicationLink(Spacecraft, GroundStation);
- * }
- *
- *
- * @see Match
- * @see NoLinkToGroundStation
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static NoLinkToGroundStation.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static NoLinkToGroundStation.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SPACECRAFT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NoLinkToGroundStation.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final Spacecraft pSpacecraft) {
- return rawGetOneArbitraryMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Spacecraft pSpacecraft) {
- return rawHasMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Spacecraft pSpacecraft) {
- return rawCountMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer super NoLinkToGroundStation.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public NoLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) {
- return NoLinkToGroundStation.Match.newMatch(pSpacecraft);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSpacecraft(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray());
- }
-
- @Override
- protected NoLinkToGroundStation.Match tupleToMatch(final Tuple t) {
- try {
- return NoLinkToGroundStation.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NoLinkToGroundStation.Match arrayToMatch(final Object[] match) {
- try {
- return NoLinkToGroundStation.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NoLinkToGroundStation.Match arrayToMatchMutable(final Object[] match) {
- try {
- return NoLinkToGroundStation.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return NoLinkToGroundStation.instance();
- }
- }
-
- private NoLinkToGroundStation() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static NoLinkToGroundStation instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected NoLinkToGroundStation.Matcher instantiate(final ViatraQueryEngine engine) {
- return NoLinkToGroundStation.Matcher.on(engine);
- }
-
- @Override
- public NoLinkToGroundStation.Matcher instantiate() {
- return NoLinkToGroundStation.Matcher.create();
- }
-
- @Override
- public NoLinkToGroundStation.Match newEmptyMatch() {
- return NoLinkToGroundStation.Match.newEmptyMatch();
- }
-
- @Override
- public NoLinkToGroundStation.Match newMatch(final Object... parameters) {
- return NoLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation (visibility: PUBLIC, simpleName: NoLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation (visibility: PUBLIC, simpleName: NoLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final NoLinkToGroundStation INSTANCE = new NoLinkToGroundStation();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final NoLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Spacecraft);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Spacecraft");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
- PVariable var_Mission = body.getOrCreateVariableByName("Mission");
- PVariable var_GroundStation = body.getOrCreateVariableByName("GroundStation");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft)
- ));
- // ConstellationMission.groundStationNetwork(Mission, GroundStation)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "groundStationNetwork")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
- new Equality(body, var__virtual_0_, var_GroundStation);
- // ConstellationMission.spacecraft(Mission, Spacecraft)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
- new Equality(body, var__virtual_1_, var_Spacecraft);
- // neg find indirectCommunicationLink(Spacecraft, GroundStation)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_GroundStation), IndirectCommunicationLink.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Spacecraft")
- }));
- annotation.addAttribute("message", "Spacecraft has no communication path to the ground station.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java
deleted file mode 100644
index 3366de46..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java
+++ /dev/null
@@ -1,571 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.Spacecraft;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Spacecraft has no potential communication path to the ground station.")
- * pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) {
- * ConstellationMission.groundStationNetwork(Mission, GroundStation);
- * ConstellationMission.spacecraft(Mission, Spacecraft);
- * neg find indirectLinkAllowed(Spacecraft, GroundStation);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class NoPotentialLinkToGroundStation extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private Spacecraft fSpacecraft;
-
- private static List parameterNames = makeImmutableList("Spacecraft");
-
- private Match(final Spacecraft pSpacecraft) {
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Spacecraft".equals(parameterName)) return this.fSpacecraft;
- return null;
- }
-
- public Spacecraft getSpacecraft() {
- return this.fSpacecraft;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Spacecraft".equals(parameterName) ) {
- this.fSpacecraft = (Spacecraft) newValue;
- return true;
- }
- return false;
- }
-
- public void setSpacecraft(final Spacecraft pSpacecraft) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSpacecraft = pSpacecraft;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation";
- }
-
- @Override
- public List parameterNames() {
- return NoPotentialLinkToGroundStation.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSpacecraft};
- }
-
- @Override
- public NoPotentialLinkToGroundStation.Match toImmutable() {
- return isMutable() ? newMatch(fSpacecraft) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Spacecraft\"=" + prettyPrintValue(fSpacecraft));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSpacecraft);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof NoPotentialLinkToGroundStation.Match)) {
- NoPotentialLinkToGroundStation.Match other = (NoPotentialLinkToGroundStation.Match) obj;
- return Objects.equals(fSpacecraft, other.fSpacecraft);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public NoPotentialLinkToGroundStation specification() {
- return NoPotentialLinkToGroundStation.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static NoPotentialLinkToGroundStation.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static NoPotentialLinkToGroundStation.Match newMutableMatch(final Spacecraft pSpacecraft) {
- return new Mutable(pSpacecraft);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static NoPotentialLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) {
- return new Immutable(pSpacecraft);
- }
-
- private static final class Mutable extends NoPotentialLinkToGroundStation.Match {
- Mutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends NoPotentialLinkToGroundStation.Match {
- Immutable(final Spacecraft pSpacecraft) {
- super(pSpacecraft);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * {@literal @}Constraint(severity = "error", key = {Spacecraft},
- * message = "Spacecraft has no potential communication path to the ground station.")
- * pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) {
- * ConstellationMission.groundStationNetwork(Mission, GroundStation);
- * ConstellationMission.spacecraft(Mission, Spacecraft);
- * neg find indirectLinkAllowed(Spacecraft, GroundStation);
- * }
- *
- *
- * @see Match
- * @see NoPotentialLinkToGroundStation
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static NoPotentialLinkToGroundStation.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static NoPotentialLinkToGroundStation.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SPACECRAFT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NoPotentialLinkToGroundStation.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final Spacecraft pSpacecraft) {
- return rawStreamAllMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final Spacecraft pSpacecraft) {
- return rawGetOneArbitraryMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Spacecraft pSpacecraft) {
- return rawHasMatch(new Object[]{pSpacecraft});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Spacecraft pSpacecraft) {
- return rawCountMatches(new Object[]{pSpacecraft});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Spacecraft pSpacecraft, final Consumer super NoPotentialLinkToGroundStation.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSpacecraft}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSpacecraft the fixed value of pattern parameter Spacecraft, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public NoPotentialLinkToGroundStation.Match newMatch(final Spacecraft pSpacecraft) {
- return NoPotentialLinkToGroundStation.Match.newMatch(pSpacecraft);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSpacecraft(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SPACECRAFT, parameters).map(Spacecraft.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Spacecraft.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSpacecraft() {
- return rawStreamAllValuesOfSpacecraft(emptyArray());
- }
-
- @Override
- protected NoPotentialLinkToGroundStation.Match tupleToMatch(final Tuple t) {
- try {
- return NoPotentialLinkToGroundStation.Match.newMatch((Spacecraft) t.get(POSITION_SPACECRAFT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NoPotentialLinkToGroundStation.Match arrayToMatch(final Object[] match) {
- try {
- return NoPotentialLinkToGroundStation.Match.newMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NoPotentialLinkToGroundStation.Match arrayToMatchMutable(final Object[] match) {
- try {
- return NoPotentialLinkToGroundStation.Match.newMutableMatch((Spacecraft) match[POSITION_SPACECRAFT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return NoPotentialLinkToGroundStation.instance();
- }
- }
-
- private NoPotentialLinkToGroundStation() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static NoPotentialLinkToGroundStation instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected NoPotentialLinkToGroundStation.Matcher instantiate(final ViatraQueryEngine engine) {
- return NoPotentialLinkToGroundStation.Matcher.on(engine);
- }
-
- @Override
- public NoPotentialLinkToGroundStation.Matcher instantiate() {
- return NoPotentialLinkToGroundStation.Matcher.create();
- }
-
- @Override
- public NoPotentialLinkToGroundStation.Match newEmptyMatch() {
- return NoPotentialLinkToGroundStation.Match.newEmptyMatch();
- }
-
- @Override
- public NoPotentialLinkToGroundStation.Match newMatch(final Object... parameters) {
- return NoPotentialLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation (visibility: PUBLIC, simpleName: NoPotentialLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation (visibility: PUBLIC, simpleName: NoPotentialLinkToGroundStation, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final NoPotentialLinkToGroundStation INSTANCE = new NoPotentialLinkToGroundStation();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final NoPotentialLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Spacecraft);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Spacecraft");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
- PVariable var_Mission = body.getOrCreateVariableByName("Mission");
- PVariable var_GroundStation = body.getOrCreateVariableByName("GroundStation");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft)
- ));
- // ConstellationMission.groundStationNetwork(Mission, GroundStation)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "groundStationNetwork")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
- new Equality(body, var__virtual_0_, var_GroundStation);
- // ConstellationMission.spacecraft(Mission, Spacecraft)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
- new Equality(body, var__virtual_1_, var_Spacecraft);
- // neg find indirectLinkAllowed(Spacecraft, GroundStation)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_GroundStation), IndirectLinkAllowed.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Spacecraft")
- }));
- annotation.addAttribute("message", "Spacecraft has no potential communication path to the ground station.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java
deleted file mode 100644
index bdd97100..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.InterferometryMission;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // At least two spacecraft must have the interferometry payload configured
- *
- * {@literal @}Constraint(severity = "error", key = {Mission},
- * message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.")
- * pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) {
- * InterferometryMission(Mission);
- * neg find atLeastTwoInterferometryPayloads(Mission);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class NotEnoughInterferometryPayloads extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private InterferometryMission fMission;
-
- private static List parameterNames = makeImmutableList("Mission");
-
- private Match(final InterferometryMission pMission) {
- this.fMission = pMission;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Mission".equals(parameterName)) return this.fMission;
- return null;
- }
-
- public InterferometryMission getMission() {
- return this.fMission;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Mission".equals(parameterName) ) {
- this.fMission = (InterferometryMission) newValue;
- return true;
- }
- return false;
- }
-
- public void setMission(final InterferometryMission pMission) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fMission = pMission;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads";
- }
-
- @Override
- public List parameterNames() {
- return NotEnoughInterferometryPayloads.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fMission};
- }
-
- @Override
- public NotEnoughInterferometryPayloads.Match toImmutable() {
- return isMutable() ? newMatch(fMission) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Mission\"=" + prettyPrintValue(fMission));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fMission);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof NotEnoughInterferometryPayloads.Match)) {
- NotEnoughInterferometryPayloads.Match other = (NotEnoughInterferometryPayloads.Match) obj;
- return Objects.equals(fMission, other.fMission);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public NotEnoughInterferometryPayloads specification() {
- return NotEnoughInterferometryPayloads.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static NotEnoughInterferometryPayloads.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static NotEnoughInterferometryPayloads.Match newMutableMatch(final InterferometryMission pMission) {
- return new Mutable(pMission);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static NotEnoughInterferometryPayloads.Match newMatch(final InterferometryMission pMission) {
- return new Immutable(pMission);
- }
-
- private static final class Mutable extends NotEnoughInterferometryPayloads.Match {
- Mutable(final InterferometryMission pMission) {
- super(pMission);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends NotEnoughInterferometryPayloads.Match {
- Immutable(final InterferometryMission pMission) {
- super(pMission);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // At least two spacecraft must have the interferometry payload configured
- *
- * {@literal @}Constraint(severity = "error", key = {Mission},
- * message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.")
- * pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) {
- * InterferometryMission(Mission);
- * neg find atLeastTwoInterferometryPayloads(Mission);
- * }
- *
- *
- * @see Match
- * @see NotEnoughInterferometryPayloads
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static NotEnoughInterferometryPayloads.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static NotEnoughInterferometryPayloads.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_MISSION = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NotEnoughInterferometryPayloads.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final InterferometryMission pMission) {
- return rawStreamAllMatches(new Object[]{pMission}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final InterferometryMission pMission) {
- return rawStreamAllMatches(new Object[]{pMission});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final InterferometryMission pMission) {
- return rawGetOneArbitraryMatch(new Object[]{pMission});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final InterferometryMission pMission) {
- return rawHasMatch(new Object[]{pMission});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final InterferometryMission pMission) {
- return rawCountMatches(new Object[]{pMission});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final InterferometryMission pMission, final Consumer super NotEnoughInterferometryPayloads.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pMission}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pMission the fixed value of pattern parameter Mission, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public NotEnoughInterferometryPayloads.Match newMatch(final InterferometryMission pMission) {
- return NotEnoughInterferometryPayloads.Match.newMatch(pMission);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Mission.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfMission(final Object[] parameters) {
- return rawStreamAllValues(POSITION_MISSION, parameters).map(InterferometryMission.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Mission.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfMission() {
- return rawStreamAllValuesOfMission(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Mission.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfMission() {
- return rawStreamAllValuesOfMission(emptyArray());
- }
-
- @Override
- protected NotEnoughInterferometryPayloads.Match tupleToMatch(final Tuple t) {
- try {
- return NotEnoughInterferometryPayloads.Match.newMatch((InterferometryMission) t.get(POSITION_MISSION));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NotEnoughInterferometryPayloads.Match arrayToMatch(final Object[] match) {
- try {
- return NotEnoughInterferometryPayloads.Match.newMatch((InterferometryMission) match[POSITION_MISSION]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected NotEnoughInterferometryPayloads.Match arrayToMatchMutable(final Object[] match) {
- try {
- return NotEnoughInterferometryPayloads.Match.newMutableMatch((InterferometryMission) match[POSITION_MISSION]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return NotEnoughInterferometryPayloads.instance();
- }
- }
-
- private NotEnoughInterferometryPayloads() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static NotEnoughInterferometryPayloads instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected NotEnoughInterferometryPayloads.Matcher instantiate(final ViatraQueryEngine engine) {
- return NotEnoughInterferometryPayloads.Matcher.on(engine);
- }
-
- @Override
- public NotEnoughInterferometryPayloads.Matcher instantiate() {
- return NotEnoughInterferometryPayloads.Matcher.create();
- }
-
- @Override
- public NotEnoughInterferometryPayloads.Match newEmptyMatch() {
- return NotEnoughInterferometryPayloads.Match.newEmptyMatch();
- }
-
- @Override
- public NotEnoughInterferometryPayloads.Match newMatch(final Object... parameters) {
- return NotEnoughInterferometryPayloads.Match.newMatch((satellite.InterferometryMission) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads (visibility: PUBLIC, simpleName: NotEnoughInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads (visibility: PUBLIC, simpleName: NotEnoughInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final NotEnoughInterferometryPayloads INSTANCE = new NotEnoughInterferometryPayloads();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final NotEnoughInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Mission);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Mission");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Mission = body.getOrCreateVariableByName("Mission");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Mission, parameter_Mission)
- ));
- // InterferometryMission(Mission)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
- // neg find atLeastTwoInterferometryPayloads(Mission)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_Mission), AtLeastTwoInterferometryPayloads.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Mission")
- }));
- annotation.addAttribute("message", "Interferometry mission needs at least two spacecraft configured with the interferometry payload.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
deleted file mode 100644
index 9025d93a..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
-
-/**
- * A pattern group formed of all public patterns defined in SatelliteQueries.vql.
- *
- * Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
- * a VIATRA Query engine for matching all patterns originally defined in file SatelliteQueries.vql,
- * in order to achieve better performance than one-by-one on-demand matcher initialization.
- *
- *
From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns:
- * - communicationLinkDoesNotStartAtContainingElement
- * - notEnoughInterferometryPayloads
- * - noLinkToGroundStation
- * - noPotentialLinkToGroundStation
- * - communicationLoop
- * - incompatibleSourceAndTargetBand
- * - threeUCubeSatWithNonUhfCrossLink
- * - cubeSatWithKaAntenna
- * - smallSat
- *
- *
- * @see IQueryGroup
- *
- */
-@SuppressWarnings("all")
-public final class SatelliteQueries extends BaseGeneratedPatternGroup {
- /**
- * Access the pattern group.
- *
- * @return the singleton instance of the group
- * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
- *
- */
- public static SatelliteQueries instance() {
- if (INSTANCE == null) {
- INSTANCE = new SatelliteQueries();
- }
- return INSTANCE;
- }
-
- private static SatelliteQueries INSTANCE;
-
- private SatelliteQueries() {
- querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance());
- querySpecifications.add(NotEnoughInterferometryPayloads.instance());
- querySpecifications.add(NoLinkToGroundStation.instance());
- querySpecifications.add(NoPotentialLinkToGroundStation.instance());
- querySpecifications.add(CommunicationLoop.instance());
- querySpecifications.add(IncompatibleSourceAndTargetBand.instance());
- querySpecifications.add(ThreeUCubeSatWithNonUhfCrossLink.instance());
- querySpecifications.add(CubeSatWithKaAntenna.instance());
- querySpecifications.add(SmallSat.instance());
- }
-
- public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() {
- return CommunicationLinkDoesNotStartAtContainingElement.instance();
- }
-
- public CommunicationLinkDoesNotStartAtContainingElement.Matcher getCommunicationLinkDoesNotStartAtContainingElement(final ViatraQueryEngine engine) {
- return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine);
- }
-
- public NotEnoughInterferometryPayloads getNotEnoughInterferometryPayloads() {
- return NotEnoughInterferometryPayloads.instance();
- }
-
- public NotEnoughInterferometryPayloads.Matcher getNotEnoughInterferometryPayloads(final ViatraQueryEngine engine) {
- return NotEnoughInterferometryPayloads.Matcher.on(engine);
- }
-
- public NoLinkToGroundStation getNoLinkToGroundStation() {
- return NoLinkToGroundStation.instance();
- }
-
- public NoLinkToGroundStation.Matcher getNoLinkToGroundStation(final ViatraQueryEngine engine) {
- return NoLinkToGroundStation.Matcher.on(engine);
- }
-
- public NoPotentialLinkToGroundStation getNoPotentialLinkToGroundStation() {
- return NoPotentialLinkToGroundStation.instance();
- }
-
- public NoPotentialLinkToGroundStation.Matcher getNoPotentialLinkToGroundStation(final ViatraQueryEngine engine) {
- return NoPotentialLinkToGroundStation.Matcher.on(engine);
- }
-
- public CommunicationLoop getCommunicationLoop() {
- return CommunicationLoop.instance();
- }
-
- public CommunicationLoop.Matcher getCommunicationLoop(final ViatraQueryEngine engine) {
- return CommunicationLoop.Matcher.on(engine);
- }
-
- public IncompatibleSourceAndTargetBand getIncompatibleSourceAndTargetBand() {
- return IncompatibleSourceAndTargetBand.instance();
- }
-
- public IncompatibleSourceAndTargetBand.Matcher getIncompatibleSourceAndTargetBand(final ViatraQueryEngine engine) {
- return IncompatibleSourceAndTargetBand.Matcher.on(engine);
- }
-
- public ThreeUCubeSatWithNonUhfCrossLink getThreeUCubeSatWithNonUhfCrossLink() {
- return ThreeUCubeSatWithNonUhfCrossLink.instance();
- }
-
- public ThreeUCubeSatWithNonUhfCrossLink.Matcher getThreeUCubeSatWithNonUhfCrossLink(final ViatraQueryEngine engine) {
- return ThreeUCubeSatWithNonUhfCrossLink.Matcher.on(engine);
- }
-
- public CubeSatWithKaAntenna getCubeSatWithKaAntenna() {
- return CubeSatWithKaAntenna.instance();
- }
-
- public CubeSatWithKaAntenna.Matcher getCubeSatWithKaAntenna(final ViatraQueryEngine engine) {
- return CubeSatWithKaAntenna.Matcher.on(engine);
- }
-
- public SmallSat getSmallSat() {
- return SmallSat.instance();
- }
-
- public SmallSat.Matcher getSmallSat(final ViatraQueryEngine engine) {
- return SmallSat.Matcher.on(engine);
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java
deleted file mode 100644
index 4791740e..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * pattern smallSat(Sat : SmallSat) {
- * SmallSat(Sat);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class SmallSat extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private satellite.SmallSat fSat;
-
- private static List parameterNames = makeImmutableList("Sat");
-
- private Match(final satellite.SmallSat pSat) {
- this.fSat = pSat;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Sat".equals(parameterName)) return this.fSat;
- return null;
- }
-
- public satellite.SmallSat getSat() {
- return this.fSat;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Sat".equals(parameterName) ) {
- this.fSat = (satellite.SmallSat) newValue;
- return true;
- }
- return false;
- }
-
- public void setSat(final satellite.SmallSat pSat) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSat = pSat;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat";
- }
-
- @Override
- public List parameterNames() {
- return SmallSat.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSat};
- }
-
- @Override
- public SmallSat.Match toImmutable() {
- return isMutable() ? newMatch(fSat) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Sat\"=" + prettyPrintValue(fSat));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSat);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof SmallSat.Match)) {
- SmallSat.Match other = (SmallSat.Match) obj;
- return Objects.equals(fSat, other.fSat);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public SmallSat specification() {
- return SmallSat.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static SmallSat.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static SmallSat.Match newMutableMatch(final satellite.SmallSat pSat) {
- return new Mutable(pSat);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static SmallSat.Match newMatch(final satellite.SmallSat pSat) {
- return new Immutable(pSat);
- }
-
- private static final class Mutable extends SmallSat.Match {
- Mutable(final satellite.SmallSat pSat) {
- super(pSat);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends SmallSat.Match {
- Immutable(final satellite.SmallSat pSat) {
- super(pSat);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * pattern smallSat(Sat : SmallSat) {
- * SmallSat(Sat);
- * }
- *
- *
- * @see Match
- * @see SmallSat
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static SmallSat.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static SmallSat.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SAT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(SmallSat.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final satellite.SmallSat pSat) {
- return rawStreamAllMatches(new Object[]{pSat}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final satellite.SmallSat pSat) {
- return rawStreamAllMatches(new Object[]{pSat});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final satellite.SmallSat pSat) {
- return rawGetOneArbitraryMatch(new Object[]{pSat});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final satellite.SmallSat pSat) {
- return rawHasMatch(new Object[]{pSat});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final satellite.SmallSat pSat) {
- return rawCountMatches(new Object[]{pSat});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final satellite.SmallSat pSat, final Consumer super SmallSat.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSat}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public SmallSat.Match newMatch(final satellite.SmallSat pSat) {
- return SmallSat.Match.newMatch(pSat);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSat(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SAT, parameters).map(satellite.SmallSat.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSat() {
- return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSat() {
- return rawStreamAllValuesOfSat(emptyArray());
- }
-
- @Override
- protected SmallSat.Match tupleToMatch(final Tuple t) {
- try {
- return SmallSat.Match.newMatch((satellite.SmallSat) t.get(POSITION_SAT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected SmallSat.Match arrayToMatch(final Object[] match) {
- try {
- return SmallSat.Match.newMatch((satellite.SmallSat) match[POSITION_SAT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected SmallSat.Match arrayToMatchMutable(final Object[] match) {
- try {
- return SmallSat.Match.newMutableMatch((satellite.SmallSat) match[POSITION_SAT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return SmallSat.instance();
- }
- }
-
- private SmallSat() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static SmallSat instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected SmallSat.Matcher instantiate(final ViatraQueryEngine engine) {
- return SmallSat.Matcher.on(engine);
- }
-
- @Override
- public SmallSat.Matcher instantiate() {
- return SmallSat.Matcher.create();
- }
-
- @Override
- public SmallSat.Match newEmptyMatch() {
- return SmallSat.Match.newEmptyMatch();
- }
-
- @Override
- public SmallSat.Match newMatch(final Object... parameters) {
- return SmallSat.Match.newMatch((satellite.SmallSat) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat (visibility: PUBLIC, simpleName: SmallSat, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat (visibility: PUBLIC, simpleName: SmallSat, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final SmallSat INSTANCE = new SmallSat();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final SmallSat.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Sat = new PParameter("Sat", "satellite.SmallSat", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "SmallSat")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Sat);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Sat");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Sat = body.getOrCreateVariableByName("Sat");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Sat, parameter_Sat)
- ));
- // SmallSat(Sat)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat")));
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
deleted file mode 100644
index 0fe520c2..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-import satellite.CubeSat3U;
-
-/**
- * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
- *
- * Original source:
- *
- * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter,
- * // but cross-link using UHF
- *
- * {@literal @}Constraint(severity = "error", key = {Sat},
- * message = "3U CubeSats can only cross-link using UHF.")
- * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
- * CommunicatingElement.commSubsystem(Sat, SourceComm);
- * neg find commSubsystemBandUhf(SourceComm);
- * CommSubsystem.target(SourceComm, TargetComm);
- * CommunicatingElement.commSubsystem(Target, TargetComm);
- * neg find groundStationNetwork(Target);
- * }
- *
- *
- * @see Matcher
- * @see Match
- *
- */
-@SuppressWarnings("all")
-public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuerySpecification {
- /**
- * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern,
- * to be used in conjunction with {@link Matcher}.
- *
- * Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see Matcher
- *
- */
- public static abstract class Match extends BasePatternMatch {
- private CubeSat3U fSat;
-
- private static List parameterNames = makeImmutableList("Sat");
-
- private Match(final CubeSat3U pSat) {
- this.fSat = pSat;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("Sat".equals(parameterName)) return this.fSat;
- return null;
- }
-
- public CubeSat3U getSat() {
- return this.fSat;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("Sat".equals(parameterName) ) {
- this.fSat = (CubeSat3U) newValue;
- return true;
- }
- return false;
- }
-
- public void setSat(final CubeSat3U pSat) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fSat = pSat;
- }
-
- @Override
- public String patternName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink";
- }
-
- @Override
- public List parameterNames() {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fSat};
- }
-
- @Override
- public ThreeUCubeSatWithNonUhfCrossLink.Match toImmutable() {
- return isMutable() ? newMatch(fSat) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"Sat\"=" + prettyPrintValue(fSat));
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(fSat);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (obj == null) {
- return false;
- }
- if ((obj instanceof ThreeUCubeSatWithNonUhfCrossLink.Match)) {
- ThreeUCubeSatWithNonUhfCrossLink.Match other = (ThreeUCubeSatWithNonUhfCrossLink.Match) obj;
- return Objects.equals(fSat, other.fSat);
- } else {
- // this should be infrequent
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- }
-
- @Override
- public ThreeUCubeSatWithNonUhfCrossLink specification() {
- return ThreeUCubeSatWithNonUhfCrossLink.instance();
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink.Match newMutableMatch(final CubeSat3U pSat) {
- return new Mutable(pSat);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
- return new Immutable(pSat);
- }
-
- private static final class Mutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
- Mutable(final CubeSat3U pSat) {
- super(pSat);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
- Immutable(final CubeSat3U pSat) {
- super(pSat);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
- }
-
- /**
- * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink pattern,
- * providing pattern-specific query methods.
- *
- *
Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
- *
- *
Matches of the pattern will be represented as {@link Match}.
- *
- *
Original source:
- *
- * // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter,
- * // but cross-link using UHF
- *
- * {@literal @}Constraint(severity = "error", key = {Sat},
- * message = "3U CubeSats can only cross-link using UHF.")
- * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
- * CommunicatingElement.commSubsystem(Sat, SourceComm);
- * neg find commSubsystemBandUhf(SourceComm);
- * CommSubsystem.target(SourceComm, TargetComm);
- * CommunicatingElement.commSubsystem(Target, TargetComm);
- * neg find groundStationNetwork(Target);
- * }
- *
- *
- * @see Match
- * @see ThreeUCubeSatWithNonUhfCrossLink
- *
- */
- public static class Matcher extends BaseMatcher {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink.Matcher on(final ViatraQueryEngine engine) {
- // check if matcher already exists
- Matcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (Matcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- * @return an initialized matcher
- * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink.Matcher create() {
- return new Matcher();
- }
-
- private static final int POSITION_SAT = 0;
-
- private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ThreeUCubeSatWithNonUhfCrossLink.Matcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- *
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
- *
- */
- private Matcher() {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return matches represented as a Match object.
- *
- */
- public Collection getAllMatches(final CubeSat3U pSat) {
- return rawStreamAllMatches(new Object[]{pSat}).collect(Collectors.toSet());
- }
-
- /**
- * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
- *
- * NOTE: It is important not to modify the source model while the stream is being processed.
- * If the match set of the pattern changes during processing, the contents of the stream is undefined.
- * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return a stream of matches represented as a Match object.
- *
- */
- public Stream streamAllMatches(final CubeSat3U pSat) {
- return rawStreamAllMatches(new Object[]{pSat});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return a match represented as a Match object, or null if no match is found.
- *
- */
- public Optional getOneArbitraryMatch(final CubeSat3U pSat) {
- return rawGetOneArbitraryMatch(new Object[]{pSat});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final CubeSat3U pSat) {
- return rawHasMatch(new Object[]{pSat});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final CubeSat3U pSat) {
- return rawCountMatches(new Object[]{pSat});
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final CubeSat3U pSat, final Consumer super ThreeUCubeSatWithNonUhfCrossLink.Match> processor) {
- return rawForOneArbitraryMatch(new Object[]{pSat}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pSat the fixed value of pattern parameter Sat, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch(pSat);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- protected Stream rawStreamAllValuesOfSat(final Object[] parameters) {
- return rawStreamAllValues(POSITION_SAT, parameters).map(CubeSat3U.class::cast);
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Set getAllValuesOfSat() {
- return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Sat.
- * @return the Set of all values or empty set if there are no matches
- *
- */
- public Stream streamAllValuesOfSat() {
- return rawStreamAllValuesOfSat(emptyArray());
- }
-
- @Override
- protected ThreeUCubeSatWithNonUhfCrossLink.Match tupleToMatch(final Tuple t) {
- try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) t.get(POSITION_SAT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatch(final Object[] match) {
- try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) match[POSITION_SAT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatchMutable(final Object[] match) {
- try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMutableMatch((CubeSat3U) match[POSITION_SAT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification querySpecification() {
- return ThreeUCubeSatWithNonUhfCrossLink.instance();
- }
- }
-
- private ThreeUCubeSatWithNonUhfCrossLink() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static ThreeUCubeSatWithNonUhfCrossLink instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate(final ViatraQueryEngine engine) {
- return ThreeUCubeSatWithNonUhfCrossLink.Matcher.on(engine);
- }
-
- @Override
- public ThreeUCubeSatWithNonUhfCrossLink.Matcher instantiate() {
- return ThreeUCubeSatWithNonUhfCrossLink.Matcher.create();
- }
-
- @Override
- public ThreeUCubeSatWithNonUhfCrossLink.Match newEmptyMatch() {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newEmptyMatch();
- }
-
- @Override
- public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Object... parameters) {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((satellite.CubeSat3U) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink (visibility: PUBLIC, simpleName: ThreeUCubeSatWithNonUhfCrossLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final ThreeUCubeSatWithNonUhfCrossLink INSTANCE = new ThreeUCubeSatWithNonUhfCrossLink();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final ThreeUCubeSatWithNonUhfCrossLink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Sat);
-
- private GeneratedPQuery() {
- super(PVisibility.PUBLIC);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Sat");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Sat = body.getOrCreateVariableByName("Sat");
- PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm");
- PVariable var_TargetComm = body.getOrCreateVariableByName("TargetComm");
- PVariable var_Target = body.getOrCreateVariableByName("Target");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Sat, parameter_Sat)
- ));
- // CommunicatingElement.commSubsystem(Sat, SourceComm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_0_, var_SourceComm);
- // neg find commSubsystemBandUhf(SourceComm)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation());
- // CommSubsystem.target(SourceComm, TargetComm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceComm, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_1_, var_TargetComm);
- // CommunicatingElement.commSubsystem(Target, TargetComm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_2_, var_TargetComm);
- // neg find groundStationNetwork(Target)
- new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- {
- PAnnotation annotation = new PAnnotation("Constraint");
- annotation.addAttribute("severity", "error");
- annotation.addAttribute("key", Arrays.asList(new Object[] {
- new ParameterReference("Sat")
- }));
- annotation.addAttribute("message", "3U CubeSats can only cross-link using UHF.");
- addAnnotation(annotation);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace
deleted file mode 100644
index 09c00a25..00000000
Binary files a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.CubeSat6U.java._trace and /dev/null differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace
deleted file mode 100644
index 8b57b000..00000000
Binary files a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.MatchingCommSubsystem.java._trace and /dev/null differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore
deleted file mode 100644
index 2f9ae41d..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore
+++ /dev/null
@@ -1,70 +0,0 @@
-/.CommunicationLink.java._trace
-/.SatelliteQueriesAll.java._trace
-/.IndirectCommunicationLink.java._trace
-/.DirectCommunicationLink.java._trace
-/.SpacecraftWithInterferometryPayload.java._trace
-/.SingleInterferometryPayload.java._trace
-/.AtLeastTwoInterferometryPayloads.java._trace
-/.DirectCommunicationLink2.java._trace
-/.CommSubsystemBand.java._trace
-/.CommSubsystemGain.java._trace
-/.GroundStationNetwork.java._trace
-/.SmallSat.java._trace
-/.CommSubsystemGainLow.java._trace
-/.CommSubsystemGainMedium.java._trace
-/.CommSubsystemBandUhf.java._trace
-/.MissionCoverage.java._trace
-/.SatelliteMetricsAll.java._trace
-/.MissionTime.java._trace
-/.TimeMetric.java._trace
-/.TransmitTime.java._trace
-/.TransmitRate.java._trace
-/.SpacecraftUplink.java._trace
-/.MissionScienceData.java._trace
-/.IndirectScienceData.java._trace
-/.ScienceData.java._trace
-/.IncomingData.java._trace
-/.MissionCost.java._trace
-/.BasePrice.java._trace
-/.SpacecraftOfKind.java._trace
-/.InterferometryPayloadCost.java._trace
-/.AdditionalCommSubsystemCost.java._trace
-/.SpacecraftWithTwoCommSubsystems.java._trace
-/.SpacecraftCost.java._trace
-/.CrossLinkAllowed.java._trace
-/.MatchingAntenna.java._trace
-/.CubeSat3U.java._trace
-/.LinkAllowed.java._trace
-/.IndirectLinkAllowed.java._trace
-/AdditionalCommSubsystemCost.java
-/AtLeastTwoInterferometryPayloads.java
-/BasePrice.java
-/CommSubsystemBand.java
-/CommSubsystemBandUhf.java
-/CommSubsystemGain.java
-/CommSubsystemGainLow.java
-/CommSubsystemGainMedium.java
-/CubeSat3U.java
-/DirectCommunicationLink.java
-/GroundStationNetwork.java
-/IncomingData.java
-/IndirectCommunicationLink.java
-/IndirectLinkAllowed.java
-/InterferometryPayloadCost.java
-/LinkAllowed.java
-/MatchingAntenna.java
-/MissionCost.java
-/MissionCoverage.java
-/MissionTime.java
-/SatelliteQueriesAll.java
-/ScienceData.java
-/SpacecraftCost.java
-/SpacecraftUplink.java
-/SpacecraftWithInterferometryPayload.java
-/SpacecraftWithTwoCommSubsystems.java
-/TransmitRate.java
-/TransmitTime.java
-/.CubeSat6U.java._trace
-/.MatchingCommSubsystem.java._trace
-/.TransmittingCommSubsystem.java._trace
-/.SpacecraftOfKindCount.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java
deleted file mode 100644
index 58e7e183..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload;
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern atLeastTwoInterferometryPayloads(Mission : InterferometryMission) {
- * find spacecraftWithInterferometryPayload(Mission, Spacecraft1);
- * find spacecraftWithInterferometryPayload(Mission, Spacecraft2);
- * Spacecraft1 != Spacecraft2;
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class AtLeastTwoInterferometryPayloads extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private AtLeastTwoInterferometryPayloads() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static AtLeastTwoInterferometryPayloads instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads (visibility: PUBLIC, simpleName: AtLeastTwoInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads (visibility: PUBLIC, simpleName: AtLeastTwoInterferometryPayloads, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final AtLeastTwoInterferometryPayloads INSTANCE = new AtLeastTwoInterferometryPayloads();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final AtLeastTwoInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Mission);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.atLeastTwoInterferometryPayloads";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Mission");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Mission = body.getOrCreateVariableByName("Mission");
- PVariable var_Spacecraft1 = body.getOrCreateVariableByName("Spacecraft1");
- PVariable var_Spacecraft2 = body.getOrCreateVariableByName("Spacecraft2");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Mission, parameter_Mission)
- ));
- // find spacecraftWithInterferometryPayload(Mission, Spacecraft1)
- new PositivePatternCall(body, Tuples.flatTupleOf(var_Mission, var_Spacecraft1), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
- // find spacecraftWithInterferometryPayload(Mission, Spacecraft2)
- new PositivePatternCall(body, Tuples.flatTupleOf(var_Mission, var_Spacecraft2), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
- // Spacecraft1 != Spacecraft2
- new Inequality(body, var_Spacecraft1, var_Spacecraft2);
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java
deleted file mode 100644
index 6acd73c3..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern commSubsystemBandUhf(Comm : UHFCommSubsystem) {
- * UHFCommSubsystem(Comm);
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class CommSubsystemBandUhf extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private CommSubsystemBandUhf() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CommSubsystemBandUhf instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf (visibility: PUBLIC, simpleName: CommSubsystemBandUhf, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf (visibility: PUBLIC, simpleName: CommSubsystemBandUhf, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CommSubsystemBandUhf INSTANCE = new CommSubsystemBandUhf();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CommSubsystemBandUhf.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Comm = new PParameter("Comm", "satellite.UHFCommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "UHFCommSubsystem")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Comm);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.commSubsystemBandUhf";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Comm");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Comm = body.getOrCreateVariableByName("Comm");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Comm, parameter_Comm)
- ));
- // UHFCommSubsystem(Comm)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Comm), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "UHFCommSubsystem")));
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java
deleted file mode 100644
index acc60475..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern cubeSat3U(Sat : CubeSat3U) {
- * CubeSat3U(Sat);
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class CubeSat3U extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private CubeSat3U() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CubeSat3U instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U (visibility: PUBLIC, simpleName: CubeSat3U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U (visibility: PUBLIC, simpleName: CubeSat3U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CubeSat3U INSTANCE = new CubeSat3U();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CubeSat3U.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Sat);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSat3U";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Sat");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Sat = body.getOrCreateVariableByName("Sat");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Sat, parameter_Sat)
- ));
- // CubeSat3U(Sat)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U")));
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java
deleted file mode 100644
index e4526a02..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat6U.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern cubeSat6U(Sat : CubeSat6U) {
- * CubeSat6U(Sat);
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class CubeSat6U extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private CubeSat6U() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static CubeSat6U instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U (visibility: PUBLIC, simpleName: CubeSat6U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U (visibility: PUBLIC, simpleName: CubeSat6U, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat6U, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final CubeSat6U INSTANCE = new CubeSat6U();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final CubeSat6U.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat6U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat6U")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Sat);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSat6U";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Sat");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Sat = body.getOrCreateVariableByName("Sat");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Sat, parameter_Sat)
- ));
- // CubeSat6U(Sat)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U")));
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java
deleted file mode 100644
index ee4d8715..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) {
- * CommSubsystem.target(SourceSubsystem, TargetSubsystem);
- * CommunicatingElement.commSubsystem(Source, SourceSubsystem);
- * CommunicatingElement.commSubsystem(Target, TargetSubsystem);
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private DirectCommunicationLink() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static DirectCommunicationLink instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final DirectCommunicationLink INSTANCE = new DirectCommunicationLink();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final DirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Source = new PParameter("Source", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
-
- private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Source, parameter_Target);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.directCommunicationLink";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Source","Target");
- }
-
- @Override
- public List getParameters() {
- return parameters;
- }
-
- @Override
- public Set doGetContainedBodies() {
- setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
- Set bodies = new LinkedHashSet<>();
- {
- PBody body = new PBody(this);
- PVariable var_Source = body.getOrCreateVariableByName("Source");
- PVariable var_Target = body.getOrCreateVariableByName("Target");
- PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem");
- PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- body.setSymbolicParameters(Arrays.asList(
- new ExportedParameter(body, var_Source, parameter_Source),
- new ExportedParameter(body, var_Target, parameter_Target)
- ));
- // CommSubsystem.target(SourceSubsystem, TargetSubsystem)
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_0_, var_TargetSubsystem);
- // CommunicatingElement.commSubsystem(Source, SourceSubsystem)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Source, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_1_, var_SourceSubsystem);
- // CommunicatingElement.commSubsystem(Target, TargetSubsystem)
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
- PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_2_, var_TargetSubsystem);
- bodies.add(body);
- }
- return bodies;
- }
- }
-}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java
deleted file mode 100644
index 606cdfed..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
- */
-package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
-
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
-
-/**
- * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
- *
- * Original source:
- *
- * private pattern groundStationNetwork(Network : GroundStationNetwork) {
- * GroundStationNetwork(Network);
- * }
- *
- *
- * @see GenericPatternMatcher
- * @see GenericPatternMatch
- *
- */
-@SuppressWarnings("all")
-public final class GroundStationNetwork extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
- private GroundStationNetwork() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
- *
- */
- public static GroundStationNetwork instance() {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- /**
- * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork (visibility: PUBLIC, simpleName: GroundStationNetwork, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork, deprecated: ) (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
- * not at the class load time of the outer class,
- * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork (visibility: PUBLIC, simpleName: GroundStationNetwork, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
- *
- * This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private static final GroundStationNetwork INSTANCE = new GroundStationNetwork();
-
- /**
- * Statically initializes the query specification after the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- *
The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private static final Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternal();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private static final GroundStationNetwork.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_Network = new PParameter("Network", "satellite.GroundStationNetwork", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "GroundStationNetwork")), PParameterDirection.INOUT);
-
- private final List parameters = Arrays.asList(parameter_Network);
-
- private GeneratedPQuery() {
- super(PVisibility.PRIVATE);
- }
-
- @Override
- public String getFullyQualifiedName() {
- return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.groundStationNetwork";
- }
-
- @Override
- public List getParameterNames() {
- return Arrays.asList("Network");
- }
-
- @Override
- public List