diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
index 3f4b1691..0cdd345c 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
@@ -17,6 +17,9 @@
+
+
+
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/.gitignore
new file mode 100644
index 00000000..3e7cd5e2
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/.gitignore
@@ -0,0 +1,2 @@
+/.CoverageMetric.java._trace
+/.SatelliteMetrics.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/internal/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/internal/.gitignore
new file mode 100644
index 00000000..d3195cfc
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/internal/.gitignore
@@ -0,0 +1,2 @@
+/.MissionCoverage.java._trace
+/.SatelliteMetricsAll.java._trace
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
index 29459700..5f0d5b4b 100644
--- 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
@@ -14,3 +14,9 @@
/.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
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java
new file mode 100644
index 00000000..474719b2
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java
@@ -0,0 +1,544 @@
+/**
+ * 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.MissionCost;
+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.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.matchers.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+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.AggregatorConstraint;
+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.TypeFilterConstraint;
+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:
+ *
+ * // Cost
+ *
+ * pattern costMetric(Cost : java Double) {
+ * Cost == sum find missionCost(_, #_);
+ * }
+ *
+ *
+ * @see Matcher
+ * @see Match
+ *
+ */
+@SuppressWarnings("all")
+public final class CostMetric extends BaseGeneratedEMFQuerySpecification {
+ /**
+ * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric 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 Double fCost;
+
+ private static List parameterNames = makeImmutableList("Cost");
+
+ private Match(final Double pCost) {
+ this.fCost = pCost;
+ }
+
+ @Override
+ public Object get(final String parameterName) {
+ if ("Cost".equals(parameterName)) return this.fCost;
+ return null;
+ }
+
+ public Double getCost() {
+ return this.fCost;
+ }
+
+ @Override
+ public boolean set(final String parameterName, final Object newValue) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ if ("Cost".equals(parameterName) ) {
+ this.fCost = (Double) newValue;
+ return true;
+ }
+ return false;
+ }
+
+ public void setCost(final Double pCost) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ this.fCost = pCost;
+ }
+
+ @Override
+ public String patternName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric";
+ }
+
+ @Override
+ public List parameterNames() {
+ return CostMetric.Match.parameterNames;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[]{fCost};
+ }
+
+ @Override
+ public CostMetric.Match toImmutable() {
+ return isMutable() ? newMatch(fCost) : this;
+ }
+
+ @Override
+ public String prettyPrint() {
+ StringBuilder result = new StringBuilder();
+ result.append("\"Cost\"=" + prettyPrintValue(fCost));
+ return result.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fCost);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null) {
+ return false;
+ }
+ if ((obj instanceof CostMetric.Match)) {
+ CostMetric.Match other = (CostMetric.Match) obj;
+ return Objects.equals(fCost, other.fCost);
+ } 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 CostMetric specification() {
+ return CostMetric.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 CostMetric.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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return the new, mutable (partial) match object.
+ *
+ */
+ public static CostMetric.Match newMutableMatch(final Double pCost) {
+ return new Mutable(pCost);
+ }
+
+ /**
+ * 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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public static CostMetric.Match newMatch(final Double pCost) {
+ return new Immutable(pCost);
+ }
+
+ private static final class Mutable extends CostMetric.Match {
+ Mutable(final Double pCost) {
+ super(pCost);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return true;
+ }
+ }
+
+ private static final class Immutable extends CostMetric.Match {
+ Immutable(final Double pCost) {
+ super(pCost);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric 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:
+ *
+ * // Cost
+ *
+ * pattern costMetric(Cost : java Double) {
+ * Cost == sum find missionCost(_, #_);
+ * }
+ *
+ *
+ * @see Match
+ * @see CostMetric
+ *
+ */
+ 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 CostMetric.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 CostMetric.Matcher create() {
+ return new Matcher();
+ }
+
+ private static final int POSITION_COST = 0;
+
+ private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CostMetric.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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return matches represented as a Match object.
+ *
+ */
+ public Collection getAllMatches(final Double pCost) {
+ return rawStreamAllMatches(new Object[]{pCost}).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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return a stream of matches represented as a Match object.
+ *
+ */
+ public Stream streamAllMatches(final Double pCost) {
+ return rawStreamAllMatches(new Object[]{pCost});
+ }
+
+ /**
+ * 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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return a match represented as a Match object, or null if no match is found.
+ *
+ */
+ public Optional getOneArbitraryMatch(final Double pCost) {
+ return rawGetOneArbitraryMatch(new Object[]{pCost});
+ }
+
+ /**
+ * 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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return true if the input is a valid (partial) match of the pattern.
+ *
+ */
+ public boolean hasMatch(final Double pCost) {
+ return rawHasMatch(new Object[]{pCost});
+ }
+
+ /**
+ * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
+ * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return the number of pattern matches found.
+ *
+ */
+ public int countMatches(final Double pCost) {
+ return rawCountMatches(new Object[]{pCost});
+ }
+
+ /**
+ * 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 pCost the fixed value of pattern parameter Cost, 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 Double pCost, final Consumer super CostMetric.Match> processor) {
+ return rawForOneArbitraryMatch(new Object[]{pCost}, 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 pCost the fixed value of pattern parameter Cost, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public CostMetric.Match newMatch(final Double pCost) {
+ return CostMetric.Match.newMatch(pCost);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Cost.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ protected Stream rawStreamAllValuesOfCost(final Object[] parameters) {
+ return rawStreamAllValues(POSITION_COST, parameters).map(Double.class::cast);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Cost.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Set getAllValuesOfCost() {
+ return rawStreamAllValuesOfCost(emptyArray()).collect(Collectors.toSet());
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Cost.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Stream streamAllValuesOfCost() {
+ return rawStreamAllValuesOfCost(emptyArray());
+ }
+
+ @Override
+ protected CostMetric.Match tupleToMatch(final Tuple t) {
+ try {
+ return CostMetric.Match.newMatch((Double) t.get(POSITION_COST));
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in tuple not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected CostMetric.Match arrayToMatch(final Object[] match) {
+ try {
+ return CostMetric.Match.newMatch((Double) match[POSITION_COST]);
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in array not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected CostMetric.Match arrayToMatchMutable(final Object[] match) {
+ try {
+ return CostMetric.Match.newMutableMatch((Double) match[POSITION_COST]);
+ } 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 CostMetric.instance();
+ }
+ }
+
+ private CostMetric() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static CostMetric instance() {
+ try{
+ return LazyHolder.INSTANCE;
+ } catch (ExceptionInInitializerError err) {
+ throw processInitializerError(err);
+ }
+ }
+
+ @Override
+ protected CostMetric.Matcher instantiate(final ViatraQueryEngine engine) {
+ return CostMetric.Matcher.on(engine);
+ }
+
+ @Override
+ public CostMetric.Matcher instantiate() {
+ return CostMetric.Matcher.create();
+ }
+
+ @Override
+ public CostMetric.Match newEmptyMatch() {
+ return CostMetric.Match.newEmptyMatch();
+ }
+
+ @Override
+ public CostMetric.Match newMatch(final Object... parameters) {
+ return CostMetric.Match.newMatch((java.lang.Double) parameters[0]);
+ }
+
+ /**
+ * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric, 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.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric, 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 CostMetric INSTANCE = new CostMetric();
+
+ /**
+ * 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 CostMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Cost);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PUBLIC);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Cost");
+ }
+
+ @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_Cost = body.getOrCreateVariableByName("Cost");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // Cost == sum find missionCost(_, #_)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionCost.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
+ new Equality(body, var_Cost, var__virtual_0_);
+ 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/CoverageMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java
new file mode 100644
index 00000000..23b02ce4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java
@@ -0,0 +1,552 @@
+/**
+ * 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.MissionCoverage;
+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.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.matchers.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+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.AggregatorConstraint;
+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.TypeFilterConstraint;
+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:
+ *
+ * //
+ * // Metrics
+ * //
+ *
+ * // Coverage
+ *
+ * pattern coverageMetric(Coverage : java Double) {
+ * Coverage == sum find missionCoverage(_, #_);
+ * }
+ *
+ *
+ * @see Matcher
+ * @see Match
+ *
+ */
+@SuppressWarnings("all")
+public final class CoverageMetric extends BaseGeneratedEMFQuerySpecification {
+ /**
+ * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric 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 Double fCoverage;
+
+ private static List parameterNames = makeImmutableList("Coverage");
+
+ private Match(final Double pCoverage) {
+ this.fCoverage = pCoverage;
+ }
+
+ @Override
+ public Object get(final String parameterName) {
+ if ("Coverage".equals(parameterName)) return this.fCoverage;
+ return null;
+ }
+
+ public Double getCoverage() {
+ return this.fCoverage;
+ }
+
+ @Override
+ public boolean set(final String parameterName, final Object newValue) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ if ("Coverage".equals(parameterName) ) {
+ this.fCoverage = (Double) newValue;
+ return true;
+ }
+ return false;
+ }
+
+ public void setCoverage(final Double pCoverage) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ this.fCoverage = pCoverage;
+ }
+
+ @Override
+ public String patternName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric";
+ }
+
+ @Override
+ public List parameterNames() {
+ return CoverageMetric.Match.parameterNames;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[]{fCoverage};
+ }
+
+ @Override
+ public CoverageMetric.Match toImmutable() {
+ return isMutable() ? newMatch(fCoverage) : this;
+ }
+
+ @Override
+ public String prettyPrint() {
+ StringBuilder result = new StringBuilder();
+ result.append("\"Coverage\"=" + prettyPrintValue(fCoverage));
+ return result.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fCoverage);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null) {
+ return false;
+ }
+ if ((obj instanceof CoverageMetric.Match)) {
+ CoverageMetric.Match other = (CoverageMetric.Match) obj;
+ return Objects.equals(fCoverage, other.fCoverage);
+ } 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 CoverageMetric specification() {
+ return CoverageMetric.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 CoverageMetric.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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return the new, mutable (partial) match object.
+ *
+ */
+ public static CoverageMetric.Match newMutableMatch(final Double pCoverage) {
+ return new Mutable(pCoverage);
+ }
+
+ /**
+ * 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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public static CoverageMetric.Match newMatch(final Double pCoverage) {
+ return new Immutable(pCoverage);
+ }
+
+ private static final class Mutable extends CoverageMetric.Match {
+ Mutable(final Double pCoverage) {
+ super(pCoverage);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return true;
+ }
+ }
+
+ private static final class Immutable extends CoverageMetric.Match {
+ Immutable(final Double pCoverage) {
+ super(pCoverage);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric 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:
+ *
+ * //
+ * // Metrics
+ * //
+ *
+ * // Coverage
+ *
+ * pattern coverageMetric(Coverage : java Double) {
+ * Coverage == sum find missionCoverage(_, #_);
+ * }
+ *
+ *
+ * @see Match
+ * @see CoverageMetric
+ *
+ */
+ 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 CoverageMetric.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 CoverageMetric.Matcher create() {
+ return new Matcher();
+ }
+
+ private static final int POSITION_COVERAGE = 0;
+
+ private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CoverageMetric.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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return matches represented as a Match object.
+ *
+ */
+ public Collection getAllMatches(final Double pCoverage) {
+ return rawStreamAllMatches(new Object[]{pCoverage}).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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return a stream of matches represented as a Match object.
+ *
+ */
+ public Stream streamAllMatches(final Double pCoverage) {
+ return rawStreamAllMatches(new Object[]{pCoverage});
+ }
+
+ /**
+ * 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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return a match represented as a Match object, or null if no match is found.
+ *
+ */
+ public Optional getOneArbitraryMatch(final Double pCoverage) {
+ return rawGetOneArbitraryMatch(new Object[]{pCoverage});
+ }
+
+ /**
+ * 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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return true if the input is a valid (partial) match of the pattern.
+ *
+ */
+ public boolean hasMatch(final Double pCoverage) {
+ return rawHasMatch(new Object[]{pCoverage});
+ }
+
+ /**
+ * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
+ * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return the number of pattern matches found.
+ *
+ */
+ public int countMatches(final Double pCoverage) {
+ return rawCountMatches(new Object[]{pCoverage});
+ }
+
+ /**
+ * 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 pCoverage the fixed value of pattern parameter Coverage, 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 Double pCoverage, final Consumer super CoverageMetric.Match> processor) {
+ return rawForOneArbitraryMatch(new Object[]{pCoverage}, 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 pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public CoverageMetric.Match newMatch(final Double pCoverage) {
+ return CoverageMetric.Match.newMatch(pCoverage);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Coverage.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ protected Stream rawStreamAllValuesOfCoverage(final Object[] parameters) {
+ return rawStreamAllValues(POSITION_COVERAGE, parameters).map(Double.class::cast);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Coverage.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Set getAllValuesOfCoverage() {
+ return rawStreamAllValuesOfCoverage(emptyArray()).collect(Collectors.toSet());
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Coverage.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Stream streamAllValuesOfCoverage() {
+ return rawStreamAllValuesOfCoverage(emptyArray());
+ }
+
+ @Override
+ protected CoverageMetric.Match tupleToMatch(final Tuple t) {
+ try {
+ return CoverageMetric.Match.newMatch((Double) t.get(POSITION_COVERAGE));
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in tuple not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected CoverageMetric.Match arrayToMatch(final Object[] match) {
+ try {
+ return CoverageMetric.Match.newMatch((Double) match[POSITION_COVERAGE]);
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in array not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected CoverageMetric.Match arrayToMatchMutable(final Object[] match) {
+ try {
+ return CoverageMetric.Match.newMutableMatch((Double) match[POSITION_COVERAGE]);
+ } 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 CoverageMetric.instance();
+ }
+ }
+
+ private CoverageMetric() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static CoverageMetric instance() {
+ try{
+ return LazyHolder.INSTANCE;
+ } catch (ExceptionInInitializerError err) {
+ throw processInitializerError(err);
+ }
+ }
+
+ @Override
+ protected CoverageMetric.Matcher instantiate(final ViatraQueryEngine engine) {
+ return CoverageMetric.Matcher.on(engine);
+ }
+
+ @Override
+ public CoverageMetric.Matcher instantiate() {
+ return CoverageMetric.Matcher.create();
+ }
+
+ @Override
+ public CoverageMetric.Match newEmptyMatch() {
+ return CoverageMetric.Match.newEmptyMatch();
+ }
+
+ @Override
+ public CoverageMetric.Match newMatch(final Object... parameters) {
+ return CoverageMetric.Match.newMatch((java.lang.Double) parameters[0]);
+ }
+
+ /**
+ * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric (visibility: PUBLIC, simpleName: CoverageMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric, 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.CoverageMetric (visibility: PUBLIC, simpleName: CoverageMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric, 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 CoverageMetric INSTANCE = new CoverageMetric();
+
+ /**
+ * 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 CoverageMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Coverage = new PParameter("Coverage", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Coverage);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PUBLIC);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Coverage");
+ }
+
+ @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_Coverage = body.getOrCreateVariableByName("Coverage");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Coverage), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Coverage, parameter_Coverage)
+ ));
+ // Coverage == sum find missionCoverage(_, #_)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionCoverage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
+ new Equality(body, var_Coverage, var__virtual_0_);
+ 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/SatelliteQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
index d4d72391..b6601c28 100644
--- 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
@@ -5,6 +5,8 @@ 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.CostMetric;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric;
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.IncompatibleSourceAndTargetGain;
@@ -12,6 +14,7 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.KaAntennaGainLow;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium;
import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
@@ -36,6 +39,9 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
* kaAntennaGainLow
* threeUCubeSatWithNonUhfCrossLink
* cubeSatWithKaAntenna
+ * coverageMetric
+ * timeMetric
+ * costMetric
*
*
* @see IQueryGroup
@@ -71,6 +77,9 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup {
querySpecifications.add(KaAntennaGainLow.instance());
querySpecifications.add(ThreeUCubeSatWithNonUhfCrossLink.instance());
querySpecifications.add(CubeSatWithKaAntenna.instance());
+ querySpecifications.add(CoverageMetric.instance());
+ querySpecifications.add(TimeMetric.instance());
+ querySpecifications.add(CostMetric.instance());
}
public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() {
@@ -160,4 +169,28 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup {
public CubeSatWithKaAntenna.Matcher getCubeSatWithKaAntenna(final ViatraQueryEngine engine) {
return CubeSatWithKaAntenna.Matcher.on(engine);
}
+
+ public CoverageMetric getCoverageMetric() {
+ return CoverageMetric.instance();
+ }
+
+ public CoverageMetric.Matcher getCoverageMetric(final ViatraQueryEngine engine) {
+ return CoverageMetric.Matcher.on(engine);
+ }
+
+ public TimeMetric getTimeMetric() {
+ return TimeMetric.instance();
+ }
+
+ public TimeMetric.Matcher getTimeMetric(final ViatraQueryEngine engine) {
+ return TimeMetric.Matcher.on(engine);
+ }
+
+ public CostMetric getCostMetric() {
+ return CostMetric.instance();
+ }
+
+ public CostMetric.Matcher getCostMetric(final ViatraQueryEngine engine) {
+ return CostMetric.Matcher.on(engine);
+ }
}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
index 6408033b..6500c9d3 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java
@@ -3,7 +3,7 @@
*/
package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
-import hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft;
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;
@@ -18,6 +18,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.log4j.Logger;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
import org.eclipse.viatra.query.runtime.api.IPatternMatch;
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
@@ -26,6 +27,7 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificat
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.EDataTypeInSlotsKey;
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;
@@ -35,6 +37,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterRe
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.ConstantValue;
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;
@@ -53,7 +56,8 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
*
* {@literal @}Constraint(severity = "error", key = {Sat},
* message = "3U CubeSats can only cross-link using UHF.")
- * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
+ * pattern threeUCubeSatWithNonUhfCrossLink(Sat : Spacecraft) {
+ * Spacecraft.kind(Sat, SpacecraftKind::CubeSat3U);
* CommunicatingElement.commSubsystem(Sat, SourceComm);
* neg find commSubsystemBandUhf(SourceComm);
* DirectedCommunicationLink.source(Link, SourceComm);
@@ -82,11 +86,11 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
*
*/
public static abstract class Match extends BasePatternMatch {
- private CubeSat3U fSat;
+ private Spacecraft fSat;
private static List parameterNames = makeImmutableList("Sat");
- private Match(final CubeSat3U pSat) {
+ private Match(final Spacecraft pSat) {
this.fSat = pSat;
}
@@ -96,7 +100,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
return null;
}
- public CubeSat3U getSat() {
+ public Spacecraft getSat() {
return this.fSat;
}
@@ -104,13 +108,13 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
public boolean set(final String parameterName, final Object newValue) {
if (!isMutable()) throw new java.lang.UnsupportedOperationException();
if ("Sat".equals(parameterName) ) {
- this.fSat = (CubeSat3U) newValue;
+ this.fSat = (Spacecraft) newValue;
return true;
}
return false;
}
- public void setSat(final CubeSat3U pSat) {
+ public void setSat(final Spacecraft pSat) {
if (!isMutable()) throw new java.lang.UnsupportedOperationException();
this.fSat = pSat;
}
@@ -191,7 +195,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the new, mutable (partial) match object.
*
*/
- public static ThreeUCubeSatWithNonUhfCrossLink.Match newMutableMatch(final CubeSat3U pSat) {
+ public static ThreeUCubeSatWithNonUhfCrossLink.Match newMutableMatch(final Spacecraft pSat) {
return new Mutable(pSat);
}
@@ -203,12 +207,12 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the (partial) match object.
*
*/
- public static ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
+ public static ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Spacecraft pSat) {
return new Immutable(pSat);
}
private static final class Mutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
- Mutable(final CubeSat3U pSat) {
+ Mutable(final Spacecraft pSat) {
super(pSat);
}
@@ -219,7 +223,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
}
private static final class Immutable extends ThreeUCubeSatWithNonUhfCrossLink.Match {
- Immutable(final CubeSat3U pSat) {
+ Immutable(final Spacecraft pSat) {
super(pSat);
}
@@ -246,7 +250,8 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
*
* {@literal @}Constraint(severity = "error", key = {Sat},
* message = "3U CubeSats can only cross-link using UHF.")
- * pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
+ * pattern threeUCubeSatWithNonUhfCrossLink(Sat : Spacecraft) {
+ * Spacecraft.kind(Sat, SpacecraftKind::CubeSat3U);
* CommunicatingElement.commSubsystem(Sat, SourceComm);
* neg find commSubsystemBandUhf(SourceComm);
* DirectedCommunicationLink.source(Link, SourceComm);
@@ -310,7 +315,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return matches represented as a Match object.
*
*/
- public Collection getAllMatches(final CubeSat3U pSat) {
+ public Collection getAllMatches(final Spacecraft pSat) {
return rawStreamAllMatches(new Object[]{pSat}).collect(Collectors.toSet());
}
@@ -324,7 +329,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return a stream of matches represented as a Match object.
*
*/
- public Stream streamAllMatches(final CubeSat3U pSat) {
+ public Stream streamAllMatches(final Spacecraft pSat) {
return rawStreamAllMatches(new Object[]{pSat});
}
@@ -335,7 +340,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return a match represented as a Match object, or null if no match is found.
*
*/
- public Optional getOneArbitraryMatch(final CubeSat3U pSat) {
+ public Optional getOneArbitraryMatch(final Spacecraft pSat) {
return rawGetOneArbitraryMatch(new Object[]{pSat});
}
@@ -346,7 +351,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return true if the input is a valid (partial) match of the pattern.
*
*/
- public boolean hasMatch(final CubeSat3U pSat) {
+ public boolean hasMatch(final Spacecraft pSat) {
return rawHasMatch(new Object[]{pSat});
}
@@ -356,7 +361,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the number of pattern matches found.
*
*/
- public int countMatches(final CubeSat3U pSat) {
+ public int countMatches(final Spacecraft pSat) {
return rawCountMatches(new Object[]{pSat});
}
@@ -368,7 +373,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @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) {
+ public boolean forOneArbitraryMatch(final Spacecraft pSat, final Consumer super ThreeUCubeSatWithNonUhfCrossLink.Match> processor) {
return rawForOneArbitraryMatch(new Object[]{pSat}, processor);
}
@@ -380,7 +385,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the (partial) match object.
*
*/
- public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final CubeSat3U pSat) {
+ public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Spacecraft pSat) {
return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch(pSat);
}
@@ -389,8 +394,8 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @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);
+ protected Stream rawStreamAllValuesOfSat(final Object[] parameters) {
+ return rawStreamAllValues(POSITION_SAT, parameters).map(Spacecraft.class::cast);
}
/**
@@ -398,7 +403,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the Set of all values or empty set if there are no matches
*
*/
- public Set getAllValuesOfSat() {
+ public Set getAllValuesOfSat() {
return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet());
}
@@ -407,14 +412,14 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
* @return the Set of all values or empty set if there are no matches
*
*/
- public Stream streamAllValuesOfSat() {
+ public Stream streamAllValuesOfSat() {
return rawStreamAllValuesOfSat(emptyArray());
}
@Override
protected ThreeUCubeSatWithNonUhfCrossLink.Match tupleToMatch(final Tuple t) {
try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) t.get(POSITION_SAT));
+ return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((Spacecraft) t.get(POSITION_SAT));
} catch(ClassCastException e) {
LOGGER.error("Element(s) in tuple not properly typed!",e);
return null;
@@ -424,7 +429,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
@Override
protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatch(final Object[] match) {
try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((CubeSat3U) match[POSITION_SAT]);
+ return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((Spacecraft) match[POSITION_SAT]);
} catch(ClassCastException e) {
LOGGER.error("Element(s) in array not properly typed!",e);
return null;
@@ -434,7 +439,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
@Override
protected ThreeUCubeSatWithNonUhfCrossLink.Match arrayToMatchMutable(final Object[] match) {
try {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMutableMatch((CubeSat3U) match[POSITION_SAT]);
+ return ThreeUCubeSatWithNonUhfCrossLink.Match.newMutableMatch((Spacecraft) match[POSITION_SAT]);
} catch(ClassCastException e) {
LOGGER.error("Element(s) in array not properly typed!",e);
return null;
@@ -485,7 +490,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
@Override
public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Object... parameters) {
- return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U) parameters[0]);
+ return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft) parameters[0]);
}
/**
@@ -517,7 +522,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
private static final ThreeUCubeSatWithNonUhfCrossLink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
- private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT);
+ private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
private final List parameters = Arrays.asList(parameter_Sat);
@@ -551,36 +556,44 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer
PVariable var_Link = body.getOrCreateVariableByName("Link");
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")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
body.setSymbolicParameters(Arrays.asList(
new ExportedParameter(body, var_Sat, parameter_Sat)
));
+ // Spacecraft.kind(Sat, SpacecraftKind::CubeSat3U)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "CubeSat3U").getInstance());
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var__virtual_0_);
// 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);
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, 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_SourceComm);
// neg find commSubsystemBandUhf(SourceComm)
new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceComm), CommSubsystemBandUhf.instance().getInternalQueryRepresentation());
// DirectedCommunicationLink.source(Link, SourceComm)
new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source")));
- 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_SourceComm);
+ PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ new Equality(body, var__virtual_3_, var_SourceComm);
// DirectedCommunicationLink.target(Link, TargetComm)
new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
- PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target")));
- 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);
+ PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ new Equality(body, var__virtual_4_, 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_3_ = body.getOrCreateVariableByName(".virtual{3}");
- new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
- new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
- new Equality(body, var__virtual_3_, var_TargetComm);
+ PVariable var__virtual_5_ = body.getOrCreateVariableByName(".virtual{5}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_5_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_5_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ new Equality(body, var__virtual_5_, var_TargetComm);
// neg find groundStationNetwork(Target)
new NegativePatternCall(body, Tuples.flatTupleOf(var_Target), GroundStationNetwork.instance().getInternalQueryRepresentation());
bodies.add(body);
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java
new file mode 100644
index 00000000..45d4cc35
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java
@@ -0,0 +1,544 @@
+/**
+ * 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.MissionTime;
+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.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.matchers.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+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.AggregatorConstraint;
+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.TypeFilterConstraint;
+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:
+ *
+ * // Time
+ *
+ * pattern timeMetric(Time : java Double) {
+ * Time == sum find missionTime(_, #_);
+ * }
+ *
+ *
+ * @see Matcher
+ * @see Match
+ *
+ */
+@SuppressWarnings("all")
+public final class TimeMetric extends BaseGeneratedEMFQuerySpecification {
+ /**
+ * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric 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 Double fTime;
+
+ private static List parameterNames = makeImmutableList("Time");
+
+ private Match(final Double pTime) {
+ this.fTime = pTime;
+ }
+
+ @Override
+ public Object get(final String parameterName) {
+ if ("Time".equals(parameterName)) return this.fTime;
+ return null;
+ }
+
+ public Double getTime() {
+ return this.fTime;
+ }
+
+ @Override
+ public boolean set(final String parameterName, final Object newValue) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ if ("Time".equals(parameterName) ) {
+ this.fTime = (Double) newValue;
+ return true;
+ }
+ return false;
+ }
+
+ public void setTime(final Double pTime) {
+ if (!isMutable()) throw new java.lang.UnsupportedOperationException();
+ this.fTime = pTime;
+ }
+
+ @Override
+ public String patternName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric";
+ }
+
+ @Override
+ public List parameterNames() {
+ return TimeMetric.Match.parameterNames;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[]{fTime};
+ }
+
+ @Override
+ public TimeMetric.Match toImmutable() {
+ return isMutable() ? newMatch(fTime) : this;
+ }
+
+ @Override
+ public String prettyPrint() {
+ StringBuilder result = new StringBuilder();
+ result.append("\"Time\"=" + prettyPrintValue(fTime));
+ return result.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(fTime);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null) {
+ return false;
+ }
+ if ((obj instanceof TimeMetric.Match)) {
+ TimeMetric.Match other = (TimeMetric.Match) obj;
+ return Objects.equals(fTime, other.fTime);
+ } 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 TimeMetric specification() {
+ return TimeMetric.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 TimeMetric.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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return the new, mutable (partial) match object.
+ *
+ */
+ public static TimeMetric.Match newMutableMatch(final Double pTime) {
+ return new Mutable(pTime);
+ }
+
+ /**
+ * 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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public static TimeMetric.Match newMatch(final Double pTime) {
+ return new Immutable(pTime);
+ }
+
+ private static final class Mutable extends TimeMetric.Match {
+ Mutable(final Double pTime) {
+ super(pTime);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return true;
+ }
+ }
+
+ private static final class Immutable extends TimeMetric.Match {
+ Immutable(final Double pTime) {
+ super(pTime);
+ }
+
+ @Override
+ public boolean isMutable() {
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric 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:
+ *
+ * // Time
+ *
+ * pattern timeMetric(Time : java Double) {
+ * Time == sum find missionTime(_, #_);
+ * }
+ *
+ *
+ * @see Match
+ * @see TimeMetric
+ *
+ */
+ 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 TimeMetric.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 TimeMetric.Matcher create() {
+ return new Matcher();
+ }
+
+ private static final int POSITION_TIME = 0;
+
+ private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TimeMetric.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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return matches represented as a Match object.
+ *
+ */
+ public Collection getAllMatches(final Double pTime) {
+ return rawStreamAllMatches(new Object[]{pTime}).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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return a stream of matches represented as a Match object.
+ *
+ */
+ public Stream streamAllMatches(final Double pTime) {
+ return rawStreamAllMatches(new Object[]{pTime});
+ }
+
+ /**
+ * 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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return a match represented as a Match object, or null if no match is found.
+ *
+ */
+ public Optional getOneArbitraryMatch(final Double pTime) {
+ return rawGetOneArbitraryMatch(new Object[]{pTime});
+ }
+
+ /**
+ * 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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return true if the input is a valid (partial) match of the pattern.
+ *
+ */
+ public boolean hasMatch(final Double pTime) {
+ return rawHasMatch(new Object[]{pTime});
+ }
+
+ /**
+ * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
+ * @param pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return the number of pattern matches found.
+ *
+ */
+ public int countMatches(final Double pTime) {
+ return rawCountMatches(new Object[]{pTime});
+ }
+
+ /**
+ * 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 pTime the fixed value of pattern parameter Time, 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 Double pTime, final Consumer super TimeMetric.Match> processor) {
+ return rawForOneArbitraryMatch(new Object[]{pTime}, 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 pTime the fixed value of pattern parameter Time, or null if not bound.
+ * @return the (partial) match object.
+ *
+ */
+ public TimeMetric.Match newMatch(final Double pTime) {
+ return TimeMetric.Match.newMatch(pTime);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Time.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ protected Stream rawStreamAllValuesOfTime(final Object[] parameters) {
+ return rawStreamAllValues(POSITION_TIME, parameters).map(Double.class::cast);
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Time.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Set getAllValuesOfTime() {
+ return rawStreamAllValuesOfTime(emptyArray()).collect(Collectors.toSet());
+ }
+
+ /**
+ * Retrieve the set of values that occur in matches for Time.
+ * @return the Set of all values or empty set if there are no matches
+ *
+ */
+ public Stream streamAllValuesOfTime() {
+ return rawStreamAllValuesOfTime(emptyArray());
+ }
+
+ @Override
+ protected TimeMetric.Match tupleToMatch(final Tuple t) {
+ try {
+ return TimeMetric.Match.newMatch((Double) t.get(POSITION_TIME));
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in tuple not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected TimeMetric.Match arrayToMatch(final Object[] match) {
+ try {
+ return TimeMetric.Match.newMatch((Double) match[POSITION_TIME]);
+ } catch(ClassCastException e) {
+ LOGGER.error("Element(s) in array not properly typed!",e);
+ return null;
+ }
+ }
+
+ @Override
+ protected TimeMetric.Match arrayToMatchMutable(final Object[] match) {
+ try {
+ return TimeMetric.Match.newMutableMatch((Double) match[POSITION_TIME]);
+ } 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 TimeMetric.instance();
+ }
+ }
+
+ private TimeMetric() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static TimeMetric instance() {
+ try{
+ return LazyHolder.INSTANCE;
+ } catch (ExceptionInInitializerError err) {
+ throw processInitializerError(err);
+ }
+ }
+
+ @Override
+ protected TimeMetric.Matcher instantiate(final ViatraQueryEngine engine) {
+ return TimeMetric.Matcher.on(engine);
+ }
+
+ @Override
+ public TimeMetric.Matcher instantiate() {
+ return TimeMetric.Matcher.create();
+ }
+
+ @Override
+ public TimeMetric.Match newEmptyMatch() {
+ return TimeMetric.Match.newEmptyMatch();
+ }
+
+ @Override
+ public TimeMetric.Match newMatch(final Object... parameters) {
+ return TimeMetric.Match.newMatch((java.lang.Double) parameters[0]);
+ }
+
+ /**
+ * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric (visibility: PUBLIC, simpleName: TimeMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric, 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.TimeMetric (visibility: PUBLIC, simpleName: TimeMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric, 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 TimeMetric INSTANCE = new TimeMetric();
+
+ /**
+ * 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 TimeMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Time = new PParameter("Time", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Time);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PUBLIC);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Time");
+ }
+
+ @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_Time = body.getOrCreateVariableByName("Time");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Time), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Time, parameter_Time)
+ ));
+ // Time == sum find missionTime(_, #_)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionTime.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
+ new Equality(body, var_Time, var__virtual_0_);
+ 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/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore
index b3aca298..f72ce8f1 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/.gitignore
@@ -13,3 +13,21 @@
/.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
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java
new file mode 100644
index 00000000..61b1da52
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java
@@ -0,0 +1,173 @@
+/**
+ * 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.SpacecraftWithTwoCommSubsystems;
+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.context.common.JavaTransitiveInstancesKey;
+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.basicdeferred.NegativePatternCall;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
+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 additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) {
+ * find spacecraftWithTwoCommSubsystems(Spacecraft);
+ * Cost == 100000.0;
+ * } or {
+ * neg find spacecraftWithTwoCommSubsystems(Spacecraft);
+ * Cost == 0.0;
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class AdditionalCommSubsystemCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private AdditionalCommSubsystemCost() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static AdditionalCommSubsystemCost 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.AdditionalCommSubsystemCost (visibility: PUBLIC, simpleName: AdditionalCommSubsystemCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost, 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.AdditionalCommSubsystemCost (visibility: PUBLIC, simpleName: AdditionalCommSubsystemCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost, 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 AdditionalCommSubsystemCost INSTANCE = new AdditionalCommSubsystemCost();
+
+ /**
+ * 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 AdditionalCommSubsystemCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Cost);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.additionalCommSubsystemCost";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Cost");
+ }
+
+ @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_Cost = body.getOrCreateVariableByName("Cost");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // find spacecraftWithTwoCommSubsystems(Spacecraft)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SpacecraftWithTwoCommSubsystems.instance().getInternalQueryRepresentation());
+ // Cost == 100000.0
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, 100000.0);
+ new Equality(body, var_Cost, var__virtual_0_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_Cost = body.getOrCreateVariableByName("Cost");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // neg find spacecraftWithTwoCommSubsystems(Spacecraft)
+ new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SpacecraftWithTwoCommSubsystems.instance().getInternalQueryRepresentation());
+ // Cost == 0.0
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, 0.0);
+ new Equality(body, var_Cost, var__virtual_0_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1() {
+ return 100000.0;
+ }
+
+ private static double evaluateExpression_2_1() {
+ return 0.0;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java
new file mode 100644
index 00000000..c70f4c8b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java
@@ -0,0 +1,216 @@
+/**
+ * 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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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.context.common.JavaTransitiveInstancesKey;
+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.basicdeferred.TypeFilterConstraint;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
+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 basePrice(Spacecraft : Spacecraft, BasePrice : java Double) {
+ * Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U);
+ * BasePrice == 250000.0;
+ * } or {
+ * Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat6U);
+ * BasePrice == 750000.0;
+ * } or {
+ * Spacecraft.kind(Spacecraft, SpacecraftKind::SmallSat);
+ * BasePrice == 3000000.0;
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class BasePrice extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private BasePrice() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static BasePrice 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.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, 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.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, 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 BasePrice INSTANCE = new BasePrice();
+
+ /**
+ * 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 BasePrice.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_BasePrice = new PParameter("BasePrice", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_BasePrice);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.basePrice";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","BasePrice");
+ }
+
+ @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_BasePrice = body.getOrCreateVariableByName("BasePrice");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
+ ));
+ // Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "CubeSat3U").getInstance());
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var__virtual_0_);
+ // BasePrice == 250000.0
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ConstantValue(body, var__virtual_2_, 250000.0);
+ new Equality(body, var_BasePrice, var__virtual_2_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
+ ));
+ // Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat6U)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "CubeSat6U").getInstance());
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var__virtual_0_);
+ // BasePrice == 750000.0
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ConstantValue(body, var__virtual_2_, 750000.0);
+ new Equality(body, var_BasePrice, var__virtual_2_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
+ ));
+ // Spacecraft.kind(Spacecraft, SpacecraftKind::SmallSat)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "SmallSat").getInstance());
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var__virtual_0_);
+ // BasePrice == 3000000.0
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ConstantValue(body, var__virtual_2_, 3000000.0);
+ new Equality(body, var_BasePrice, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1() {
+ return 250000.0;
+ }
+
+ private static double evaluateExpression_2_1() {
+ return 750000.0;
+ }
+
+ private static double evaluateExpression_3_1() {
+ return 3000000.0;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java
new file mode 100644
index 00000000..114bbf33
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java
@@ -0,0 +1,145 @@
+/**
+ * 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.IndirectCommunicationLink;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
+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.context.common.JavaTransitiveInstancesKey;
+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.TypeFilterConstraint;
+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 incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) {
+ * find indirectCommunicationLink(Source, Spacecraft);
+ * find scienceData(Source, Data);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class IncomingData extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private IncomingData() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static IncomingData 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.IncomingData (visibility: PUBLIC, simpleName: IncomingData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData, 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.IncomingData (visibility: PUBLIC, simpleName: IncomingData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData, 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 IncomingData INSTANCE = new IncomingData();
+
+ /**
+ * 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 IncomingData.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Source = new PParameter("Source", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Data = new PParameter("Data", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Source, parameter_Data);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incomingData";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Source","Data");
+ }
+
+ @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_Source = body.getOrCreateVariableByName("Source");
+ PVariable var_Data = body.getOrCreateVariableByName("Data");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Data), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Source, parameter_Source),
+ new ExportedParameter(body, var_Data, parameter_Data)
+ ));
+ // find indirectCommunicationLink(Source, Spacecraft)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Source, var_Spacecraft), IndirectCommunicationLink.instance().getInternalQueryRepresentation());
+ // find scienceData(Source, Data)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Source, var_Data), ScienceData.instance().getInternalQueryRepresentation());
+ 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/InterferometryPayloadCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java
new file mode 100644
index 00000000..205d896a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java
@@ -0,0 +1,175 @@
+/**
+ * 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.context.common.JavaTransitiveInstancesKey;
+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.basicdeferred.NegativePatternCall;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
+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 interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) {
+ * find spacecraftWithInterferometryPayload(_, Spacecraft);
+ * Cost == 50000.0;
+ * } or {
+ * neg find spacecraftWithInterferometryPayload(_, Spacecraft);
+ * Cost == 0.0;
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class InterferometryPayloadCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private InterferometryPayloadCost() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static InterferometryPayloadCost 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.InterferometryPayloadCost (visibility: PUBLIC, simpleName: InterferometryPayloadCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost, 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.InterferometryPayloadCost (visibility: PUBLIC, simpleName: InterferometryPayloadCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost, 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 InterferometryPayloadCost INSTANCE = new InterferometryPayloadCost();
+
+ /**
+ * 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 InterferometryPayloadCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Cost);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.interferometryPayloadCost";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Cost");
+ }
+
+ @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_Cost = body.getOrCreateVariableByName("Cost");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // find spacecraftWithInterferometryPayload(_, Spacecraft)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var___0_, var_Spacecraft), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
+ // Cost == 50000.0
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, 50000.0);
+ new Equality(body, var_Cost, var__virtual_0_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_Cost = body.getOrCreateVariableByName("Cost");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // neg find spacecraftWithInterferometryPayload(_, Spacecraft)
+ new NegativePatternCall(body, Tuples.flatTupleOf(var___0_, var_Spacecraft), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
+ // Cost == 0.0
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, 0.0);
+ new Equality(body, var_Cost, var__virtual_0_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1() {
+ return 50000.0;
+ }
+
+ private static double evaluateExpression_2_1() {
+ return 0.0;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java
new file mode 100644
index 00000000..0374195f
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java
@@ -0,0 +1,183 @@
+/**
+ * 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.SpacecraftCost;
+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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.AggregatorConstraint;
+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.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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 missionCost(Mission : InterferometryMission, Cost : java Double) {
+ * InterferometryMission.observationTime(Mission, ObservationTime);
+ * SpacecraftCost == sum find spacecraftCost(Mission, _, #_);
+ * Cost == eval(SpacecraftCost + 100000.0 ObservationTime);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class MissionCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private MissionCost() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static MissionCost 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.MissionCost (visibility: PUBLIC, simpleName: MissionCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost, 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.MissionCost (visibility: PUBLIC, simpleName: MissionCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost, 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 MissionCost INSTANCE = new MissionCost();
+
+ /**
+ * 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 MissionCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Mission, parameter_Cost);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionCost";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Mission","Cost");
+ }
+
+ @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_Cost = body.getOrCreateVariableByName("Cost");
+ PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
+ PVariable var_SpacecraftCost = body.getOrCreateVariableByName("SpacecraftCost");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Mission, parameter_Mission),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // InterferometryMission.observationTime(Mission, ObservationTime)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ 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", "InterferometryMission", "observationTime")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
+ new Equality(body, var__virtual_0_, var_ObservationTime);
+ // SpacecraftCost == sum find spacecraftCost(Mission, _, #_)
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Mission, var___0_, var___1_), SpacecraftCost.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
+ new Equality(body, var_SpacecraftCost, var__virtual_1_);
+ // Cost == eval(SpacecraftCost + 100000.0 * ObservationTime)
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern missionCost";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("ObservationTime", "SpacecraftCost");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Float ObservationTime = (Float) provider.getValue("ObservationTime");
+ Double SpacecraftCost = (Double) provider.getValue("SpacecraftCost");
+ return evaluateExpression_1_1(ObservationTime, SpacecraftCost);
+ }
+ }, var__virtual_2_ );
+ new Equality(body, var_Cost, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Float ObservationTime, final Double SpacecraftCost) {
+ return ((SpacecraftCost).doubleValue() + (100000.0 * (ObservationTime).floatValue()));
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java
new file mode 100644
index 00000000..583c2175
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java
@@ -0,0 +1,183 @@
+/**
+ * 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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.basicdeferred.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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 missionCoverage(Mission : InterferometryMission, Coverage : java Double) {
+ * InterferometryMission.observationTime(Mission, ObservationTime);
+ * ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _);
+ * Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 (1.0 / ObservationTime)) + 0.05 ObservationTime / 3);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class MissionCoverage extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private MissionCoverage() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static MissionCoverage 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.MissionCoverage (visibility: PUBLIC, simpleName: MissionCoverage, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage, 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.MissionCoverage (visibility: PUBLIC, simpleName: MissionCoverage, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage, 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 MissionCoverage INSTANCE = new MissionCoverage();
+
+ /**
+ * 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 MissionCoverage.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Coverage = new PParameter("Coverage", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Mission, parameter_Coverage);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionCoverage";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Mission","Coverage");
+ }
+
+ @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_Coverage = body.getOrCreateVariableByName("Coverage");
+ PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
+ PVariable var_ObserverCount = body.getOrCreateVariableByName("ObserverCount");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Coverage), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Mission, parameter_Mission),
+ new ExportedParameter(body, var_Coverage, parameter_Coverage)
+ ));
+ // InterferometryMission.observationTime(Mission, ObservationTime)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ 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", "InterferometryMission", "observationTime")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
+ new Equality(body, var__virtual_0_, var_ObservationTime);
+ // ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _)
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new PatternMatchCounter(body, Tuples.flatTupleOf(var_Mission, var___0_), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation(), var__virtual_1_);
+ new Equality(body, var_ObserverCount, var__virtual_1_);
+ // Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3)
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern missionCoverage";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("ObservationTime", "ObserverCount");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Float ObservationTime = (Float) provider.getValue("ObservationTime");
+ Integer ObserverCount = (Integer) provider.getValue("ObserverCount");
+ return evaluateExpression_1_1(ObservationTime, ObserverCount);
+ }
+ }, var__virtual_2_ );
+ new Equality(body, var_Coverage, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Float ObservationTime, final Integer ObserverCount) {
+ double _pow = Math.pow((1 - (2.0 / (ObserverCount).intValue())), (1 + (9 * (1.0 / (ObservationTime).floatValue()))));
+ double _plus = (_pow + ((0.05 * (ObservationTime).floatValue()) / 3));
+ return _plus;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java
new file mode 100644
index 00000000..3ad42bf5
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java
@@ -0,0 +1,183 @@
+/**
+ * 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.TransmitTime;
+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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.AggregatorConstraint;
+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.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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 missionTime(Mission : InterferometryMission, Time : java Double) {
+ * InterferometryMission.observationTime(Mission, ObservationTime);
+ * TrasmitTime == sum find transmitTime(Mission, _, #_);
+ * Time == eval(TrasmitTime + 60.0 ObservationTime);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class MissionTime extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private MissionTime() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static MissionTime 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.MissionTime (visibility: PUBLIC, simpleName: MissionTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime, 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.MissionTime (visibility: PUBLIC, simpleName: MissionTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime, 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 MissionTime INSTANCE = new MissionTime();
+
+ /**
+ * 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 MissionTime.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Time = new PParameter("Time", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Mission, parameter_Time);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionTime";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Mission","Time");
+ }
+
+ @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_Time = body.getOrCreateVariableByName("Time");
+ PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
+ PVariable var_TrasmitTime = body.getOrCreateVariableByName("TrasmitTime");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Time), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Mission, parameter_Mission),
+ new ExportedParameter(body, var_Time, parameter_Time)
+ ));
+ // InterferometryMission.observationTime(Mission, ObservationTime)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ 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", "InterferometryMission", "observationTime")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
+ new Equality(body, var__virtual_0_, var_ObservationTime);
+ // TrasmitTime == sum find transmitTime(Mission, _, #_)
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Mission, var___0_, var___1_), TransmitTime.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
+ new Equality(body, var_TrasmitTime, var__virtual_1_);
+ // Time == eval(TrasmitTime + 60.0 * ObservationTime)
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern missionTime";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("ObservationTime", "TrasmitTime");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Float ObservationTime = (Float) provider.getValue("ObservationTime");
+ Double TrasmitTime = (Double) provider.getValue("TrasmitTime");
+ return evaluateExpression_1_1(ObservationTime, TrasmitTime);
+ }
+ }, var__virtual_2_ );
+ new Equality(body, var_Time, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Float ObservationTime, final Double TrasmitTime) {
+ return ((TrasmitTime).doubleValue() + (60.0 * (ObservationTime).floatValue()));
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
index 7f1be700..2f310711 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
@@ -5,6 +5,8 @@ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
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.CostMetric;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric;
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.IncompatibleSourceAndTargetGain;
@@ -12,9 +14,12 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.KaAntennaGainLow;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBand;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGain;
@@ -22,9 +27,21 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsyst
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGainMedium;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SmallSat;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKind;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink;
import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime;
import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
/**
@@ -55,6 +72,23 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
* groundStationNetwork
* cubeSatWithKaAntenna
* smallSat
+ * coverageMetric
+ * missionCoverage
+ * timeMetric
+ * missionTime
+ * transmitTime
+ * incomingData
+ * scienceData
+ * transmitRate
+ * spacecraftUplink
+ * costMetric
+ * missionCost
+ * spacecraftCost
+ * spacecraftOfKind
+ * basePrice
+ * interferometryPayloadCost
+ * additionalCommSubsystemCost
+ * spacecraftWithTwoCommSubsystems
*
*
* @see IQueryGroup
@@ -101,5 +135,22 @@ public final class SatelliteQueriesAll extends BaseGeneratedPatternGroup {
querySpecifications.add(GroundStationNetwork.instance());
querySpecifications.add(CubeSatWithKaAntenna.instance());
querySpecifications.add(SmallSat.instance());
+ querySpecifications.add(CoverageMetric.instance());
+ querySpecifications.add(MissionCoverage.instance());
+ querySpecifications.add(TimeMetric.instance());
+ querySpecifications.add(MissionTime.instance());
+ querySpecifications.add(TransmitTime.instance());
+ querySpecifications.add(IncomingData.instance());
+ querySpecifications.add(ScienceData.instance());
+ querySpecifications.add(TransmitRate.instance());
+ querySpecifications.add(SpacecraftUplink.instance());
+ querySpecifications.add(CostMetric.instance());
+ querySpecifications.add(MissionCost.instance());
+ querySpecifications.add(SpacecraftCost.instance());
+ querySpecifications.add(SpacecraftOfKind.instance());
+ querySpecifications.add(BasePrice.instance());
+ querySpecifications.add(InterferometryPayloadCost.instance());
+ querySpecifications.add(AdditionalCommSubsystemCost.instance());
+ querySpecifications.add(SpacecraftWithTwoCommSubsystems.instance());
}
}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java
new file mode 100644
index 00000000..b558e51e
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java
@@ -0,0 +1,179 @@
+/**
+ * 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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.basicdeferred.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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 scienceData(Spacecraft : Spacecraft, Data : java Double) {
+ * ConstellationMission.spacecraft(Mission, Spacecraft);
+ * InterferometryMission.observationTime(Mission, ObservationTime);
+ * Data == eval(12.0 ObservationTime);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class ScienceData extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private ScienceData() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static ScienceData 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.ScienceData (visibility: PUBLIC, simpleName: ScienceData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData, 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.ScienceData (visibility: PUBLIC, simpleName: ScienceData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData, 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 ScienceData INSTANCE = new ScienceData();
+
+ /**
+ * 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 ScienceData.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Data = new PParameter("Data", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Data);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.scienceData";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Data");
+ }
+
+ @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_Data = body.getOrCreateVariableByName("Data");
+ PVariable var_Mission = body.getOrCreateVariableByName("Mission");
+ PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Data), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Data, parameter_Data)
+ ));
+ // ConstellationMission.spacecraft(Mission, Spacecraft)
+ 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", "spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new Equality(body, var__virtual_0_, var_Spacecraft);
+ // InterferometryMission.observationTime(Mission, ObservationTime)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ 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", "InterferometryMission", "observationTime")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
+ new Equality(body, var__virtual_1_, var_ObservationTime);
+ // Data == eval(12.0 * ObservationTime)
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern scienceData";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("ObservationTime");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Float ObservationTime = (Float) provider.getValue("ObservationTime");
+ return evaluateExpression_1_1(ObservationTime);
+ }
+ }, var__virtual_2_ );
+ new Equality(body, var_Data, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Float ObservationTime) {
+ return (12.0 * (ObservationTime).floatValue());
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SmallSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SmallSat.java
index 252db290..d74ed28a 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SmallSat.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SmallSat.java
@@ -8,13 +8,18 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
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.EDataTypeInSlotsKey;
+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.ConstantValue;
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;
@@ -26,8 +31,8 @@ import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
*
* Original source:
*
- * private pattern smallSat(Sat : SmallSat) {
- * SmallSat(Sat);
+ * private pattern smallSat(Sat : Spacecraft) {
+ * Spacecraft.kind(Sat, SpacecraftKind::SmallSat);
* }
*
*
@@ -83,7 +88,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecificationWithGeneri
private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
private static final SmallSat.GeneratedPQuery INSTANCE = new GeneratedPQuery();
- private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "SmallSat")), PParameterDirection.INOUT);
+ private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
private final List parameters = Arrays.asList(parameter_Sat);
@@ -113,12 +118,18 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecificationWithGeneri
{
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")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
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")));
+ // Spacecraft.kind(Sat, SpacecraftKind::SmallSat)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "SpacecraftKind", "SmallSat").getInstance());
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Sat, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var__virtual_0_);
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/SpacecraftCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java
new file mode 100644
index 00000000..65fed74a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java
@@ -0,0 +1,215 @@
+/**
+ * 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.AdditionalCommSubsystemCost;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKind;
+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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.basicdeferred.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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 spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) {
+ * ConstellationMission.spacecraft(Mission, Spacecraft);
+ * Spacecraft.kind(Spacecraft, Kind);
+ * KindCount == count find spacecraftOfKind(_, Kind);
+ * find basePrice(Spacecraft, BasePrice);
+ * find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost);
+ * find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost);
+ * Cost == eval(BasePrice Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class SpacecraftCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private SpacecraftCost() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static SpacecraftCost 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.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, 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.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, 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 SpacecraftCost INSTANCE = new SpacecraftCost();
+
+ /**
+ * 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 SpacecraftCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft, parameter_Cost);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftCost";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Mission","Spacecraft","Cost");
+ }
+
+ @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_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_Cost = body.getOrCreateVariableByName("Cost");
+ PVariable var_Kind = body.getOrCreateVariableByName("Kind");
+ PVariable var_KindCount = body.getOrCreateVariableByName("KindCount");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
+ PVariable var_InterferometryPayloadCost = body.getOrCreateVariableByName("InterferometryPayloadCost");
+ PVariable var_AdditionalCommSubsystemCost = body.getOrCreateVariableByName("AdditionalCommSubsystemCost");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Mission, parameter_Mission),
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Cost, parameter_Cost)
+ ));
+ // ConstellationMission.spacecraft(Mission, Spacecraft)
+ 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", "spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new Equality(body, var__virtual_0_, var_Spacecraft);
+ // Spacecraft.kind(Spacecraft, Kind)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_1_, var_Kind);
+ // KindCount == count find spacecraftOfKind(_, Kind)
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_, var_Kind), SpacecraftOfKind.instance().getInternalQueryRepresentation(), var__virtual_2_);
+ new Equality(body, var_KindCount, var__virtual_2_);
+ // find basePrice(Spacecraft, BasePrice)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_BasePrice), BasePrice.instance().getInternalQueryRepresentation());
+ // find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_InterferometryPayloadCost), InterferometryPayloadCost.instance().getInternalQueryRepresentation());
+ // find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_AdditionalCommSubsystemCost), AdditionalCommSubsystemCost.instance().getInternalQueryRepresentation());
+ // Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost)
+ PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern spacecraftCost";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("AdditionalCommSubsystemCost", "BasePrice", "InterferometryPayloadCost", "KindCount");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Double AdditionalCommSubsystemCost = (Double) provider.getValue("AdditionalCommSubsystemCost");
+ Double BasePrice = (Double) provider.getValue("BasePrice");
+ Double InterferometryPayloadCost = (Double) provider.getValue("InterferometryPayloadCost");
+ Integer KindCount = (Integer) provider.getValue("KindCount");
+ return evaluateExpression_1_1(AdditionalCommSubsystemCost, BasePrice, InterferometryPayloadCost, KindCount);
+ }
+ }, var__virtual_3_ );
+ new Equality(body, var_Cost, var__virtual_3_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Double AdditionalCommSubsystemCost, final Double BasePrice, final Double InterferometryPayloadCost, final Integer KindCount) {
+ double _pow = Math.pow((KindCount).intValue(), (-0.25));
+ double _multiply = ((BasePrice).doubleValue() * _pow);
+ double _plus = (_multiply + (InterferometryPayloadCost).doubleValue());
+ double _plus_1 = (_plus + (AdditionalCommSubsystemCost).doubleValue());
+ return _plus_1;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKind.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKind.java
new file mode 100644
index 00000000..5e49aa58
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftOfKind.java
@@ -0,0 +1,140 @@
+/**
+ * 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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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 spacecraftOfKind(Spacecraft : Spacecraft, Kind : SpacecraftKind) {
+ * Spacecraft.kind(Spacecraft, Kind);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class SpacecraftOfKind extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private SpacecraftOfKind() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static SpacecraftOfKind 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.SpacecraftOfKind (visibility: PUBLIC, simpleName: SpacecraftOfKind, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKind, 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.SpacecraftOfKind (visibility: PUBLIC, simpleName: SpacecraftOfKind, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftOfKind, 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 SpacecraftOfKind INSTANCE = new SpacecraftOfKind();
+
+ /**
+ * 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 SpacecraftOfKind.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Kind = new PParameter("Kind", "hu.bme.mit.inf.dslreasoner.domains.satellite.SpacecraftKind", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "SpacecraftKind")), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Kind);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Kind");
+ }
+
+ @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_Kind = body.getOrCreateVariableByName("Kind");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Kind), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Kind, parameter_Kind)
+ ));
+ // Spacecraft.kind(Spacecraft, Kind)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ 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", "Spacecraft", "kind")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "SpacecraftKind")));
+ new Equality(body, var__virtual_0_, var_Kind);
+ 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/SpacecraftUplink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java
new file mode 100644
index 00000000..966ff6f8
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java
@@ -0,0 +1,171 @@
+/**
+ * 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.emf.ecore.EDataType;
+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.EDataTypeInSlotsKey;
+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 spacecraftUplink(Spacecraft : Spacecraft, Band : TransceiverBand, Target : CommunicatingElement) {
+ * CommunicatingElement.communicationLink(Spacecraft, Link);
+ * DirectedCommunicationLink.source.band(Link, Band);
+ * DirectedCommunicationLink.target(Link, TargetSubsystem);
+ * CommunicatingElement.commSubsystem(Target, TargetSubsystem);
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class SpacecraftUplink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private SpacecraftUplink() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static SpacecraftUplink 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.SpacecraftUplink (visibility: PUBLIC, simpleName: SpacecraftUplink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink, 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.SpacecraftUplink (visibility: PUBLIC, simpleName: SpacecraftUplink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink, 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 SpacecraftUplink INSTANCE = new SpacecraftUplink();
+
+ /**
+ * 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 SpacecraftUplink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Band = new PParameter("Band", "hu.bme.mit.inf.dslreasoner.domains.satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Target = new PParameter("Target", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_Band, parameter_Target);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftUplink";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","Band","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_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_Band = body.getOrCreateVariableByName("Band");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ PVariable var_Link = body.getOrCreateVariableByName("Link");
+ PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Band), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "TransceiverBand")));
+ 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_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_Band, parameter_Band),
+ new ExportedParameter(body, var_Target, parameter_Target)
+ ));
+ // CommunicatingElement.communicationLink(Spacecraft, Link)
+ 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", "communicationLink")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
+ new Equality(body, var__virtual_0_, var_Link);
+ // DirectedCommunicationLink.source.band(Link, Band)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "band")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "TransceiverBand")));
+ new Equality(body, var__virtual_2_, var_Band);
+ // DirectedCommunicationLink.target(Link, TargetSubsystem)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
+ PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ new Equality(body, var__virtual_3_, var_TargetSubsystem);
+ // CommunicatingElement.commSubsystem(Target, TargetSubsystem)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
+ PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
+ new Equality(body, var__virtual_4_, 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/SpacecraftWithTwoCommSubsystems.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java
new file mode 100644
index 00000000..98f1be7b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java
@@ -0,0 +1,146 @@
+/**
+ * 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.basicdeferred.Inequality;
+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 spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) {
+ * Spacecraft.commSubsystem(Spacecraft, Subsystem1);
+ * Spacecraft.commSubsystem(Spacecraft, Subsystem2);
+ * Subsystem1 != Subsystem2;
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class SpacecraftWithTwoCommSubsystems extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private SpacecraftWithTwoCommSubsystems() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static SpacecraftWithTwoCommSubsystems 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.SpacecraftWithTwoCommSubsystems (visibility: PUBLIC, simpleName: SpacecraftWithTwoCommSubsystems, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems, 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.SpacecraftWithTwoCommSubsystems (visibility: PUBLIC, simpleName: SpacecraftWithTwoCommSubsystems, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems, 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 SpacecraftWithTwoCommSubsystems INSTANCE = new SpacecraftWithTwoCommSubsystems();
+
+ /**
+ * 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 SpacecraftWithTwoCommSubsystems.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftWithTwoCommSubsystems";
+ }
+
+ @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_Subsystem1 = body.getOrCreateVariableByName("Subsystem1");
+ PVariable var_Subsystem2 = body.getOrCreateVariableByName("Subsystem2");
+ 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)
+ ));
+ // Spacecraft.commSubsystem(Spacecraft, Subsystem1)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ 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_Subsystem1);
+ // Spacecraft.commSubsystem(Spacecraft, Subsystem2)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, 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_Subsystem2);
+ // Subsystem1 != Subsystem2
+ new Inequality(body, var_Subsystem1, var_Subsystem2);
+ 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/TransmitRate.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java
new file mode 100644
index 00000000..2faa7733
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java
@@ -0,0 +1,277 @@
+/**
+ * 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.SpacecraftUplink;
+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.context.common.JavaTransitiveInstancesKey;
+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.basicdeferred.TypeFilterConstraint;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
+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 transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) {
+ * find spacecraftUplink(Spacecraft, TransceiverBand::UHF, Target);
+ * Spacecraft(Target);
+ * TransmitRate == 5.0;
+ * } or {
+ * find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
+ * Spacecraft(Target);
+ * TransmitRate == 1.6;
+ * } or {
+ * find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
+ * GroundStationNetwork(Target);
+ * TransmitRate == 0.7;
+ * } or {
+ * find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
+ * Spacecraft(Target);
+ * TransmitRate == 220.0;
+ * } or {
+ * find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
+ * GroundStationNetwork(Target);
+ * TransmitRate == 80.0;
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class TransmitRate extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private TransmitRate() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static TransmitRate 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.TransmitRate (visibility: PUBLIC, simpleName: TransmitRate, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate, 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.TransmitRate (visibility: PUBLIC, simpleName: TransmitRate, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate, 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 TransmitRate INSTANCE = new TransmitRate();
+
+ /**
+ * 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 TransmitRate.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_TransmitRate = new PParameter("TransmitRate", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Spacecraft, parameter_TransmitRate);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmitRate";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Spacecraft","TransmitRate");
+ }
+
+ @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_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
+ ));
+ // find spacecraftUplink(Spacecraft, TransceiverBand::UHF, Target)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "UHF").getInstance());
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
+ // Spacecraft(Target)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ // TransmitRate == 5.0
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new ConstantValue(body, var__virtual_1_, 5.0);
+ new Equality(body, var_TransmitRate, var__virtual_1_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
+ ));
+ // find spacecraftUplink(Spacecraft, TransceiverBand::X, Target)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "X").getInstance());
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
+ // Spacecraft(Target)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ // TransmitRate == 1.6
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new ConstantValue(body, var__virtual_1_, 1.6);
+ new Equality(body, var_TransmitRate, var__virtual_1_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
+ ));
+ // find spacecraftUplink(Spacecraft, TransceiverBand::X, Target)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "X").getInstance());
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
+ // GroundStationNetwork(Target)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
+ // TransmitRate == 0.7
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new ConstantValue(body, var__virtual_1_, 0.7);
+ new Equality(body, var_TransmitRate, var__virtual_1_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
+ ));
+ // find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "Ka").getInstance());
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
+ // Spacecraft(Target)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ // TransmitRate == 220.0
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new ConstantValue(body, var__virtual_1_, 220.0);
+ new Equality(body, var_TransmitRate, var__virtual_1_);
+ bodies.add(body);
+ }
+ {
+ PBody body = new PBody(this);
+ PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ PVariable var_Target = body.getOrCreateVariableByName("Target");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
+ ));
+ // find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target)
+ PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
+ new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "Ka").getInstance());
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
+ // GroundStationNetwork(Target)
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
+ // TransmitRate == 80.0
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new ConstantValue(body, var__virtual_1_, 80.0);
+ new Equality(body, var_TransmitRate, var__virtual_1_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1() {
+ return 5.0;
+ }
+
+ private static double evaluateExpression_2_1() {
+ return 1.6;
+ }
+
+ private static double evaluateExpression_3_1() {
+ return 0.7;
+ }
+
+ private static double evaluateExpression_4_1() {
+ return 220.0;
+ }
+
+ private static double evaluateExpression_5_1() {
+ return 80.0;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java
new file mode 100644
index 00000000..eb338bec
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java
@@ -0,0 +1,200 @@
+/**
+ * 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.IncomingData;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
+import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate;
+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.aggregators.sum;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
+import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
+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.AggregatorConstraint;
+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.ExpressionEvaluation;
+import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
+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;
+import org.eclipse.xtext.xbase.lib.DoubleExtensions;
+
+/**
+ * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
+ *
+ * Original source:
+ *
+ * private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) {
+ * ConstellationMission.spacecraft(Mission, Spacecraft);
+ * find scienceData(Spacecraft, ScienceData);
+ * IncomingData == sum find incomingData(Spacecraft, _, #_);
+ * find transmitRate(Spacecraft, TransmitRate);
+ * TransmitTime == eval((ScienceData + IncomingData) / (7.5 TransmitRate));
+ * }
+ *
+ *
+ * @see GenericPatternMatcher
+ * @see GenericPatternMatch
+ *
+ */
+@SuppressWarnings("all")
+public final class TransmitTime extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
+ private TransmitTime() {
+ super(GeneratedPQuery.INSTANCE);
+ }
+
+ /**
+ * @return the singleton instance of the query specification
+ * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
+ *
+ */
+ public static TransmitTime 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.TransmitTime (visibility: PUBLIC, simpleName: TransmitTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime, 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.TransmitTime (visibility: PUBLIC, simpleName: TransmitTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime, 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 TransmitTime INSTANCE = new TransmitTime();
+
+ /**
+ * 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 TransmitTime.GeneratedPQuery INSTANCE = new GeneratedPQuery();
+
+ private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
+
+ private final PParameter parameter_TransmitTime = new PParameter("TransmitTime", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
+
+ private final List parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft, parameter_TransmitTime);
+
+ private GeneratedPQuery() {
+ super(PVisibility.PRIVATE);
+ }
+
+ @Override
+ public String getFullyQualifiedName() {
+ return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmitTime";
+ }
+
+ @Override
+ public List getParameterNames() {
+ return Arrays.asList("Mission","Spacecraft","TransmitTime");
+ }
+
+ @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_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
+ PVariable var_TransmitTime = body.getOrCreateVariableByName("TransmitTime");
+ PVariable var_ScienceData = body.getOrCreateVariableByName("ScienceData");
+ PVariable var_IncomingData = body.getOrCreateVariableByName("IncomingData");
+ PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
+ PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
+ PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitTime), new JavaTransitiveInstancesKey(java.lang.Double.class));
+ body.setSymbolicParameters(Arrays.asList(
+ new ExportedParameter(body, var_Mission, parameter_Mission),
+ new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
+ new ExportedParameter(body, var_TransmitTime, parameter_TransmitTime)
+ ));
+ // ConstellationMission.spacecraft(Mission, Spacecraft)
+ 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", "spacecraft")));
+ new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
+ new Equality(body, var__virtual_0_, var_Spacecraft);
+ // find scienceData(Spacecraft, ScienceData)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_ScienceData), ScienceData.instance().getInternalQueryRepresentation());
+ // IncomingData == sum find incomingData(Spacecraft, _, #_)
+ PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
+ new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Spacecraft, var___0_, var___1_), IncomingData.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
+ new Equality(body, var_IncomingData, var__virtual_1_);
+ // find transmitRate(Spacecraft, TransmitRate)
+ new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_TransmitRate), TransmitRate.instance().getInternalQueryRepresentation());
+ // TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate))
+ PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
+ new ExpressionEvaluation(body, new IExpressionEvaluator() {
+
+ @Override
+ public String getShortDescription() {
+ return "Expression evaluation from pattern transmitTime";
+ }
+
+ @Override
+ public Iterable getInputParameterNames() {
+ return Arrays.asList("IncomingData", "ScienceData", "TransmitRate");}
+
+ @Override
+ public Object evaluateExpression(IValueProvider provider) throws Exception {
+ Double IncomingData = (Double) provider.getValue("IncomingData");
+ Double ScienceData = (Double) provider.getValue("ScienceData");
+ Double TransmitRate = (Double) provider.getValue("TransmitRate");
+ return evaluateExpression_1_1(IncomingData, ScienceData, TransmitRate);
+ }
+ }, var__virtual_2_ );
+ new Equality(body, var_TransmitTime, var__virtual_2_);
+ bodies.add(body);
+ }
+ return bodies;
+ }
+ }
+
+ private static double evaluateExpression_1_1(final Double IncomingData, final Double ScienceData, final Double TransmitRate) {
+ double _plus = DoubleExtensions.operator_plus(ScienceData, IncomingData);
+ double _divide = (_plus / (7.5 * (TransmitRate).doubleValue()));
+ return _divide;
+ }
+}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
index d0542b4a..7ca948cc 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
@@ -133,7 +133,8 @@ pattern kaAntennaGainLow(Comm : CommSubsystem) {
@Constraint(severity = "error", key = {Sat},
message = "3U CubeSats can only cross-link using UHF.")
-pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
+pattern threeUCubeSatWithNonUhfCrossLink(Sat : Spacecraft) {
+ Spacecraft.kind(Sat, SpacecraftKind::CubeSat3U);
CommunicatingElement.commSubsystem(Sat, SourceComm);
neg find commSubsystemBandUhf(SourceComm);
DirectedCommunicationLink.source(Link, SourceComm);
@@ -159,6 +160,141 @@ pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) {
neg find smallSat(Spacecraft);
}
-private pattern smallSat(Sat : SmallSat) {
- SmallSat(Sat);
+private pattern smallSat(Sat : Spacecraft) {
+ Spacecraft.kind(Sat, SpacecraftKind::SmallSat);
+}
+
+//
+// Metrics
+//
+
+// Coverage
+
+pattern coverageMetric(Coverage : java Double) {
+ Coverage == sum find missionCoverage(_, #_);
+}
+
+private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) {
+ InterferometryMission.observationTime(Mission, ObservationTime);
+ ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _);
+ Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3);
+}
+
+// Time
+
+pattern timeMetric(Time : java Double) {
+ Time == sum find missionTime(_, #_);
+}
+
+private pattern missionTime(Mission : InterferometryMission, Time : java Double) {
+ InterferometryMission.observationTime(Mission, ObservationTime);
+ TrasmitTime == sum find transmitTime(Mission, _, #_);
+ Time == eval(TrasmitTime + 60.0 * ObservationTime);
+}
+
+private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) {
+ ConstellationMission.spacecraft(Mission, Spacecraft);
+ find scienceData(Spacecraft, ScienceData);
+ IncomingData == sum find incomingData(Spacecraft, _, #_);
+ find transmitRate(Spacecraft, TransmitRate);
+ TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate));
+}
+
+private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) {
+ find indirectCommunicationLink(Source, Spacecraft);
+ find scienceData(Source, Data);
+}
+
+private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) {
+ ConstellationMission.spacecraft(Mission, Spacecraft);
+ InterferometryMission.observationTime(Mission, ObservationTime);
+ Data == eval(12.0 * ObservationTime);
+}
+
+private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) {
+ find spacecraftUplink(Spacecraft, TransceiverBand::UHF, Target);
+ Spacecraft(Target);
+ TransmitRate == 5.0;
+} or {
+ find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
+ Spacecraft(Target);
+ TransmitRate == 1.6;
+} or {
+ find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
+ GroundStationNetwork(Target);
+ TransmitRate == 0.7;
+} or {
+ find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
+ Spacecraft(Target);
+ TransmitRate == 220.0;
+} or {
+ find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
+ GroundStationNetwork(Target);
+ TransmitRate == 80.0;
+}
+
+private pattern spacecraftUplink(Spacecraft : Spacecraft, Band : TransceiverBand, Target : CommunicatingElement) {
+ CommunicatingElement.communicationLink(Spacecraft, Link);
+ DirectedCommunicationLink.source.band(Link, Band);
+ DirectedCommunicationLink.target(Link, TargetSubsystem);
+ CommunicatingElement.commSubsystem(Target, TargetSubsystem);
+}
+
+// Cost
+
+pattern costMetric(Cost : java Double) {
+ Cost == sum find missionCost(_, #_);
+}
+
+private pattern missionCost(Mission : InterferometryMission, Cost : java Double) {
+ InterferometryMission.observationTime(Mission, ObservationTime);
+ SpacecraftCost == sum find spacecraftCost(Mission, _, #_);
+ Cost == eval(SpacecraftCost + 100000.0 * ObservationTime);
+}
+
+private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) {
+ ConstellationMission.spacecraft(Mission, Spacecraft);
+ Spacecraft.kind(Spacecraft, Kind);
+ KindCount == count find spacecraftOfKind(_, Kind);
+ find basePrice(Spacecraft, BasePrice);
+ find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost);
+ find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost);
+ Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost);
+}
+
+private pattern spacecraftOfKind(Spacecraft : Spacecraft, Kind : SpacecraftKind) {
+ Spacecraft.kind(Spacecraft, Kind);
+}
+
+private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) {
+ Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U);
+ BasePrice == 250000.0;
+} or {
+ Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat6U);
+ BasePrice == 750000.0;
+} or {
+ Spacecraft.kind(Spacecraft, SpacecraftKind::SmallSat);
+ BasePrice == 3000000.0;
+}
+
+private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) {
+ find spacecraftWithInterferometryPayload(_, Spacecraft);
+ Cost == 50000.0;
+} or {
+ neg find spacecraftWithInterferometryPayload(_, Spacecraft);
+ Cost == 0.0;
+}
+
+private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) {
+ find spacecraftWithTwoCommSubsystems(Spacecraft);
+ Cost == 100000.0;
+} or {
+ neg find spacecraftWithTwoCommSubsystems(Spacecraft);
+ Cost == 0.0;
+}
+
+private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) {
+ Spacecraft.commSubsystem(Spacecraft, Subsystem1);
+ Spacecraft.commSubsystem(Spacecraft, Subsystem2);
+ Subsystem1 != Subsystem2;
}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin
deleted file mode 100644
index d2d60846..00000000
Binary files a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin and /dev/null differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java
deleted file mode 100644
index f6890163..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package hu.bme.mit.inf.dslreasoner.domains.satellite.runner;
-
-import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor;
-import org.eclipse.xtext.xbase.lib.InputOutput;
-
-@SuppressWarnings("all")
-public final class SatelliteGeneratorMain {
- private SatelliteGeneratorMain() {
- throw new IllegalStateException("This is a static utility class and should not be instantiated directly.");
- }
-
- public static void main(final String[] args) {
- InputOutput.println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig"));
- }
-}
--
cgit v1.2.3-70-g09d2