From 513a5afe3a8663ad30112f7e3c0e66137938e635 Mon Sep 17 00:00:00 2001 From: ArenBabikian Date: Wed, 20 Mar 2019 20:39:28 -0400 Subject: Add gitignore, commit everything --- .../.gitignore | 1 + .../ecse/dslreasoner/vampire/queries/VLSAnd.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSAnnotation.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSComment.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSEquivalent.java | 533 -------------------- .../vampire/queries/VLSExistentialQuantifier.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSFofFormula.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSFunction.java | 533 -------------------- .../vampire/queries/VLSFunctionFof.java | 533 -------------------- .../dslreasoner/vampire/queries/VLSInequality.java | 533 -------------------- .../ecse/dslreasoner/vampire/queries/VLSOr.java | 535 --------------------- .../vampire/queries/VLSUnaryNegation.java | 533 -------------------- .../vampire/queries/VLSUniversalQuantifier.java | 533 -------------------- .../vampire/queries/VampireQueries.java | 174 ------- 14 files changed, 1 insertion(+), 6572 deletions(-) delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnd.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnnotation.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSComment.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSEquivalent.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSExistentialQuantifier.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFofFormula.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunction.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunctionFof.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSInequality.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSOr.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUnaryNegation.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUniversalQuantifier.java delete mode 100644 Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VampireQueries.java (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries') diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/.gitignore b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/.gitignore index ae3c1726..39fc9cc5 100644 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/.gitignore +++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/.gitignore @@ -1 +1,2 @@ /bin/ +/src-gen/ \ No newline at end of file diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnd.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnd.java deleted file mode 100644 index 23d9293f..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnd.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSAnd(term: VLSAnd){
- *         	VLSAnd(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSAnd extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd"; - } - - @Override - public List parameterNames() { - return VLSAnd.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSAnd.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSAnd.Match)) { - VLSAnd.Match other = (VLSAnd.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSAnd specification() { - return VLSAnd.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 VLSAnd.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSAnd.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSAnd.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSAnd.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSAnd.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSAnd(term: VLSAnd){
-   * 	VLSAnd(term);
-   * }
-   * 
- * - * @see Match - * @see VLSAnd - * - */ - 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 VLSAnd.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 VLSAnd.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSAnd.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSAnd.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) { - return VLSAnd.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSAnd.Match tupleToMatch(final Tuple t) { - try { - return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSAnd.Match arrayToMatch(final Object[] match) { - try { - return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSAnd.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSAnd.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) match[POSITION_TERM]); - } 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 VLSAnd.instance(); - } - } - - private VLSAnd() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSAnd instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSAnd.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSAnd.Matcher.on(engine); - } - - @Override - public VLSAnd.Matcher instantiate() { - return VLSAnd.Matcher.create(); - } - - @Override - public VLSAnd.Match newEmptyMatch() { - return VLSAnd.Match.newEmptyMatch(); - } - - @Override - public VLSAnd.Match newMatch(final Object... parameters) { - return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd (visibility: PUBLIC, simpleName: VLSAnd, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd (visibility: PUBLIC, simpleName: VLSAnd, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSAnd INSTANCE = new VLSAnd(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSAnd.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnd")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnd"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSAnd(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnd"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnnotation.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnnotation.java deleted file mode 100644 index 282d813f..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSAnnotation.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSAnnotation(term: VLSAnnotation){
- *         	VLSAnnotation(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSAnnotation extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation"; - } - - @Override - public List parameterNames() { - return VLSAnnotation.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSAnnotation.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSAnnotation.Match)) { - VLSAnnotation.Match other = (VLSAnnotation.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSAnnotation specification() { - return VLSAnnotation.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 VLSAnnotation.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSAnnotation.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSAnnotation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSAnnotation.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSAnnotation.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSAnnotation(term: VLSAnnotation){
-   * 	VLSAnnotation(term);
-   * }
-   * 
- * - * @see Match - * @see VLSAnnotation - * - */ - 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 VLSAnnotation.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 VLSAnnotation.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSAnnotation.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSAnnotation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) { - return VLSAnnotation.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSAnnotation.Match tupleToMatch(final Tuple t) { - try { - return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSAnnotation.Match arrayToMatch(final Object[] match) { - try { - return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSAnnotation.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSAnnotation.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) match[POSITION_TERM]); - } 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 VLSAnnotation.instance(); - } - } - - private VLSAnnotation() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSAnnotation instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSAnnotation.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSAnnotation.Matcher.on(engine); - } - - @Override - public VLSAnnotation.Matcher instantiate() { - return VLSAnnotation.Matcher.create(); - } - - @Override - public VLSAnnotation.Match newEmptyMatch() { - return VLSAnnotation.Match.newEmptyMatch(); - } - - @Override - public VLSAnnotation.Match newMatch(final Object... parameters) { - return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation (visibility: PUBLIC, simpleName: VLSAnnotation, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation (visibility: PUBLIC, simpleName: VLSAnnotation, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSAnnotation INSTANCE = new VLSAnnotation(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSAnnotation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnnotation")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnnotation"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSAnnotation(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnnotation"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSComment.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSComment.java deleted file mode 100644 index ec2bfef3..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSComment.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSComment(term: VLSComment){
- *         	VLSComment(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSComment extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment"; - } - - @Override - public List parameterNames() { - return VLSComment.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSComment.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSComment.Match)) { - VLSComment.Match other = (VLSComment.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSComment specification() { - return VLSComment.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 VLSComment.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSComment.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSComment.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSComment.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSComment.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSComment(term: VLSComment){
-   * 	VLSComment(term);
-   * }
-   * 
- * - * @see Match - * @see VLSComment - * - */ - 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 VLSComment.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 VLSComment.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSComment.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSComment.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) { - return VLSComment.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSComment.Match tupleToMatch(final Tuple t) { - try { - return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSComment.Match arrayToMatch(final Object[] match) { - try { - return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSComment.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSComment.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) match[POSITION_TERM]); - } 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 VLSComment.instance(); - } - } - - private VLSComment() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSComment instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSComment.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSComment.Matcher.on(engine); - } - - @Override - public VLSComment.Matcher instantiate() { - return VLSComment.Matcher.create(); - } - - @Override - public VLSComment.Match newEmptyMatch() { - return VLSComment.Match.newEmptyMatch(); - } - - @Override - public VLSComment.Match newMatch(final Object... parameters) { - return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment (visibility: PUBLIC, simpleName: VLSComment, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment (visibility: PUBLIC, simpleName: VLSComment, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSComment INSTANCE = new VLSComment(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSComment.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSComment")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSComment"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSComment(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSComment"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSEquivalent.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSEquivalent.java deleted file mode 100644 index 5a174fed..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSEquivalent.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSEquivalent(term: VLSEquivalent){
- *         	VLSEquivalent(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSEquivalent extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent"; - } - - @Override - public List parameterNames() { - return VLSEquivalent.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSEquivalent.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSEquivalent.Match)) { - VLSEquivalent.Match other = (VLSEquivalent.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSEquivalent specification() { - return VLSEquivalent.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 VLSEquivalent.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSEquivalent.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSEquivalent.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSEquivalent.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSEquivalent.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSEquivalent(term: VLSEquivalent){
-   * 	VLSEquivalent(term);
-   * }
-   * 
- * - * @see Match - * @see VLSEquivalent - * - */ - 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 VLSEquivalent.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 VLSEquivalent.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSEquivalent.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSEquivalent.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) { - return VLSEquivalent.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSEquivalent.Match tupleToMatch(final Tuple t) { - try { - return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSEquivalent.Match arrayToMatch(final Object[] match) { - try { - return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSEquivalent.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSEquivalent.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) match[POSITION_TERM]); - } 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 VLSEquivalent.instance(); - } - } - - private VLSEquivalent() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSEquivalent instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSEquivalent.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSEquivalent.Matcher.on(engine); - } - - @Override - public VLSEquivalent.Matcher instantiate() { - return VLSEquivalent.Matcher.create(); - } - - @Override - public VLSEquivalent.Match newEmptyMatch() { - return VLSEquivalent.Match.newEmptyMatch(); - } - - @Override - public VLSEquivalent.Match newMatch(final Object... parameters) { - return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent (visibility: PUBLIC, simpleName: VLSEquivalent, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent (visibility: PUBLIC, simpleName: VLSEquivalent, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSEquivalent INSTANCE = new VLSEquivalent(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSEquivalent.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSEquivalent")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSEquivalent"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSEquivalent(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSEquivalent"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSExistentialQuantifier.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSExistentialQuantifier.java deleted file mode 100644 index 137e4ca0..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSExistentialQuantifier.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSExistentialQuantifier(term: VLSExistentialQuantifier){
- *         	VLSExistentialQuantifier(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSExistentialQuantifier extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier"; - } - - @Override - public List parameterNames() { - return VLSExistentialQuantifier.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSExistentialQuantifier.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSExistentialQuantifier.Match)) { - VLSExistentialQuantifier.Match other = (VLSExistentialQuantifier.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSExistentialQuantifier specification() { - return VLSExistentialQuantifier.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 VLSExistentialQuantifier.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSExistentialQuantifier.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSExistentialQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSExistentialQuantifier.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSExistentialQuantifier.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSExistentialQuantifier(term: VLSExistentialQuantifier){
-   * 	VLSExistentialQuantifier(term);
-   * }
-   * 
- * - * @see Match - * @see VLSExistentialQuantifier - * - */ - 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 VLSExistentialQuantifier.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 VLSExistentialQuantifier.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSExistentialQuantifier.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSExistentialQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) { - return VLSExistentialQuantifier.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSExistentialQuantifier.Match tupleToMatch(final Tuple t) { - try { - return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSExistentialQuantifier.Match arrayToMatch(final Object[] match) { - try { - return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSExistentialQuantifier.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSExistentialQuantifier.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) match[POSITION_TERM]); - } 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 VLSExistentialQuantifier.instance(); - } - } - - private VLSExistentialQuantifier() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSExistentialQuantifier instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSExistentialQuantifier.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSExistentialQuantifier.Matcher.on(engine); - } - - @Override - public VLSExistentialQuantifier.Matcher instantiate() { - return VLSExistentialQuantifier.Matcher.create(); - } - - @Override - public VLSExistentialQuantifier.Match newEmptyMatch() { - return VLSExistentialQuantifier.Match.newEmptyMatch(); - } - - @Override - public VLSExistentialQuantifier.Match newMatch(final Object... parameters) { - return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier (visibility: PUBLIC, simpleName: VLSExistentialQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier (visibility: PUBLIC, simpleName: VLSExistentialQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSExistentialQuantifier INSTANCE = new VLSExistentialQuantifier(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSExistentialQuantifier.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSExistentialQuantifier")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSExistentialQuantifier"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSExistentialQuantifier(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSExistentialQuantifier"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFofFormula.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFofFormula.java deleted file mode 100644 index f55f408a..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFofFormula.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSFofFormula(term: VLSFofFormula){
- *         	VLSFofFormula(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSFofFormula extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula"; - } - - @Override - public List parameterNames() { - return VLSFofFormula.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSFofFormula.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSFofFormula.Match)) { - VLSFofFormula.Match other = (VLSFofFormula.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSFofFormula specification() { - return VLSFofFormula.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 VLSFofFormula.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSFofFormula.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSFofFormula.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSFofFormula.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSFofFormula.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSFofFormula(term: VLSFofFormula){
-   * 	VLSFofFormula(term);
-   * }
-   * 
- * - * @see Match - * @see VLSFofFormula - * - */ - 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 VLSFofFormula.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 VLSFofFormula.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFofFormula.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSFofFormula.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) { - return VLSFofFormula.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSFofFormula.Match tupleToMatch(final Tuple t) { - try { - return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSFofFormula.Match arrayToMatch(final Object[] match) { - try { - return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSFofFormula.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSFofFormula.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) match[POSITION_TERM]); - } 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 VLSFofFormula.instance(); - } - } - - private VLSFofFormula() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSFofFormula instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSFofFormula.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSFofFormula.Matcher.on(engine); - } - - @Override - public VLSFofFormula.Matcher instantiate() { - return VLSFofFormula.Matcher.create(); - } - - @Override - public VLSFofFormula.Match newEmptyMatch() { - return VLSFofFormula.Match.newEmptyMatch(); - } - - @Override - public VLSFofFormula.Match newMatch(final Object... parameters) { - return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula (visibility: PUBLIC, simpleName: VLSFofFormula, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula (visibility: PUBLIC, simpleName: VLSFofFormula, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSFofFormula INSTANCE = new VLSFofFormula(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSFofFormula.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFofFormula")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFofFormula"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSFofFormula(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFofFormula"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunction.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunction.java deleted file mode 100644 index f81a6e1a..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunction.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSFunction(term: VLSFunction){
- *         	VLSFunction(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSFunction extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction"; - } - - @Override - public List parameterNames() { - return VLSFunction.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSFunction.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSFunction.Match)) { - VLSFunction.Match other = (VLSFunction.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSFunction specification() { - return VLSFunction.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 VLSFunction.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSFunction.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSFunction.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSFunction.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSFunction.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSFunction(term: VLSFunction){
-   * 	VLSFunction(term);
-   * }
-   * 
- * - * @see Match - * @see VLSFunction - * - */ - 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 VLSFunction.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 VLSFunction.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFunction.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSFunction.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) { - return VLSFunction.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSFunction.Match tupleToMatch(final Tuple t) { - try { - return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSFunction.Match arrayToMatch(final Object[] match) { - try { - return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSFunction.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSFunction.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) match[POSITION_TERM]); - } 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 VLSFunction.instance(); - } - } - - private VLSFunction() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSFunction instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSFunction.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSFunction.Matcher.on(engine); - } - - @Override - public VLSFunction.Matcher instantiate() { - return VLSFunction.Matcher.create(); - } - - @Override - public VLSFunction.Match newEmptyMatch() { - return VLSFunction.Match.newEmptyMatch(); - } - - @Override - public VLSFunction.Match newMatch(final Object... parameters) { - return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction (visibility: PUBLIC, simpleName: VLSFunction, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction (visibility: PUBLIC, simpleName: VLSFunction, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSFunction INSTANCE = new VLSFunction(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSFunction.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunction")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunction"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSFunction(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunction"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunctionFof.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunctionFof.java deleted file mode 100644 index 86a3b95c..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSFunctionFof.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSFunctionFof(term: VLSFunctionFof){
- *         	VLSFunctionFof(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSFunctionFof extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof"; - } - - @Override - public List parameterNames() { - return VLSFunctionFof.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSFunctionFof.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSFunctionFof.Match)) { - VLSFunctionFof.Match other = (VLSFunctionFof.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSFunctionFof specification() { - return VLSFunctionFof.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 VLSFunctionFof.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSFunctionFof.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSFunctionFof.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSFunctionFof.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSFunctionFof.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSFunctionFof(term: VLSFunctionFof){
-   * 	VLSFunctionFof(term);
-   * }
-   * 
- * - * @see Match - * @see VLSFunctionFof - * - */ - 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 VLSFunctionFof.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 VLSFunctionFof.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFunctionFof.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSFunctionFof.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) { - return VLSFunctionFof.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSFunctionFof.Match tupleToMatch(final Tuple t) { - try { - return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSFunctionFof.Match arrayToMatch(final Object[] match) { - try { - return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSFunctionFof.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSFunctionFof.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) match[POSITION_TERM]); - } 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 VLSFunctionFof.instance(); - } - } - - private VLSFunctionFof() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSFunctionFof instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSFunctionFof.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSFunctionFof.Matcher.on(engine); - } - - @Override - public VLSFunctionFof.Matcher instantiate() { - return VLSFunctionFof.Matcher.create(); - } - - @Override - public VLSFunctionFof.Match newEmptyMatch() { - return VLSFunctionFof.Match.newEmptyMatch(); - } - - @Override - public VLSFunctionFof.Match newMatch(final Object... parameters) { - return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof (visibility: PUBLIC, simpleName: VLSFunctionFof, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof (visibility: PUBLIC, simpleName: VLSFunctionFof, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSFunctionFof INSTANCE = new VLSFunctionFof(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSFunctionFof.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunctionFof")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunctionFof"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSFunctionFof(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunctionFof"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSInequality.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSInequality.java deleted file mode 100644 index 0dd35ed9..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSInequality.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSInequality(term: VLSInequality){
- *         	VLSInequality(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSInequality extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality"; - } - - @Override - public List parameterNames() { - return VLSInequality.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSInequality.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSInequality.Match)) { - VLSInequality.Match other = (VLSInequality.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSInequality specification() { - return VLSInequality.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 VLSInequality.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSInequality.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSInequality.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSInequality.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSInequality.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSInequality(term: VLSInequality){
-   * 	VLSInequality(term);
-   * }
-   * 
- * - * @see Match - * @see VLSInequality - * - */ - 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 VLSInequality.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 VLSInequality.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSInequality.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSInequality.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) { - return VLSInequality.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSInequality.Match tupleToMatch(final Tuple t) { - try { - return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSInequality.Match arrayToMatch(final Object[] match) { - try { - return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSInequality.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSInequality.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) match[POSITION_TERM]); - } 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 VLSInequality.instance(); - } - } - - private VLSInequality() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSInequality instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSInequality.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSInequality.Matcher.on(engine); - } - - @Override - public VLSInequality.Matcher instantiate() { - return VLSInequality.Matcher.create(); - } - - @Override - public VLSInequality.Match newEmptyMatch() { - return VLSInequality.Match.newEmptyMatch(); - } - - @Override - public VLSInequality.Match newMatch(final Object... parameters) { - return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality (visibility: PUBLIC, simpleName: VLSInequality, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality (visibility: PUBLIC, simpleName: VLSInequality, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSInequality INSTANCE = new VLSInequality(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSInequality.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSInequality")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSInequality"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSInequality(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSInequality"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSOr.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSOr.java deleted file mode 100644 index 0d8e0648..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSOr.java +++ /dev/null @@ -1,535 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         //VLSFormula
- *         pattern VLSOr(term: VLSOr){
- *         	VLSOr(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSOr extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr"; - } - - @Override - public List parameterNames() { - return VLSOr.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSOr.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSOr.Match)) { - VLSOr.Match other = (VLSOr.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSOr specification() { - return VLSOr.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 VLSOr.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSOr.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSOr.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSOr.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSOr.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr 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: - *

-   * //VLSFormula
-   * pattern VLSOr(term: VLSOr){
-   * 	VLSOr(term);
-   * }
-   * 
- * - * @see Match - * @see VLSOr - * - */ - 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 VLSOr.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 VLSOr.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSOr.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSOr.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) { - return VLSOr.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSOr.Match tupleToMatch(final Tuple t) { - try { - return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSOr.Match arrayToMatch(final Object[] match) { - try { - return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSOr.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSOr.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) match[POSITION_TERM]); - } 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 VLSOr.instance(); - } - } - - private VLSOr() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSOr instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSOr.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSOr.Matcher.on(engine); - } - - @Override - public VLSOr.Matcher instantiate() { - return VLSOr.Matcher.create(); - } - - @Override - public VLSOr.Match newEmptyMatch() { - return VLSOr.Match.newEmptyMatch(); - } - - @Override - public VLSOr.Match newMatch(final Object... parameters) { - return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr (visibility: PUBLIC, simpleName: VLSOr, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr (visibility: PUBLIC, simpleName: VLSOr, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSOr INSTANCE = new VLSOr(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSOr.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSOr")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSOr"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSOr(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSOr"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUnaryNegation.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUnaryNegation.java deleted file mode 100644 index b6290aab..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUnaryNegation.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSUnaryNegation(term: VLSUnaryNegation){
- *         	VLSUnaryNegation(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSUnaryNegation extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation"; - } - - @Override - public List parameterNames() { - return VLSUnaryNegation.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSUnaryNegation.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSUnaryNegation.Match)) { - VLSUnaryNegation.Match other = (VLSUnaryNegation.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSUnaryNegation specification() { - return VLSUnaryNegation.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 VLSUnaryNegation.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSUnaryNegation.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSUnaryNegation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSUnaryNegation.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSUnaryNegation.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSUnaryNegation(term: VLSUnaryNegation){
-   * 	VLSUnaryNegation(term);
-   * }
-   * 
- * - * @see Match - * @see VLSUnaryNegation - * - */ - 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 VLSUnaryNegation.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 VLSUnaryNegation.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSUnaryNegation.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSUnaryNegation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) { - return VLSUnaryNegation.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSUnaryNegation.Match tupleToMatch(final Tuple t) { - try { - return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSUnaryNegation.Match arrayToMatch(final Object[] match) { - try { - return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSUnaryNegation.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSUnaryNegation.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) match[POSITION_TERM]); - } 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 VLSUnaryNegation.instance(); - } - } - - private VLSUnaryNegation() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSUnaryNegation instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSUnaryNegation.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSUnaryNegation.Matcher.on(engine); - } - - @Override - public VLSUnaryNegation.Matcher instantiate() { - return VLSUnaryNegation.Matcher.create(); - } - - @Override - public VLSUnaryNegation.Match newEmptyMatch() { - return VLSUnaryNegation.Match.newEmptyMatch(); - } - - @Override - public VLSUnaryNegation.Match newMatch(final Object... parameters) { - return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation (visibility: PUBLIC, simpleName: VLSUnaryNegation, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation (visibility: PUBLIC, simpleName: VLSUnaryNegation, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSUnaryNegation INSTANCE = new VLSUnaryNegation(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSUnaryNegation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUnaryNegation")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUnaryNegation"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSUnaryNegation(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUnaryNegation"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUniversalQuantifier.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUniversalQuantifier.java deleted file mode 100644 index 0dab9771..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VLSUniversalQuantifier.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         pattern VLSUniversalQuantifier(term: VLSUniversalQuantifier){
- *         	VLSUniversalQuantifier(term);
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class VLSUniversalQuantifier extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier fTerm; - - private static List parameterNames = makeImmutableList("term"); - - private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - this.fTerm = pTerm; - } - - @Override - public Object get(final String parameterName) { - if ("term".equals(parameterName)) return this.fTerm; - return null; - } - - public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier getTerm() { - return this.fTerm; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("term".equals(parameterName) ) { - this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) newValue; - return true; - } - return false; - } - - public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fTerm = pTerm; - } - - @Override - public String patternName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier"; - } - - @Override - public List parameterNames() { - return VLSUniversalQuantifier.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fTerm}; - } - - @Override - public VLSUniversalQuantifier.Match toImmutable() { - return isMutable() ? newMatch(fTerm) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"term\"=" + prettyPrintValue(fTerm)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fTerm); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof VLSUniversalQuantifier.Match)) { - VLSUniversalQuantifier.Match other = (VLSUniversalQuantifier.Match) obj; - return Objects.equals(fTerm, other.fTerm); - } 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 VLSUniversalQuantifier specification() { - return VLSUniversalQuantifier.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 VLSUniversalQuantifier.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static VLSUniversalQuantifier.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return new Mutable(pTerm); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public static VLSUniversalQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return new Immutable(pTerm); - } - - private static final class Mutable extends VLSUniversalQuantifier.Match { - Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends VLSUniversalQuantifier.Match { - Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - super(pTerm); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * pattern VLSUniversalQuantifier(term: VLSUniversalQuantifier){
-   * 	VLSUniversalQuantifier(term);
-   * }
-   * 
- * - * @see Match - * @see VLSUniversalQuantifier - * - */ - 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 VLSUniversalQuantifier.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 VLSUniversalQuantifier.Matcher create() { - return new Matcher(); - } - - private final static int POSITION_TERM = 0; - - private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSUniversalQuantifier.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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}).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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return rawStreamAllMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return rawGetOneArbitraryMatch(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return rawHasMatch(new Object[]{pTerm}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return rawCountMatches(new Object[]{pTerm}); - } - - /** - * 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 pTerm the fixed value of pattern parameter term, 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 ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pTerm}, 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 pTerm the fixed value of pattern parameter term, or null if not bound. - * @return the (partial) match object. - * - */ - public VLSUniversalQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) { - return VLSUniversalQuantifier.Match.newMatch(pTerm); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfterm(final Object[] parameters) { - return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for term. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfterm() { - return rawStreamAllValuesOfterm(emptyArray()); - } - - @Override - protected VLSUniversalQuantifier.Match tupleToMatch(final Tuple t) { - try { - return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) t.get(POSITION_TERM)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected VLSUniversalQuantifier.Match arrayToMatch(final Object[] match) { - try { - return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) match[POSITION_TERM]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected VLSUniversalQuantifier.Match arrayToMatchMutable(final Object[] match) { - try { - return VLSUniversalQuantifier.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) match[POSITION_TERM]); - } 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 VLSUniversalQuantifier.instance(); - } - } - - private VLSUniversalQuantifier() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static VLSUniversalQuantifier instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected VLSUniversalQuantifier.Matcher instantiate(final ViatraQueryEngine engine) { - return VLSUniversalQuantifier.Matcher.on(engine); - } - - @Override - public VLSUniversalQuantifier.Matcher instantiate() { - return VLSUniversalQuantifier.Matcher.create(); - } - - @Override - public VLSUniversalQuantifier.Match newEmptyMatch() { - return VLSUniversalQuantifier.Match.newEmptyMatch(); - } - - @Override - public VLSUniversalQuantifier.Match newMatch(final Object... parameters) { - return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier (visibility: PUBLIC, simpleName: VLSUniversalQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.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: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier (visibility: PUBLIC, simpleName: VLSUniversalQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier, deprecated: ) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private final static VLSUniversalQuantifier INSTANCE = new VLSUniversalQuantifier(); - - /** - * 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 final static Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private final static VLSUniversalQuantifier.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_term = new PParameter("term", "ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUniversalQuantifier")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_term); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("term"); - } - - @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_term = body.getOrCreateVariableByName("term"); - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUniversalQuantifier"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_term, parameter_term) - )); - // VLSUniversalQuantifier(term) - new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUniversalQuantifier"))); - bodies.add(body); - } - return bodies; - } - } -} diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VampireQueries.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VampireQueries.java deleted file mode 100644 index e3518cd6..00000000 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.queries/src-gen/ca/mcgill/ecse/dslreasoner/vampire/queries/VampireQueries.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.queries/src/ca/mcgill/ecse/dslreasoner/vampire/queries/vampireQueries.vql - */ -package ca.mcgill.ecse.dslreasoner.vampire.queries; - -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnd; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSAnnotation; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSComment; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSEquivalent; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSExistentialQuantifier; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFofFormula; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunction; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSFunctionFof; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSInequality; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSOr; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUnaryNegation; -import ca.mcgill.ecse.dslreasoner.vampire.queries.VLSUniversalQuantifier; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; - -/** - * A pattern group formed of all public patterns defined in vampireQueries.vql. - * - *

Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare - * a VIATRA Query engine for matching all patterns originally defined in file vampireQueries.vql, - * in order to achieve better performance than one-by-one on-demand matcher initialization. - * - *

From package ca.mcgill.ecse.dslreasoner.vampire.queries, the group contains the definition of the following patterns:

    - *
  • VLSComment
  • - *
  • VLSFofFormula
  • - *
  • VLSAnnotation
  • - *
  • VLSOr
  • - *
  • VLSAnd
  • - *
  • VLSEquivalent
  • - *
  • VLSFunction
  • - *
  • VLSExistentialQuantifier
  • - *
  • VLSUniversalQuantifier
  • - *
  • VLSUnaryNegation
  • - *
  • VLSInequality
  • - *
  • VLSFunctionFof
  • - *
- * - * @see IQueryGroup - * - */ -@SuppressWarnings("all") -public final class VampireQueries extends BaseGeneratedPatternGroup { - /** - * Access the pattern group. - * - * @return the singleton instance of the group - * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications - * - */ - public static VampireQueries instance() { - if (INSTANCE == null) { - INSTANCE = new VampireQueries(); - } - return INSTANCE; - } - - private static VampireQueries INSTANCE; - - private VampireQueries() { - querySpecifications.add(VLSComment.instance()); - querySpecifications.add(VLSFofFormula.instance()); - querySpecifications.add(VLSAnnotation.instance()); - querySpecifications.add(VLSOr.instance()); - querySpecifications.add(VLSAnd.instance()); - querySpecifications.add(VLSEquivalent.instance()); - querySpecifications.add(VLSFunction.instance()); - querySpecifications.add(VLSExistentialQuantifier.instance()); - querySpecifications.add(VLSUniversalQuantifier.instance()); - querySpecifications.add(VLSUnaryNegation.instance()); - querySpecifications.add(VLSInequality.instance()); - querySpecifications.add(VLSFunctionFof.instance()); - } - - public VLSComment getVLSComment() { - return VLSComment.instance(); - } - - public VLSComment.Matcher getVLSComment(final ViatraQueryEngine engine) { - return VLSComment.Matcher.on(engine); - } - - public VLSFofFormula getVLSFofFormula() { - return VLSFofFormula.instance(); - } - - public VLSFofFormula.Matcher getVLSFofFormula(final ViatraQueryEngine engine) { - return VLSFofFormula.Matcher.on(engine); - } - - public VLSAnnotation getVLSAnnotation() { - return VLSAnnotation.instance(); - } - - public VLSAnnotation.Matcher getVLSAnnotation(final ViatraQueryEngine engine) { - return VLSAnnotation.Matcher.on(engine); - } - - public VLSOr getVLSOr() { - return VLSOr.instance(); - } - - public VLSOr.Matcher getVLSOr(final ViatraQueryEngine engine) { - return VLSOr.Matcher.on(engine); - } - - public VLSAnd getVLSAnd() { - return VLSAnd.instance(); - } - - public VLSAnd.Matcher getVLSAnd(final ViatraQueryEngine engine) { - return VLSAnd.Matcher.on(engine); - } - - public VLSEquivalent getVLSEquivalent() { - return VLSEquivalent.instance(); - } - - public VLSEquivalent.Matcher getVLSEquivalent(final ViatraQueryEngine engine) { - return VLSEquivalent.Matcher.on(engine); - } - - public VLSFunction getVLSFunction() { - return VLSFunction.instance(); - } - - public VLSFunction.Matcher getVLSFunction(final ViatraQueryEngine engine) { - return VLSFunction.Matcher.on(engine); - } - - public VLSExistentialQuantifier getVLSExistentialQuantifier() { - return VLSExistentialQuantifier.instance(); - } - - public VLSExistentialQuantifier.Matcher getVLSExistentialQuantifier(final ViatraQueryEngine engine) { - return VLSExistentialQuantifier.Matcher.on(engine); - } - - public VLSUniversalQuantifier getVLSUniversalQuantifier() { - return VLSUniversalQuantifier.instance(); - } - - public VLSUniversalQuantifier.Matcher getVLSUniversalQuantifier(final ViatraQueryEngine engine) { - return VLSUniversalQuantifier.Matcher.on(engine); - } - - public VLSUnaryNegation getVLSUnaryNegation() { - return VLSUnaryNegation.instance(); - } - - public VLSUnaryNegation.Matcher getVLSUnaryNegation(final ViatraQueryEngine engine) { - return VLSUnaryNegation.Matcher.on(engine); - } - - public VLSInequality getVLSInequality() { - return VLSInequality.instance(); - } - - public VLSInequality.Matcher getVLSInequality(final ViatraQueryEngine engine) { - return VLSInequality.Matcher.on(engine); - } - - public VLSFunctionFof getVLSFunctionFof() { - return VLSFunctionFof.instance(); - } - - public VLSFunctionFof.Matcher getVLSFunctionFof(final ViatraQueryEngine engine) { - return VLSFunctionFof.Matcher.on(engine); - } -} -- cgit v1.2.3-70-g09d2