aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner
diff options
context:
space:
mode:
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner')
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/.classpath1
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/META-INF/MANIFEST.MF34
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/plugin.xml18
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql57
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/.gitignore13
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnd.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnnotation.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSComment.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSEquivalent.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSExistentialQuantifier.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFofFormula.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunction.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunctionFof.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSInequality.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSOr.java535
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUnaryNegation.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUniversalQuantifier.java533
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VampireQueries.java174
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.xtend56
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.xtend2
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtend2
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.xtend66
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.xtend214
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireAnalyzerConfiguration.xtendbinbin2685 -> 2685 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireSolver.xtendbinbin5463 -> 5502 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.gitignore6
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java46
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper.xtendbinbin17670 -> 17671 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapperTrace.xtendbinbin3140 -> 3140 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_ConstantMapper.xtendbinbin3164 -> 3164 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_RelationMapper.xtendbinbin8247 -> 8247 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_Support.xtendbinbin9398 -> 9398 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper.xtendbinbin3224 -> 3224 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbinbin2742 -> 2742 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbinbin9279 -> 9279 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Vampire2LogicMapper.xtendbinbin0 -> 7552 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireHandler.xtendbinbin0 -> 4907 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation.xtendbinbin1490 -> 1490 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbinbin1691 -> 1691 bytes
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.gitignore28
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java2
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.java59
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.java12
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolutionModel.java35
-rw-r--r--Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolverException.java19
45 files changed, 7171 insertions, 71 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/.classpath b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/.classpath
index a1e0140b..2a126610 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/.classpath
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/.classpath
@@ -5,5 +5,6 @@
5 <classpathentry kind="src" path="src"/> 5 <classpathentry kind="src" path="src"/>
6 <classpathentry kind="src" path="xtend-gen"/> 6 <classpathentry kind="src" path="xtend-gen"/>
7 <classpathentry kind="src" path="queries"/> 7 <classpathentry kind="src" path="queries"/>
8 <classpathentry kind="src" path="src-gen"/>
8 <classpathentry kind="output" path="bin"/> 9 <classpathentry kind="output" path="bin"/>
9</classpath> 10</classpath>
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/META-INF/MANIFEST.MF b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/META-INF/MANIFEST.MF
index 2eb4f151..63d39592 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/META-INF/MANIFEST.MF
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/META-INF/MANIFEST.MF
@@ -1,17 +1,17 @@
1Manifest-Version: 1.0 1Manifest-Version: 1.0
2Bundle-ManifestVersion: 2 2Bundle-ManifestVersion: 2
3Bundle-Name: Reasoner 3Bundle-Name: Reasoner
4Bundle-SymbolicName: ca.mcgill.ecse.dslreasoner.vampire.reasoner;singleton:=true 4Bundle-SymbolicName: ca.mcgill.ecse.dslreasoner.vampire.reasoner;singleton:=true
5Bundle-Version: 1.0.0.qualifier 5Bundle-Version: 1.0.0.qualifier
6Automatic-Module-Name: ca.mcgill.ecse.dslreasoner.vampire.reasoner 6Export-Package: ca.mcgill.ecse.dslreasoner.vampire.reasoner,
7Bundle-RequiredExecutionEnvironment: JavaSE-1.8 7 ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder,
8Require-Bundle: org.eclipse.xtend.lib, 8 ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries
9 hu.bme.mit.inf.dslreasoner.logic.model;bundle-version="1.0.0", 9Require-Bundle: org.eclipse.xtend.lib,
10 hu.bme.mit.inf.dslreasoner.ecore2logic;bundle-version="1.0.0", 10 hu.bme.mit.inf.dslreasoner.logic.model;bundle-version="1.0.0",
11 ca.mcgill.ecse.dslreasoner.vampire.language;bundle-version="1.0.0", 11 hu.bme.mit.inf.dslreasoner.ecore2logic;bundle-version="1.0.0",
12 org.eclipse.viatra.query.runtime;bundle-version="2.1.0", 12 ca.mcgill.ecse.dslreasoner.vampire.language;bundle-version="1.0.0",
13 org.eclipse.viatra.query.runtime.base.itc;bundle-version="2.1.0" 13 org.eclipse.viatra.query.runtime;bundle-version="2.1.0",
14Export-Package: ca.mcgill.ecse.dslreasoner.vampire.reasoner, 14 org.eclipse.viatra.query.runtime.base.itc;bundle-version="2.1.0",
15 ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder 15 org.apache.log4j;bundle-version="1.2.15"
16 16Automatic-Module-Name: ca.mcgill.ecse.dslreasoner.vampire.reasoner
17 17Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/plugin.xml b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/plugin.xml
new file mode 100644
index 00000000..b2d1db97
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/plugin.xml
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="UTF-8"?><plugin>
2 <extension id="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VampireQueries" point="org.eclipse.viatra.query.runtime.queryspecification">
3 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VampireQueries" id="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VampireQueries">
4 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment"/>
5 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula"/>
6 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation"/>
7 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr"/>
8 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd"/>
9 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent"/>
10 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction"/>
11 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier"/>
12 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier"/>
13 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation"/>
14 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality"/>
15 <query-specification fqn="ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof"/>
16 </group>
17 </extension>
18</plugin>
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
new file mode 100644
index 00000000..2db380e4
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
@@ -0,0 +1,57 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries
2
3import "http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage"
4
5pattern VLSComment(term: VLSComment){
6 VLSComment(term);
7}
8
9pattern VLSFofFormula(term: VLSFofFormula){
10 VLSFofFormula(term);
11}
12
13pattern VLSAnnotation(term: VLSAnnotation){
14 VLSAnnotation(term);
15}
16
17
18//VLSFormula
19pattern VLSOr(term: VLSOr){
20 VLSOr(term);
21}
22
23pattern VLSAnd(term: VLSAnd){
24 VLSAnd(term);
25}
26
27pattern VLSEquivalent(term: VLSEquivalent){
28 VLSEquivalent(term);
29}
30
31pattern VLSFunction(term: VLSFunction){
32 VLSFunction(term);
33}
34
35pattern VLSExistentialQuantifier(term: VLSExistentialQuantifier){
36 VLSExistentialQuantifier(term);
37}
38
39pattern VLSUniversalQuantifier(term: VLSUniversalQuantifier){
40 VLSUniversalQuantifier(term);
41}
42
43pattern VLSUnaryNegation(term: VLSUnaryNegation){
44 VLSUnaryNegation(term);
45}
46
47pattern VLSInequality(term: VLSInequality){
48 VLSInequality(term);
49}
50
51pattern VLSFunctionFof(term: VLSFunctionFof){
52 VLSFunctionFof(term);
53}
54
55//pattern VLSFofTerm(term: VLSFofTerm){
56// VLSFofTerm(term);
57//} \ No newline at end of file
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/.gitignore b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/.gitignore
new file mode 100644
index 00000000..f30ede2c
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/.gitignore
@@ -0,0 +1,13 @@
1/.VLSComment.java._trace
2/.VLSAnd.java._trace
3/.VLSAnnotation.java._trace
4/.VLSEquivalent.java._trace
5/.VLSExistentialQuantifier.java._trace
6/.VLSFofFormula.java._trace
7/.VLSFunction.java._trace
8/.VLSFunctionFof.java._trace
9/.VLSInequality.java._trace
10/.VLSOr.java._trace
11/.VLSUnaryNegation.java._trace
12/.VLSUniversalQuantifier.java._trace
13/.VampireQueries.java._trace
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnd.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnd.java
new file mode 100644
index 00000000..68bebb93
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnd.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSAnd(term: VLSAnd){
44 * VLSAnd(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSAnd extends BaseGeneratedEMFQuerySpecification<VLSAnd.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSAnd.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSAnd.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSAnd.Match)) {
140 VLSAnd.Match other = (VLSAnd.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSAnd specification() {
154 return VLSAnd.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSAnd.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSAnd.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSAnd.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSAnd.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSAnd.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSAnd(term: VLSAnd){
227 * VLSAnd(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSAnd
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSAnd.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSAnd.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSAnd.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSAnd.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSAnd.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSAnd.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSAnd.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm, final Consumer<? super VLSAnd.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSAnd.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd pTerm) {
356 return VLSAnd.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSAnd.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSAnd.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSAnd.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSAnd.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSAnd.Matcher> querySpecification() {
422 return VLSAnd.instance();
423 }
424 }
425
426 private VLSAnd() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSAnd instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSAnd.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSAnd.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSAnd.Matcher instantiate() {
450 return VLSAnd.Matcher.create();
451 }
452
453 @Override
454 public VLSAnd.Match newEmptyMatch() {
455 return VLSAnd.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSAnd.Match newMatch(final Object... parameters) {
460 return VLSAnd.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnd) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd (visibility: PUBLIC, simpleName: VLSAnd, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd (visibility: PUBLIC, simpleName: VLSAnd, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSAnd INSTANCE = new VLSAnd();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSAnd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnd")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSAnd(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnd")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnnotation.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnnotation.java
new file mode 100644
index 00000000..c7d691f9
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSAnnotation.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSAnnotation(term: VLSAnnotation){
44 * VLSAnnotation(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSAnnotation extends BaseGeneratedEMFQuerySpecification<VLSAnnotation.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSAnnotation.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSAnnotation.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSAnnotation.Match)) {
140 VLSAnnotation.Match other = (VLSAnnotation.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSAnnotation specification() {
154 return VLSAnnotation.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSAnnotation.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSAnnotation.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSAnnotation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSAnnotation.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSAnnotation.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSAnnotation(term: VLSAnnotation){
227 * VLSAnnotation(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSAnnotation
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSAnnotation.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSAnnotation.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSAnnotation.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSAnnotation.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSAnnotation.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSAnnotation.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSAnnotation.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm, final Consumer<? super VLSAnnotation.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSAnnotation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation pTerm) {
356 return VLSAnnotation.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSAnnotation.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSAnnotation.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSAnnotation.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSAnnotation.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSAnnotation.Matcher> querySpecification() {
422 return VLSAnnotation.instance();
423 }
424 }
425
426 private VLSAnnotation() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSAnnotation instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSAnnotation.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSAnnotation.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSAnnotation.Matcher instantiate() {
450 return VLSAnnotation.Matcher.create();
451 }
452
453 @Override
454 public VLSAnnotation.Match newEmptyMatch() {
455 return VLSAnnotation.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSAnnotation.Match newMatch(final Object... parameters) {
460 return VLSAnnotation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSAnnotation) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation (visibility: PUBLIC, simpleName: VLSAnnotation, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation (visibility: PUBLIC, simpleName: VLSAnnotation, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSAnnotation INSTANCE = new VLSAnnotation();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSAnnotation.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnnotation")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSAnnotation(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSAnnotation")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSComment.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSComment.java
new file mode 100644
index 00000000..534f0b0b
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSComment.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSComment(term: VLSComment){
44 * VLSComment(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSComment extends BaseGeneratedEMFQuerySpecification<VLSComment.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSComment.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSComment.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSComment.Match)) {
140 VLSComment.Match other = (VLSComment.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSComment specification() {
154 return VLSComment.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSComment.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSComment.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSComment.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSComment.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSComment.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSComment(term: VLSComment){
227 * VLSComment(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSComment
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSComment.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSComment.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSComment.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSComment.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSComment.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSComment.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSComment.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm, final Consumer<? super VLSComment.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSComment.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment pTerm) {
356 return VLSComment.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSComment.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSComment.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSComment.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSComment.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSComment.Matcher> querySpecification() {
422 return VLSComment.instance();
423 }
424 }
425
426 private VLSComment() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSComment instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSComment.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSComment.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSComment.Matcher instantiate() {
450 return VLSComment.Matcher.create();
451 }
452
453 @Override
454 public VLSComment.Match newEmptyMatch() {
455 return VLSComment.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSComment.Match newMatch(final Object... parameters) {
460 return VLSComment.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment (visibility: PUBLIC, simpleName: VLSComment, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment (visibility: PUBLIC, simpleName: VLSComment, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSComment INSTANCE = new VLSComment();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSComment.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSComment")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSComment(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSComment")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSEquivalent.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSEquivalent.java
new file mode 100644
index 00000000..e8e1475f
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSEquivalent.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSEquivalent(term: VLSEquivalent){
44 * VLSEquivalent(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSEquivalent extends BaseGeneratedEMFQuerySpecification<VLSEquivalent.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSEquivalent.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSEquivalent.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSEquivalent.Match)) {
140 VLSEquivalent.Match other = (VLSEquivalent.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSEquivalent specification() {
154 return VLSEquivalent.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSEquivalent.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSEquivalent.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSEquivalent.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSEquivalent.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSEquivalent.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSEquivalent(term: VLSEquivalent){
227 * VLSEquivalent(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSEquivalent
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSEquivalent.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSEquivalent.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSEquivalent.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSEquivalent.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSEquivalent.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSEquivalent.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSEquivalent.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm, final Consumer<? super VLSEquivalent.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSEquivalent.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent pTerm) {
356 return VLSEquivalent.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSEquivalent.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSEquivalent.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSEquivalent.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSEquivalent.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSEquivalent.Matcher> querySpecification() {
422 return VLSEquivalent.instance();
423 }
424 }
425
426 private VLSEquivalent() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSEquivalent instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSEquivalent.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSEquivalent.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSEquivalent.Matcher instantiate() {
450 return VLSEquivalent.Matcher.create();
451 }
452
453 @Override
454 public VLSEquivalent.Match newEmptyMatch() {
455 return VLSEquivalent.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSEquivalent.Match newMatch(final Object... parameters) {
460 return VLSEquivalent.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSEquivalent) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent (visibility: PUBLIC, simpleName: VLSEquivalent, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent (visibility: PUBLIC, simpleName: VLSEquivalent, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSEquivalent INSTANCE = new VLSEquivalent();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSEquivalent.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSEquivalent")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSEquivalent(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSEquivalent")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSExistentialQuantifier.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSExistentialQuantifier.java
new file mode 100644
index 00000000..1d9c93b1
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSExistentialQuantifier.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSExistentialQuantifier(term: VLSExistentialQuantifier){
44 * VLSExistentialQuantifier(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSExistentialQuantifier extends BaseGeneratedEMFQuerySpecification<VLSExistentialQuantifier.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSExistentialQuantifier.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSExistentialQuantifier.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSExistentialQuantifier.Match)) {
140 VLSExistentialQuantifier.Match other = (VLSExistentialQuantifier.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSExistentialQuantifier specification() {
154 return VLSExistentialQuantifier.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSExistentialQuantifier.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSExistentialQuantifier.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSExistentialQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSExistentialQuantifier.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSExistentialQuantifier.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSExistentialQuantifier(term: VLSExistentialQuantifier){
227 * VLSExistentialQuantifier(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSExistentialQuantifier
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSExistentialQuantifier.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSExistentialQuantifier.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSExistentialQuantifier.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSExistentialQuantifier.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSExistentialQuantifier.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSExistentialQuantifier.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSExistentialQuantifier.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm, final Consumer<? super VLSExistentialQuantifier.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSExistentialQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier pTerm) {
356 return VLSExistentialQuantifier.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSExistentialQuantifier.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSExistentialQuantifier.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSExistentialQuantifier.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSExistentialQuantifier.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSExistentialQuantifier.Matcher> querySpecification() {
422 return VLSExistentialQuantifier.instance();
423 }
424 }
425
426 private VLSExistentialQuantifier() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSExistentialQuantifier instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSExistentialQuantifier.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSExistentialQuantifier.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSExistentialQuantifier.Matcher instantiate() {
450 return VLSExistentialQuantifier.Matcher.create();
451 }
452
453 @Override
454 public VLSExistentialQuantifier.Match newEmptyMatch() {
455 return VLSExistentialQuantifier.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSExistentialQuantifier.Match newMatch(final Object... parameters) {
460 return VLSExistentialQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSExistentialQuantifier) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier (visibility: PUBLIC, simpleName: VLSExistentialQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier (visibility: PUBLIC, simpleName: VLSExistentialQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSExistentialQuantifier INSTANCE = new VLSExistentialQuantifier();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSExistentialQuantifier.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSExistentialQuantifier")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSExistentialQuantifier(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSExistentialQuantifier")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFofFormula.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFofFormula.java
new file mode 100644
index 00000000..e35ffaa2
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFofFormula.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSFofFormula(term: VLSFofFormula){
44 * VLSFofFormula(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSFofFormula extends BaseGeneratedEMFQuerySpecification<VLSFofFormula.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSFofFormula.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSFofFormula.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSFofFormula.Match)) {
140 VLSFofFormula.Match other = (VLSFofFormula.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSFofFormula specification() {
154 return VLSFofFormula.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSFofFormula.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSFofFormula.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSFofFormula.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSFofFormula.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSFofFormula.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSFofFormula(term: VLSFofFormula){
227 * VLSFofFormula(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSFofFormula
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSFofFormula.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSFofFormula.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSFofFormula.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFofFormula.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSFofFormula.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSFofFormula.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSFofFormula.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm, final Consumer<? super VLSFofFormula.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSFofFormula.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula pTerm) {
356 return VLSFofFormula.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSFofFormula.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSFofFormula.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSFofFormula.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSFofFormula.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSFofFormula.Matcher> querySpecification() {
422 return VLSFofFormula.instance();
423 }
424 }
425
426 private VLSFofFormula() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSFofFormula instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSFofFormula.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSFofFormula.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSFofFormula.Matcher instantiate() {
450 return VLSFofFormula.Matcher.create();
451 }
452
453 @Override
454 public VLSFofFormula.Match newEmptyMatch() {
455 return VLSFofFormula.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSFofFormula.Match newMatch(final Object... parameters) {
460 return VLSFofFormula.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula (visibility: PUBLIC, simpleName: VLSFofFormula, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula (visibility: PUBLIC, simpleName: VLSFofFormula, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSFofFormula INSTANCE = new VLSFofFormula();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSFofFormula.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFofFormula")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSFofFormula(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFofFormula")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunction.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunction.java
new file mode 100644
index 00000000..47097005
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunction.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSFunction(term: VLSFunction){
44 * VLSFunction(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSFunction extends BaseGeneratedEMFQuerySpecification<VLSFunction.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSFunction.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSFunction.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSFunction.Match)) {
140 VLSFunction.Match other = (VLSFunction.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSFunction specification() {
154 return VLSFunction.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSFunction.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSFunction.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSFunction.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSFunction.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSFunction.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSFunction(term: VLSFunction){
227 * VLSFunction(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSFunction
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSFunction.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSFunction.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSFunction.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFunction.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSFunction.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSFunction.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSFunction.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm, final Consumer<? super VLSFunction.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSFunction.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction pTerm) {
356 return VLSFunction.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSFunction.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSFunction.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSFunction.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSFunction.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSFunction.Matcher> querySpecification() {
422 return VLSFunction.instance();
423 }
424 }
425
426 private VLSFunction() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSFunction instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSFunction.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSFunction.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSFunction.Matcher instantiate() {
450 return VLSFunction.Matcher.create();
451 }
452
453 @Override
454 public VLSFunction.Match newEmptyMatch() {
455 return VLSFunction.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSFunction.Match newMatch(final Object... parameters) {
460 return VLSFunction.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunction) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction (visibility: PUBLIC, simpleName: VLSFunction, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction (visibility: PUBLIC, simpleName: VLSFunction, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSFunction INSTANCE = new VLSFunction();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSFunction.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunction")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSFunction(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunction")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunctionFof.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunctionFof.java
new file mode 100644
index 00000000..5a88b0b4
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSFunctionFof.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSFunctionFof(term: VLSFunctionFof){
44 * VLSFunctionFof(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSFunctionFof extends BaseGeneratedEMFQuerySpecification<VLSFunctionFof.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSFunctionFof.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSFunctionFof.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSFunctionFof.Match)) {
140 VLSFunctionFof.Match other = (VLSFunctionFof.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSFunctionFof specification() {
154 return VLSFunctionFof.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSFunctionFof.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSFunctionFof.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSFunctionFof.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSFunctionFof.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSFunctionFof.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSFunctionFof(term: VLSFunctionFof){
227 * VLSFunctionFof(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSFunctionFof
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSFunctionFof.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSFunctionFof.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSFunctionFof.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSFunctionFof.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSFunctionFof.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSFunctionFof.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSFunctionFof.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm, final Consumer<? super VLSFunctionFof.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSFunctionFof.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof pTerm) {
356 return VLSFunctionFof.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSFunctionFof.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSFunctionFof.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSFunctionFof.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSFunctionFof.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSFunctionFof.Matcher> querySpecification() {
422 return VLSFunctionFof.instance();
423 }
424 }
425
426 private VLSFunctionFof() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSFunctionFof instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSFunctionFof.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSFunctionFof.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSFunctionFof.Matcher instantiate() {
450 return VLSFunctionFof.Matcher.create();
451 }
452
453 @Override
454 public VLSFunctionFof.Match newEmptyMatch() {
455 return VLSFunctionFof.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSFunctionFof.Match newMatch(final Object... parameters) {
460 return VLSFunctionFof.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFunctionFof) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof (visibility: PUBLIC, simpleName: VLSFunctionFof, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof (visibility: PUBLIC, simpleName: VLSFunctionFof, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSFunctionFof INSTANCE = new VLSFunctionFof();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSFunctionFof.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunctionFof")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSFunctionFof(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSFunctionFof")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSInequality.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSInequality.java
new file mode 100644
index 00000000..71c4bc61
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSInequality.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSInequality(term: VLSInequality){
44 * VLSInequality(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSInequality extends BaseGeneratedEMFQuerySpecification<VLSInequality.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSInequality.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSInequality.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSInequality.Match)) {
140 VLSInequality.Match other = (VLSInequality.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSInequality specification() {
154 return VLSInequality.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSInequality.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSInequality.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSInequality.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSInequality.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSInequality.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSInequality(term: VLSInequality){
227 * VLSInequality(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSInequality
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSInequality.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSInequality.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSInequality.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSInequality.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSInequality.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSInequality.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSInequality.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm, final Consumer<? super VLSInequality.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSInequality.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality pTerm) {
356 return VLSInequality.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSInequality.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSInequality.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSInequality.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSInequality.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSInequality.Matcher> querySpecification() {
422 return VLSInequality.instance();
423 }
424 }
425
426 private VLSInequality() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSInequality instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSInequality.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSInequality.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSInequality.Matcher instantiate() {
450 return VLSInequality.Matcher.create();
451 }
452
453 @Override
454 public VLSInequality.Match newEmptyMatch() {
455 return VLSInequality.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSInequality.Match newMatch(final Object... parameters) {
460 return VLSInequality.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSInequality) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality (visibility: PUBLIC, simpleName: VLSInequality, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality (visibility: PUBLIC, simpleName: VLSInequality, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSInequality INSTANCE = new VLSInequality();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSInequality.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSInequality")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSInequality(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSInequality")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSOr.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSOr.java
new file mode 100644
index 00000000..fcbbd7cc
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSOr.java
@@ -0,0 +1,535 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * //VLSFormula
44 * pattern VLSOr(term: VLSOr){
45 * VLSOr(term);
46 * }
47 * </pre></code>
48 *
49 * @see Matcher
50 * @see Match
51 *
52 */
53@SuppressWarnings("all")
54public final class VLSOr extends BaseGeneratedEMFQuerySpecification<VLSOr.Matcher> {
55 /**
56 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr pattern,
57 * to be used in conjunction with {@link Matcher}.
58 *
59 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
60 * Each instance is a (possibly partial) substitution of pattern parameters,
61 * usable to represent a match of the pattern in the result of a query,
62 * or to specify the bound (fixed) input parameters when issuing a query.
63 *
64 * @see Matcher
65 *
66 */
67 public static abstract class Match extends BasePatternMatch {
68 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr fTerm;
69
70 private static List<String> parameterNames = makeImmutableList("term");
71
72 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
73 this.fTerm = pTerm;
74 }
75
76 @Override
77 public Object get(final String parameterName) {
78 if ("term".equals(parameterName)) return this.fTerm;
79 return null;
80 }
81
82 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr getTerm() {
83 return this.fTerm;
84 }
85
86 @Override
87 public boolean set(final String parameterName, final Object newValue) {
88 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
89 if ("term".equals(parameterName) ) {
90 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) newValue;
91 return true;
92 }
93 return false;
94 }
95
96 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
97 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
98 this.fTerm = pTerm;
99 }
100
101 @Override
102 public String patternName() {
103 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr";
104 }
105
106 @Override
107 public List<String> parameterNames() {
108 return VLSOr.Match.parameterNames;
109 }
110
111 @Override
112 public Object[] toArray() {
113 return new Object[]{fTerm};
114 }
115
116 @Override
117 public VLSOr.Match toImmutable() {
118 return isMutable() ? newMatch(fTerm) : this;
119 }
120
121 @Override
122 public String prettyPrint() {
123 StringBuilder result = new StringBuilder();
124 result.append("\"term\"=" + prettyPrintValue(fTerm));
125 return result.toString();
126 }
127
128 @Override
129 public int hashCode() {
130 return Objects.hash(fTerm);
131 }
132
133 @Override
134 public boolean equals(final Object obj) {
135 if (this == obj)
136 return true;
137 if (obj == null) {
138 return false;
139 }
140 if ((obj instanceof VLSOr.Match)) {
141 VLSOr.Match other = (VLSOr.Match) obj;
142 return Objects.equals(fTerm, other.fTerm);
143 } else {
144 // this should be infrequent
145 if (!(obj instanceof IPatternMatch)) {
146 return false;
147 }
148 IPatternMatch otherSig = (IPatternMatch) obj;
149 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
150 }
151 }
152
153 @Override
154 public VLSOr specification() {
155 return VLSOr.instance();
156 }
157
158 /**
159 * Returns an empty, mutable match.
160 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
161 *
162 * @return the empty match.
163 *
164 */
165 public static VLSOr.Match newEmptyMatch() {
166 return new Mutable(null);
167 }
168
169 /**
170 * Returns a mutable (partial) match.
171 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
172 *
173 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
174 * @return the new, mutable (partial) match object.
175 *
176 */
177 public static VLSOr.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
178 return new Mutable(pTerm);
179 }
180
181 /**
182 * Returns a new (partial) match.
183 * This can be used e.g. to call the matcher with a partial match.
184 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
185 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
186 * @return the (partial) match object.
187 *
188 */
189 public static VLSOr.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
190 return new Immutable(pTerm);
191 }
192
193 private static final class Mutable extends VLSOr.Match {
194 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
195 super(pTerm);
196 }
197
198 @Override
199 public boolean isMutable() {
200 return true;
201 }
202 }
203
204 private static final class Immutable extends VLSOr.Match {
205 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
206 super(pTerm);
207 }
208
209 @Override
210 public boolean isMutable() {
211 return false;
212 }
213 }
214 }
215
216 /**
217 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr pattern,
218 * providing pattern-specific query methods.
219 *
220 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
221 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
222 *
223 * <p>Matches of the pattern will be represented as {@link Match}.
224 *
225 * <p>Original source:
226 * <code><pre>
227 * //VLSFormula
228 * pattern VLSOr(term: VLSOr){
229 * VLSOr(term);
230 * }
231 * </pre></code>
232 *
233 * @see Match
234 * @see VLSOr
235 *
236 */
237 public static class Matcher extends BaseMatcher<VLSOr.Match> {
238 /**
239 * Initializes the pattern matcher within an existing VIATRA Query engine.
240 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
241 *
242 * @param engine the existing VIATRA Query engine in which this matcher will be created.
243 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
244 *
245 */
246 public static VLSOr.Matcher on(final ViatraQueryEngine engine) {
247 // check if matcher already exists
248 Matcher matcher = engine.getExistingMatcher(querySpecification());
249 if (matcher == null) {
250 matcher = (Matcher)engine.getMatcher(querySpecification());
251 }
252 return matcher;
253 }
254
255 /**
256 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
257 * @return an initialized matcher
258 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
259 *
260 */
261 public static VLSOr.Matcher create() {
262 return new Matcher();
263 }
264
265 private final static int POSITION_TERM = 0;
266
267 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSOr.Matcher.class);
268
269 /**
270 * Initializes the pattern matcher within an existing VIATRA Query engine.
271 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
272 *
273 * @param engine the existing VIATRA Query engine in which this matcher will be created.
274 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
275 *
276 */
277 private Matcher() {
278 super(querySpecification());
279 }
280
281 /**
282 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
283 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
284 * @return matches represented as a Match object.
285 *
286 */
287 public Collection<VLSOr.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
288 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
289 }
290
291 /**
292 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
293 * </p>
294 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
295 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
296 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
297 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
298 * @return a stream of matches represented as a Match object.
299 *
300 */
301 public Stream<VLSOr.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
302 return rawStreamAllMatches(new Object[]{pTerm});
303 }
304
305 /**
306 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
307 * Neither determinism nor randomness of selection is guaranteed.
308 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
309 * @return a match represented as a Match object, or null if no match is found.
310 *
311 */
312 public Optional<VLSOr.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
313 return rawGetOneArbitraryMatch(new Object[]{pTerm});
314 }
315
316 /**
317 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
318 * under any possible substitution of the unspecified parameters (if any).
319 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
320 * @return true if the input is a valid (partial) match of the pattern.
321 *
322 */
323 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
324 return rawHasMatch(new Object[]{pTerm});
325 }
326
327 /**
328 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
329 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
330 * @return the number of pattern matches found.
331 *
332 */
333 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
334 return rawCountMatches(new Object[]{pTerm});
335 }
336
337 /**
338 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
339 * Neither determinism nor randomness of selection is guaranteed.
340 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
341 * @param processor the action that will process the selected match.
342 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
343 *
344 */
345 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm, final Consumer<? super VLSOr.Match> processor) {
346 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
347 }
348
349 /**
350 * Returns a new (partial) match.
351 * This can be used e.g. to call the matcher with a partial match.
352 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
353 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
354 * @return the (partial) match object.
355 *
356 */
357 public VLSOr.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr pTerm) {
358 return VLSOr.Match.newMatch(pTerm);
359 }
360
361 /**
362 * Retrieve the set of values that occur in matches for term.
363 * @return the Set of all values or empty set if there are no matches
364 *
365 */
366 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr> rawStreamAllValuesOfterm(final Object[] parameters) {
367 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr.class::cast);
368 }
369
370 /**
371 * Retrieve the set of values that occur in matches for term.
372 * @return the Set of all values or empty set if there are no matches
373 *
374 */
375 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr> getAllValuesOfterm() {
376 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
377 }
378
379 /**
380 * Retrieve the set of values that occur in matches for term.
381 * @return the Set of all values or empty set if there are no matches
382 *
383 */
384 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr> streamAllValuesOfterm() {
385 return rawStreamAllValuesOfterm(emptyArray());
386 }
387
388 @Override
389 protected VLSOr.Match tupleToMatch(final Tuple t) {
390 try {
391 return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) t.get(POSITION_TERM));
392 } catch(ClassCastException e) {
393 LOGGER.error("Element(s) in tuple not properly typed!",e);
394 return null;
395 }
396 }
397
398 @Override
399 protected VLSOr.Match arrayToMatch(final Object[] match) {
400 try {
401 return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) match[POSITION_TERM]);
402 } catch(ClassCastException e) {
403 LOGGER.error("Element(s) in array not properly typed!",e);
404 return null;
405 }
406 }
407
408 @Override
409 protected VLSOr.Match arrayToMatchMutable(final Object[] match) {
410 try {
411 return VLSOr.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) match[POSITION_TERM]);
412 } catch(ClassCastException e) {
413 LOGGER.error("Element(s) in array not properly typed!",e);
414 return null;
415 }
416 }
417
418 /**
419 * @return the singleton instance of the query specification of this pattern
420 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
421 *
422 */
423 public static IQuerySpecification<VLSOr.Matcher> querySpecification() {
424 return VLSOr.instance();
425 }
426 }
427
428 private VLSOr() {
429 super(GeneratedPQuery.INSTANCE);
430 }
431
432 /**
433 * @return the singleton instance of the query specification
434 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
435 *
436 */
437 public static VLSOr instance() {
438 try{
439 return LazyHolder.INSTANCE;
440 } catch (ExceptionInInitializerError err) {
441 throw processInitializerError(err);
442 }
443 }
444
445 @Override
446 protected VLSOr.Matcher instantiate(final ViatraQueryEngine engine) {
447 return VLSOr.Matcher.on(engine);
448 }
449
450 @Override
451 public VLSOr.Matcher instantiate() {
452 return VLSOr.Matcher.create();
453 }
454
455 @Override
456 public VLSOr.Match newEmptyMatch() {
457 return VLSOr.Match.newEmptyMatch();
458 }
459
460 @Override
461 public VLSOr.Match newMatch(final Object... parameters) {
462 return VLSOr.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSOr) parameters[0]);
463 }
464
465 /**
466 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr (visibility: PUBLIC, simpleName: VLSOr, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
467 * <b>not</b> at the class load time of the outer class,
468 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr (visibility: PUBLIC, simpleName: VLSOr, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
469 *
470 * <p> This workaround is required e.g. to support recursion.
471 *
472 */
473 private static class LazyHolder {
474 private final static VLSOr INSTANCE = new VLSOr();
475
476 /**
477 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
478 * This initialization order is required to support indirect recursion.
479 *
480 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
481 *
482 */
483 private final static Object STATIC_INITIALIZER = ensureInitialized();
484
485 public static Object ensureInitialized() {
486 INSTANCE.ensureInitializedInternal();
487 return null;
488 }
489 }
490
491 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
492 private final static VLSOr.GeneratedPQuery INSTANCE = new GeneratedPQuery();
493
494 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);
495
496 private final List<PParameter> parameters = Arrays.asList(parameter_term);
497
498 private GeneratedPQuery() {
499 super(PVisibility.PUBLIC);
500 }
501
502 @Override
503 public String getFullyQualifiedName() {
504 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr";
505 }
506
507 @Override
508 public List<String> getParameterNames() {
509 return Arrays.asList("term");
510 }
511
512 @Override
513 public List<PParameter> getParameters() {
514 return parameters;
515 }
516
517 @Override
518 public Set<PBody> doGetContainedBodies() {
519 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
520 Set<PBody> bodies = new LinkedHashSet<>();
521 {
522 PBody body = new PBody(this);
523 PVariable var_term = body.getOrCreateVariableByName("term");
524 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSOr")));
525 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
526 new ExportedParameter(body, var_term, parameter_term)
527 ));
528 // VLSOr(term)
529 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSOr")));
530 bodies.add(body);
531 }
532 return bodies;
533 }
534 }
535}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUnaryNegation.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUnaryNegation.java
new file mode 100644
index 00000000..5763bf4d
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUnaryNegation.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSUnaryNegation(term: VLSUnaryNegation){
44 * VLSUnaryNegation(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSUnaryNegation extends BaseGeneratedEMFQuerySpecification<VLSUnaryNegation.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSUnaryNegation.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSUnaryNegation.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSUnaryNegation.Match)) {
140 VLSUnaryNegation.Match other = (VLSUnaryNegation.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSUnaryNegation specification() {
154 return VLSUnaryNegation.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSUnaryNegation.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSUnaryNegation.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSUnaryNegation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSUnaryNegation.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSUnaryNegation.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSUnaryNegation(term: VLSUnaryNegation){
227 * VLSUnaryNegation(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSUnaryNegation
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSUnaryNegation.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSUnaryNegation.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSUnaryNegation.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSUnaryNegation.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSUnaryNegation.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSUnaryNegation.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSUnaryNegation.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm, final Consumer<? super VLSUnaryNegation.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSUnaryNegation.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation pTerm) {
356 return VLSUnaryNegation.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSUnaryNegation.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSUnaryNegation.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSUnaryNegation.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSUnaryNegation.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSUnaryNegation.Matcher> querySpecification() {
422 return VLSUnaryNegation.instance();
423 }
424 }
425
426 private VLSUnaryNegation() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSUnaryNegation instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSUnaryNegation.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSUnaryNegation.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSUnaryNegation.Matcher instantiate() {
450 return VLSUnaryNegation.Matcher.create();
451 }
452
453 @Override
454 public VLSUnaryNegation.Match newEmptyMatch() {
455 return VLSUnaryNegation.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSUnaryNegation.Match newMatch(final Object... parameters) {
460 return VLSUnaryNegation.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUnaryNegation) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation (visibility: PUBLIC, simpleName: VLSUnaryNegation, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation (visibility: PUBLIC, simpleName: VLSUnaryNegation, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSUnaryNegation INSTANCE = new VLSUnaryNegation();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSUnaryNegation.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUnaryNegation")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSUnaryNegation(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUnaryNegation")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUniversalQuantifier.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUniversalQuantifier.java
new file mode 100644
index 00000000..a0ce1383
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VLSUniversalQuantifier.java
@@ -0,0 +1,533 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import java.util.Arrays;
7import java.util.Collection;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Objects;
11import java.util.Optional;
12import java.util.Set;
13import java.util.function.Consumer;
14import java.util.stream.Collectors;
15import java.util.stream.Stream;
16import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
37
38/**
39 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * pattern VLSUniversalQuantifier(term: VLSUniversalQuantifier){
44 * VLSUniversalQuantifier(term);
45 * }
46 * </pre></code>
47 *
48 * @see Matcher
49 * @see Match
50 *
51 */
52@SuppressWarnings("all")
53public final class VLSUniversalQuantifier extends BaseGeneratedEMFQuerySpecification<VLSUniversalQuantifier.Matcher> {
54 /**
55 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier pattern,
56 * to be used in conjunction with {@link Matcher}.
57 *
58 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
59 * Each instance is a (possibly partial) substitution of pattern parameters,
60 * usable to represent a match of the pattern in the result of a query,
61 * or to specify the bound (fixed) input parameters when issuing a query.
62 *
63 * @see Matcher
64 *
65 */
66 public static abstract class Match extends BasePatternMatch {
67 private ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier fTerm;
68
69 private static List<String> parameterNames = makeImmutableList("term");
70
71 private Match(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
72 this.fTerm = pTerm;
73 }
74
75 @Override
76 public Object get(final String parameterName) {
77 if ("term".equals(parameterName)) return this.fTerm;
78 return null;
79 }
80
81 public ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier getTerm() {
82 return this.fTerm;
83 }
84
85 @Override
86 public boolean set(final String parameterName, final Object newValue) {
87 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
88 if ("term".equals(parameterName) ) {
89 this.fTerm = (ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) newValue;
90 return true;
91 }
92 return false;
93 }
94
95 public void setTerm(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 this.fTerm = pTerm;
98 }
99
100 @Override
101 public String patternName() {
102 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier";
103 }
104
105 @Override
106 public List<String> parameterNames() {
107 return VLSUniversalQuantifier.Match.parameterNames;
108 }
109
110 @Override
111 public Object[] toArray() {
112 return new Object[]{fTerm};
113 }
114
115 @Override
116 public VLSUniversalQuantifier.Match toImmutable() {
117 return isMutable() ? newMatch(fTerm) : this;
118 }
119
120 @Override
121 public String prettyPrint() {
122 StringBuilder result = new StringBuilder();
123 result.append("\"term\"=" + prettyPrintValue(fTerm));
124 return result.toString();
125 }
126
127 @Override
128 public int hashCode() {
129 return Objects.hash(fTerm);
130 }
131
132 @Override
133 public boolean equals(final Object obj) {
134 if (this == obj)
135 return true;
136 if (obj == null) {
137 return false;
138 }
139 if ((obj instanceof VLSUniversalQuantifier.Match)) {
140 VLSUniversalQuantifier.Match other = (VLSUniversalQuantifier.Match) obj;
141 return Objects.equals(fTerm, other.fTerm);
142 } else {
143 // this should be infrequent
144 if (!(obj instanceof IPatternMatch)) {
145 return false;
146 }
147 IPatternMatch otherSig = (IPatternMatch) obj;
148 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
149 }
150 }
151
152 @Override
153 public VLSUniversalQuantifier specification() {
154 return VLSUniversalQuantifier.instance();
155 }
156
157 /**
158 * Returns an empty, mutable match.
159 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
160 *
161 * @return the empty match.
162 *
163 */
164 public static VLSUniversalQuantifier.Match newEmptyMatch() {
165 return new Mutable(null);
166 }
167
168 /**
169 * Returns a mutable (partial) match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
173 * @return the new, mutable (partial) match object.
174 *
175 */
176 public static VLSUniversalQuantifier.Match newMutableMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
177 return new Mutable(pTerm);
178 }
179
180 /**
181 * Returns a new (partial) match.
182 * This can be used e.g. to call the matcher with a partial match.
183 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
184 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
185 * @return the (partial) match object.
186 *
187 */
188 public static VLSUniversalQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
189 return new Immutable(pTerm);
190 }
191
192 private static final class Mutable extends VLSUniversalQuantifier.Match {
193 Mutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
194 super(pTerm);
195 }
196
197 @Override
198 public boolean isMutable() {
199 return true;
200 }
201 }
202
203 private static final class Immutable extends VLSUniversalQuantifier.Match {
204 Immutable(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
205 super(pTerm);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return false;
211 }
212 }
213 }
214
215 /**
216 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier pattern,
217 * providing pattern-specific query methods.
218 *
219 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
220 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
221 *
222 * <p>Matches of the pattern will be represented as {@link Match}.
223 *
224 * <p>Original source:
225 * <code><pre>
226 * pattern VLSUniversalQuantifier(term: VLSUniversalQuantifier){
227 * VLSUniversalQuantifier(term);
228 * }
229 * </pre></code>
230 *
231 * @see Match
232 * @see VLSUniversalQuantifier
233 *
234 */
235 public static class Matcher extends BaseMatcher<VLSUniversalQuantifier.Match> {
236 /**
237 * Initializes the pattern matcher within an existing VIATRA Query engine.
238 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
239 *
240 * @param engine the existing VIATRA Query engine in which this matcher will be created.
241 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
242 *
243 */
244 public static VLSUniversalQuantifier.Matcher on(final ViatraQueryEngine engine) {
245 // check if matcher already exists
246 Matcher matcher = engine.getExistingMatcher(querySpecification());
247 if (matcher == null) {
248 matcher = (Matcher)engine.getMatcher(querySpecification());
249 }
250 return matcher;
251 }
252
253 /**
254 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
255 * @return an initialized matcher
256 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
257 *
258 */
259 public static VLSUniversalQuantifier.Matcher create() {
260 return new Matcher();
261 }
262
263 private final static int POSITION_TERM = 0;
264
265 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VLSUniversalQuantifier.Matcher.class);
266
267 /**
268 * Initializes the pattern matcher within an existing VIATRA Query engine.
269 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
270 *
271 * @param engine the existing VIATRA Query engine in which this matcher will be created.
272 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
273 *
274 */
275 private Matcher() {
276 super(querySpecification());
277 }
278
279 /**
280 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
281 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
282 * @return matches represented as a Match object.
283 *
284 */
285 public Collection<VLSUniversalQuantifier.Match> getAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
286 return rawStreamAllMatches(new Object[]{pTerm}).collect(Collectors.toSet());
287 }
288
289 /**
290 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
291 * </p>
292 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
293 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
294 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
295 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
296 * @return a stream of matches represented as a Match object.
297 *
298 */
299 public Stream<VLSUniversalQuantifier.Match> streamAllMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
300 return rawStreamAllMatches(new Object[]{pTerm});
301 }
302
303 /**
304 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
305 * Neither determinism nor randomness of selection is guaranteed.
306 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
307 * @return a match represented as a Match object, or null if no match is found.
308 *
309 */
310 public Optional<VLSUniversalQuantifier.Match> getOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
311 return rawGetOneArbitraryMatch(new Object[]{pTerm});
312 }
313
314 /**
315 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
316 * under any possible substitution of the unspecified parameters (if any).
317 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
318 * @return true if the input is a valid (partial) match of the pattern.
319 *
320 */
321 public boolean hasMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
322 return rawHasMatch(new Object[]{pTerm});
323 }
324
325 /**
326 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
327 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
328 * @return the number of pattern matches found.
329 *
330 */
331 public int countMatches(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
332 return rawCountMatches(new Object[]{pTerm});
333 }
334
335 /**
336 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
339 * @param processor the action that will process the selected match.
340 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
341 *
342 */
343 public boolean forOneArbitraryMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm, final Consumer<? super VLSUniversalQuantifier.Match> processor) {
344 return rawForOneArbitraryMatch(new Object[]{pTerm}, processor);
345 }
346
347 /**
348 * Returns a new (partial) match.
349 * This can be used e.g. to call the matcher with a partial match.
350 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
351 * @param pTerm the fixed value of pattern parameter term, or null if not bound.
352 * @return the (partial) match object.
353 *
354 */
355 public VLSUniversalQuantifier.Match newMatch(final ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier pTerm) {
356 return VLSUniversalQuantifier.Match.newMatch(pTerm);
357 }
358
359 /**
360 * Retrieve the set of values that occur in matches for term.
361 * @return the Set of all values or empty set if there are no matches
362 *
363 */
364 protected Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier> rawStreamAllValuesOfterm(final Object[] parameters) {
365 return rawStreamAllValues(POSITION_TERM, parameters).map(ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier.class::cast);
366 }
367
368 /**
369 * Retrieve the set of values that occur in matches for term.
370 * @return the Set of all values or empty set if there are no matches
371 *
372 */
373 public Set<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier> getAllValuesOfterm() {
374 return rawStreamAllValuesOfterm(emptyArray()).collect(Collectors.toSet());
375 }
376
377 /**
378 * Retrieve the set of values that occur in matches for term.
379 * @return the Set of all values or empty set if there are no matches
380 *
381 */
382 public Stream<ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier> streamAllValuesOfterm() {
383 return rawStreamAllValuesOfterm(emptyArray());
384 }
385
386 @Override
387 protected VLSUniversalQuantifier.Match tupleToMatch(final Tuple t) {
388 try {
389 return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) t.get(POSITION_TERM));
390 } catch(ClassCastException e) {
391 LOGGER.error("Element(s) in tuple not properly typed!",e);
392 return null;
393 }
394 }
395
396 @Override
397 protected VLSUniversalQuantifier.Match arrayToMatch(final Object[] match) {
398 try {
399 return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) match[POSITION_TERM]);
400 } catch(ClassCastException e) {
401 LOGGER.error("Element(s) in array not properly typed!",e);
402 return null;
403 }
404 }
405
406 @Override
407 protected VLSUniversalQuantifier.Match arrayToMatchMutable(final Object[] match) {
408 try {
409 return VLSUniversalQuantifier.Match.newMutableMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) match[POSITION_TERM]);
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in array not properly typed!",e);
412 return null;
413 }
414 }
415
416 /**
417 * @return the singleton instance of the query specification of this pattern
418 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
419 *
420 */
421 public static IQuerySpecification<VLSUniversalQuantifier.Matcher> querySpecification() {
422 return VLSUniversalQuantifier.instance();
423 }
424 }
425
426 private VLSUniversalQuantifier() {
427 super(GeneratedPQuery.INSTANCE);
428 }
429
430 /**
431 * @return the singleton instance of the query specification
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static VLSUniversalQuantifier instance() {
436 try{
437 return LazyHolder.INSTANCE;
438 } catch (ExceptionInInitializerError err) {
439 throw processInitializerError(err);
440 }
441 }
442
443 @Override
444 protected VLSUniversalQuantifier.Matcher instantiate(final ViatraQueryEngine engine) {
445 return VLSUniversalQuantifier.Matcher.on(engine);
446 }
447
448 @Override
449 public VLSUniversalQuantifier.Matcher instantiate() {
450 return VLSUniversalQuantifier.Matcher.create();
451 }
452
453 @Override
454 public VLSUniversalQuantifier.Match newEmptyMatch() {
455 return VLSUniversalQuantifier.Match.newEmptyMatch();
456 }
457
458 @Override
459 public VLSUniversalQuantifier.Match newMatch(final Object... parameters) {
460 return VLSUniversalQuantifier.Match.newMatch((ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSUniversalQuantifier) parameters[0]);
461 }
462
463 /**
464 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier (visibility: PUBLIC, simpleName: VLSUniversalQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
465 * <b>not</b> at the class load time of the outer class,
466 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier (visibility: PUBLIC, simpleName: VLSUniversalQuantifier, identifier: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
467 *
468 * <p> This workaround is required e.g. to support recursion.
469 *
470 */
471 private static class LazyHolder {
472 private final static VLSUniversalQuantifier INSTANCE = new VLSUniversalQuantifier();
473
474 /**
475 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
476 * This initialization order is required to support indirect recursion.
477 *
478 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
479 *
480 */
481 private final static Object STATIC_INITIALIZER = ensureInitialized();
482
483 public static Object ensureInitialized() {
484 INSTANCE.ensureInitializedInternal();
485 return null;
486 }
487 }
488
489 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
490 private final static VLSUniversalQuantifier.GeneratedPQuery INSTANCE = new GeneratedPQuery();
491
492 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);
493
494 private final List<PParameter> parameters = Arrays.asList(parameter_term);
495
496 private GeneratedPQuery() {
497 super(PVisibility.PUBLIC);
498 }
499
500 @Override
501 public String getFullyQualifiedName() {
502 return "ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier";
503 }
504
505 @Override
506 public List<String> getParameterNames() {
507 return Arrays.asList("term");
508 }
509
510 @Override
511 public List<PParameter> getParameters() {
512 return parameters;
513 }
514
515 @Override
516 public Set<PBody> doGetContainedBodies() {
517 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
518 Set<PBody> bodies = new LinkedHashSet<>();
519 {
520 PBody body = new PBody(this);
521 PVariable var_term = body.getOrCreateVariableByName("term");
522 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUniversalQuantifier")));
523 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
524 new ExportedParameter(body, var_term, parameter_term)
525 ));
526 // VLSUniversalQuantifier(term)
527 new TypeConstraint(body, Tuples.flatTupleOf(var_term), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.mcgill.ca/ecse/dslreasoner/VampireLanguage", "VLSUniversalQuantifier")));
528 bodies.add(body);
529 }
530 return bodies;
531 }
532 }
533}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VampireQueries.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VampireQueries.java
new file mode 100644
index 00000000..2366250b
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/VampireQueries.java
@@ -0,0 +1,174 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.vampire.reasoner/queries/ca/mcgill/ecse/dslreasoner/vampire/reasoner/queries/vampireQueries.vql
3 */
4package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries;
5
6import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnd;
7import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSAnnotation;
8import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSComment;
9import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSEquivalent;
10import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSExistentialQuantifier;
11import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFofFormula;
12import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunction;
13import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSFunctionFof;
14import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSInequality;
15import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSOr;
16import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUnaryNegation;
17import ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries.VLSUniversalQuantifier;
18import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
19import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
20
21/**
22 * A pattern group formed of all public patterns defined in vampireQueries.vql.
23 *
24 * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
25 * a VIATRA Query engine for matching all patterns originally defined in file vampireQueries.vql,
26 * in order to achieve better performance than one-by-one on-demand matcher initialization.
27 *
28 * <p> From package ca.mcgill.ecse.dslreasoner.vampire.reasoner.queries, the group contains the definition of the following patterns: <ul>
29 * <li>VLSComment</li>
30 * <li>VLSFofFormula</li>
31 * <li>VLSAnnotation</li>
32 * <li>VLSOr</li>
33 * <li>VLSAnd</li>
34 * <li>VLSEquivalent</li>
35 * <li>VLSFunction</li>
36 * <li>VLSExistentialQuantifier</li>
37 * <li>VLSUniversalQuantifier</li>
38 * <li>VLSUnaryNegation</li>
39 * <li>VLSInequality</li>
40 * <li>VLSFunctionFof</li>
41 * </ul>
42 *
43 * @see IQueryGroup
44 *
45 */
46@SuppressWarnings("all")
47public final class VampireQueries extends BaseGeneratedPatternGroup {
48 /**
49 * Access the pattern group.
50 *
51 * @return the singleton instance of the group
52 * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
53 *
54 */
55 public static VampireQueries instance() {
56 if (INSTANCE == null) {
57 INSTANCE = new VampireQueries();
58 }
59 return INSTANCE;
60 }
61
62 private static VampireQueries INSTANCE;
63
64 private VampireQueries() {
65 querySpecifications.add(VLSComment.instance());
66 querySpecifications.add(VLSFofFormula.instance());
67 querySpecifications.add(VLSAnnotation.instance());
68 querySpecifications.add(VLSOr.instance());
69 querySpecifications.add(VLSAnd.instance());
70 querySpecifications.add(VLSEquivalent.instance());
71 querySpecifications.add(VLSFunction.instance());
72 querySpecifications.add(VLSExistentialQuantifier.instance());
73 querySpecifications.add(VLSUniversalQuantifier.instance());
74 querySpecifications.add(VLSUnaryNegation.instance());
75 querySpecifications.add(VLSInequality.instance());
76 querySpecifications.add(VLSFunctionFof.instance());
77 }
78
79 public VLSComment getVLSComment() {
80 return VLSComment.instance();
81 }
82
83 public VLSComment.Matcher getVLSComment(final ViatraQueryEngine engine) {
84 return VLSComment.Matcher.on(engine);
85 }
86
87 public VLSFofFormula getVLSFofFormula() {
88 return VLSFofFormula.instance();
89 }
90
91 public VLSFofFormula.Matcher getVLSFofFormula(final ViatraQueryEngine engine) {
92 return VLSFofFormula.Matcher.on(engine);
93 }
94
95 public VLSAnnotation getVLSAnnotation() {
96 return VLSAnnotation.instance();
97 }
98
99 public VLSAnnotation.Matcher getVLSAnnotation(final ViatraQueryEngine engine) {
100 return VLSAnnotation.Matcher.on(engine);
101 }
102
103 public VLSOr getVLSOr() {
104 return VLSOr.instance();
105 }
106
107 public VLSOr.Matcher getVLSOr(final ViatraQueryEngine engine) {
108 return VLSOr.Matcher.on(engine);
109 }
110
111 public VLSAnd getVLSAnd() {
112 return VLSAnd.instance();
113 }
114
115 public VLSAnd.Matcher getVLSAnd(final ViatraQueryEngine engine) {
116 return VLSAnd.Matcher.on(engine);
117 }
118
119 public VLSEquivalent getVLSEquivalent() {
120 return VLSEquivalent.instance();
121 }
122
123 public VLSEquivalent.Matcher getVLSEquivalent(final ViatraQueryEngine engine) {
124 return VLSEquivalent.Matcher.on(engine);
125 }
126
127 public VLSFunction getVLSFunction() {
128 return VLSFunction.instance();
129 }
130
131 public VLSFunction.Matcher getVLSFunction(final ViatraQueryEngine engine) {
132 return VLSFunction.Matcher.on(engine);
133 }
134
135 public VLSExistentialQuantifier getVLSExistentialQuantifier() {
136 return VLSExistentialQuantifier.instance();
137 }
138
139 public VLSExistentialQuantifier.Matcher getVLSExistentialQuantifier(final ViatraQueryEngine engine) {
140 return VLSExistentialQuantifier.Matcher.on(engine);
141 }
142
143 public VLSUniversalQuantifier getVLSUniversalQuantifier() {
144 return VLSUniversalQuantifier.instance();
145 }
146
147 public VLSUniversalQuantifier.Matcher getVLSUniversalQuantifier(final ViatraQueryEngine engine) {
148 return VLSUniversalQuantifier.Matcher.on(engine);
149 }
150
151 public VLSUnaryNegation getVLSUnaryNegation() {
152 return VLSUnaryNegation.instance();
153 }
154
155 public VLSUnaryNegation.Matcher getVLSUnaryNegation(final ViatraQueryEngine engine) {
156 return VLSUnaryNegation.Matcher.on(engine);
157 }
158
159 public VLSInequality getVLSInequality() {
160 return VLSInequality.instance();
161 }
162
163 public VLSInequality.Matcher getVLSInequality(final ViatraQueryEngine engine) {
164 return VLSInequality.Matcher.on(engine);
165 }
166
167 public VLSFunctionFof getVLSFunctionFof() {
168 return VLSFunctionFof.instance();
169 }
170
171 public VLSFunctionFof.Matcher getVLSFunctionFof(final ViatraQueryEngine engine) {
172 return VLSFunctionFof.Matcher.on(engine);
173 }
174}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.xtend
index 64484b88..cbe53bff 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.xtend
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.xtend
@@ -1,18 +1,18 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner 1package ca.mcgill.ecse.dslreasoner.vampire.reasoner
2 2
3import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetup
3import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetupGenerated 4import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetupGenerated
5import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper
6import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes
7import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Vampire2LogicMapper
8import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.VampireHandler
9import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage
4import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner 10import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner
5import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasonerException 11import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasonerException
6import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration 12import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration
7import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem 13import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem
8import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult 14import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult
9import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper
10import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage
11import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace 15import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace
12import java.io.PrintWriter
13import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetup
14import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper
15import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes
16 16
17class VampireSolver extends LogicReasoner{ 17class VampireSolver extends LogicReasoner{
18 18
@@ -23,14 +23,14 @@ class VampireSolver extends LogicReasoner{
23 } 23 }
24 24
25 val Logic2VampireLanguageMapper forwardMapper = new Logic2VampireLanguageMapper(new Logic2VampireLanguageMapper_TypeMapper_FilteredTypes) 25 val Logic2VampireLanguageMapper forwardMapper = new Logic2VampireLanguageMapper(new Logic2VampireLanguageMapper_TypeMapper_FilteredTypes)
26// //not for now 26 val Vampire2LogicMapper backwardMapper = new Vampire2LogicMapper
27// val VampireHandler handler = new VampireHandler 27 val VampireHandler handler = new VampireHandler
28// val Vampire2LogicMapper backwardMapper = new Vampire2LogicMapper
29 28
30 val fileName = "problem.tptp"
31 29
32 override solve(LogicProblem problem, LogicSolverConfiguration configuration, ReasonerWorkspace workspace) throws LogicReasonerException { 30 val fileName = "vampireProblem.tptp"
33 val vampireConfig = configuration.asConfig 31
32 override solve(LogicProblem problem, LogicSolverConfiguration config, ReasonerWorkspace workspace) throws LogicReasonerException {
33 val vampireConfig = config.asConfig
34 34
35 // Start: Logic -> Vampire mapping 35 // Start: Logic -> Vampire mapping
36 val transformationStart = System.currentTimeMillis 36 val transformationStart = System.currentTimeMillis
@@ -41,36 +41,38 @@ class VampireSolver extends LogicReasoner{
41 41
42 var String fileURI = null; 42 var String fileURI = null;
43 var String vampireCode = null; 43 var String vampireCode = null;
44 vampireCode = workspace.writeModelToString(vampireProblem,fileName)
44 if(vampireConfig.writeToFile) { 45 if(vampireConfig.writeToFile) {
45 fileURI = workspace.writeModel(vampireProblem,fileName).toFileString 46 fileURI = workspace.writeModel(vampireProblem,fileName).toFileString
46 } else { 47 }
47 vampireCode = workspace.writeModelToString(vampireProblem,fileName) 48
48 } 49 //Result as String
50
51
49 val transformationTime = System.currentTimeMillis - transformationStart 52 val transformationTime = System.currentTimeMillis - transformationStart
50 // Finish: Logic -> Vampire mapping 53 // Finish: Logic -> Vampire mapping
51 54
52 //Creates a file containing the tptp code after transformation 55
53 val out = new PrintWriter("output/files/vampireCode.tptp") 56 /*
54 out.println(vampireCode)
55 out.close()
56
57
58 /*
59 * not for now -> Start: Solving Alloy problem
60 *
61 // Start: Solving Alloy problem 57 // Start: Solving Alloy problem
62 val solverStart = System.currentTimeMillis 58 val solverStart = System.currentTimeMillis
63 val result2 = handler.callSolver(alloyProblem,workspace,alloyConfig,fileURI,alloyCode) 59 //Calling Solver (Currently Manually)
64 val logicResult = backwardMapper.transformOutput(problem,configuration.solutionScope.numberOfRequiredSolution,result2,forwardTrace,transformationTime) 60 val result2 = handler.callSolver(vampireProblem,workspace,vampireConfig,vampireCode)
61// val result2 = null
62 //TODO
63 //Backwards Mapper
64 val logicResult = backwardMapper.transformOutput(problem,config.solutionScope.numberOfRequiredSolution,result2,forwardTrace,transformationTime)
65
65 val solverFinish = System.currentTimeMillis-solverStart 66 val solverFinish = System.currentTimeMillis-solverStart
66 // Finish: Solving Alloy problem 67 // Finish: Solving Alloy problem
67 68
68 if(vampireConfig.writeToFile) workspace.deactivateModel(fileName) 69 if(vampireConfig.writeToFile) workspace.deactivateModel(fileName)
69 70
70 return logicResult 71 return logicResult
71 */
72 72
73 /*/
73 return null // for now 74 return null // for now
75 //*/
74 } 76 }
75 77
76 def asConfig(LogicSolverConfiguration configuration){ 78 def asConfig(LogicSolverConfiguration configuration){
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.xtend
index 9b316210..cd48a032 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.xtend
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.xtend
@@ -55,7 +55,7 @@ class Logic2VampireLanguageMapper {
55 } 55 }
56 56
57 public def TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> transformProblem(LogicProblem problem, 57 public def TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> transformProblem(LogicProblem problem,
58 VampireSolverConfiguration configuration) { 58 VampireSolverConfiguration config) {
59 // create model bases 59 // create model bases
60 // TODO 60 // TODO
61 val initialComment = createVLSComment => [ 61 val initialComment = createVLSComment => [
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtend
index 01c4f5af..41e2137c 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtend
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtend
@@ -97,6 +97,7 @@ class Logic2VampireLanguageMapper_TypeMapper_FilteredTypes implements Logic2Vamp
97 } 97 }
98 98
99 // 5. create fof function that is an or with all the elements in map 99 // 5. create fof function that is an or with all the elements in map
100 // Do this only if there are more than 1 type
100 val hierarch = createVLSFofFormula => [ 101 val hierarch = createVLSFofFormula => [
101 it.name = "hierarchyHandler" 102 it.name = "hierarchyHandler"
102 it.fofRole = "axiom" 103 it.fofRole = "axiom"
@@ -115,6 +116,7 @@ class Logic2VampireLanguageMapper_TypeMapper_FilteredTypes implements Logic2Vamp
115 ] 116 ]
116 117
117 trace.specification.formulas += hierarch 118 trace.specification.formulas += hierarch
119
118 } 120 }
119 121
120 def boolean dfsSupertypeCheck(Type type, Type type2) { 122 def boolean dfsSupertypeCheck(Type type, Type type2) {
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.xtend
new file mode 100644
index 00000000..5cb0198e
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.xtend
@@ -0,0 +1,66 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder
2
3import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem
4import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicresultFactory
5
6class Vampire2LogicMapper {
7 val extension LogicresultFactory resultFactory = LogicresultFactory.eINSTANCE
8
9 public def transformOutput(LogicProblem problem, int requiredNumberOfSolution, VampireSolutionModel vampireSolution, Logic2VampireLanguageMapperTrace trace, long transformationTime) {
10 val models = vampireSolution.aswers.map[it.key].toList
11
12 if(!monitoredAlloySolution.finishedBeforeTimeout) {
13 return createInsuficientResourcesResult => [
14 it.problem = problem
15 it.representation += models
16 it.trace = trace
17 it.statistics = transformStatistics(monitoredAlloySolution,transformationTime)
18 ]
19 } else {
20 if(models.last.satisfiable || requiredNumberOfSolution == -1) {
21 return createModelResult => [
22 it.problem = problem
23 it.representation += models
24 it.trace = trace
25 it.statistics = transformStatistics(monitoredAlloySolution,transformationTime)
26 ]
27 } else {
28 return createInconsistencyResult => [
29 it.problem = problem
30 it.representation += models
31 it.trace = trace
32 it.statistics = transformStatistics(monitoredAlloySolution,transformationTime)
33 ]
34 }
35 }
36 }
37
38 def transformStatistics(MonitoredAlloySolution solution, long transformationTime) {
39 createStatistics => [
40 it.transformationTime = transformationTime as int
41 for(solutionIndex : 0..<solution.aswers.size) {
42 val solutionTime = solution.aswers.get(solutionIndex).value
43 it.entries+= createIntStatisticEntry => [
44 it.name = '''Answer«solutionIndex»Time'''
45 it.value = solutionTime.intValue
46 ]
47 }
48 it.entries+= createIntStatisticEntry => [
49 it.name = "Alloy2KodKodTransformationTime"
50 it.value = solution.kodkodTime as int
51 ]
52 it.entries+= createIntStatisticEntry => [
53 it.name = "Alloy2KodKodTransformationTime"
54 it.value = solution.kodkodTime as int
55 ]
56 it.entries+= createStringStatisticEntry => [
57 it.name = "warnings"
58 it.value = '''[«FOR warning : solution.warnings SEPARATOR ","»«warning»«ENDFOR»]'''
59 ]
60 ]
61 }
62
63 def sum(Iterable<Long> ints) {
64 ints.reduce[p1, p2|p1+p2]
65 }
66}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.xtend
new file mode 100644
index 00000000..aefa1a7e
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.xtend
@@ -0,0 +1,214 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder
2
3import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireBackendSolver
4import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration
5import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel
6import com.google.common.util.concurrent.SimpleTimeLimiter
7import com.google.common.util.concurrent.UncheckedTimeoutException
8import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration
9import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace
10import java.util.ArrayList
11import java.util.HashMap
12import java.util.LinkedList
13import java.util.List
14import java.util.Map
15import java.util.concurrent.Callable
16import java.util.concurrent.TimeUnit
17import org.eclipse.emf.common.command.Command
18import org.eclipse.xtend.lib.annotations.Data
19
20class VampireSolverException extends Exception{
21 new(String s) { super(s) }
22 new(String s, Exception e) { super(s,e) }
23 new(String s, List<String> errors, Exception e) {
24 super(s + '\n' + errors.join('\n'), e)
25 }
26}
27
28@Data class VampireSolutionModel{
29// List<String> warnings
30// List<String> debugs
31// long kodkodTime
32// val List<Pair<A4Solution, Long>> aswers
33// val boolean finishedBeforeTimeout
34
35
36}
37
38class VampireHandler {
39
40 //val fileName = "problem.als"
41
42 public def callSolver(VampireModel problem, ReasonerWorkspace workspace, VampireSolverConfiguration configuration,String vampireCode) {
43 /*
44 //Prepare
45 val warnings = new LinkedList<String>
46 val debugs = new LinkedList<String>
47 val runtime = new ArrayList<Long>
48 val reporter = new A4Reporter() {
49 override debug(String message) { debugs += message }
50 override resultSAT (Object command, long solvingTime, Object solution) { runtime += solvingTime }
51 override resultUNSAT (Object command, long solvingTime, Object solution) { runtime += solvingTime }
52 override warning(ErrorWarning msg) { warnings += msg.message }
53 }
54
55 val options = new A4Options() => [
56 it.symmetry = configuration.symmetry
57 it.noOverflow = true
58 it.solver = getSolver(configuration.getSolver, configuration)
59 if(configuration.getSolver.externalSolver) {
60 it.solverDirectory = configuration.solverPath
61 }
62 //it.inferPartialInstance
63 //it.tempDirectory = CommonPlugin.resolve(workspace.workspaceURI).toFileString
64 ]
65
66 // Transform
67 var Command command = null;
68 var CompModule compModule = null
69
70 // Start: Alloy -> Kodkod
71 val kodkodTransformStart = System.currentTimeMillis();
72 try {
73 compModule = CompUtil.parseEverything_fromString(reporter,alloyCode)
74 if(compModule.allCommands.size != 1)
75 throw new UnsupportedOperationException('''Alloy files with multiple commands are not supported!''')
76 command = compModule.allCommands.head
77 } catch (Err e){
78 throw new AlloySolverException(e.message,warnings,e)
79 }
80 val kodkodTransformFinish = System.currentTimeMillis - kodkodTransformStart
81 // Finish: Alloy -> Kodkod
82
83 val limiter = new SimpleTimeLimiter
84 val callable = new AlloyCallerWithTimeout(warnings,debugs,reporter,options,command,compModule,configuration)
85 var List<Pair<A4Solution, Long>> answers
86 var boolean finished
87 if(configuration.runtimeLimit == LogicSolverConfiguration::Unlimited) {
88 answers = callable.call
89 finished = true
90 } else {
91 try{
92 answers = limiter.callWithTimeout(callable,configuration.runtimeLimit,TimeUnit.SECONDS,true)
93 finished = true
94 } catch (UncheckedTimeoutException e) {
95 answers = callable.partialAnswers
96 finished = false
97 }
98 }
99
100 new MonitoredAlloySolution(warnings,debugs,kodkodTransformFinish,answers,finished)
101 */
102 }
103 /*
104 val static Map<SolverConfiguration, SatSolver> previousSolverConfigurations = new HashMap
105 def getSolverConfiguration(AlloyBackendSolver backedSolver, String path, String[] options) {
106 val config = new SolverConfiguration(backedSolver,path,options)
107 if(previousSolverConfigurations.containsKey(config)) {
108 return previousSolverConfigurations.get(config)
109 } else {
110 val id ='''DSLReasoner_Alloy_«previousSolverConfigurations.size»_«backedSolver»'''
111 val newSolver = A4Options.SatSolver.make(id,id,path,options)
112 previousSolverConfigurations.put(config,newSolver)
113 return newSolver
114 }
115 }
116
117 def getSolver(AlloyBackendSolver backedSolver, AlloySolverConfiguration configuration) {
118 switch(backedSolver){
119 case BerkMinPIPE: return A4Options.SatSolver.BerkMinPIPE
120 case SpearPIPE: return A4Options.SatSolver.SpearPIPE
121 case MiniSatJNI: return A4Options.SatSolver.MiniSatJNI
122 case MiniSatProverJNI: return A4Options.SatSolver.MiniSatProverJNI
123 case LingelingJNI: return A4Options.SatSolver.LingelingJNI
124 case PLingelingJNI: return getSolverConfiguration(backedSolver,configuration.solverPath,null)
125 case GlucoseJNI: return A4Options.SatSolver.GlucoseJNI
126 case CryptoMiniSatJNI: return A4Options.SatSolver.CryptoMiniSatJNI
127 case SAT4J: return A4Options.SatSolver.SAT4J
128 case CNF: return A4Options.SatSolver.CNF
129 case KodKod: return A4Options.SatSolver.KK
130 }
131 }
132
133 def isExternalSolver(AlloyBackendSolver backedSolver) {
134 return !(backedSolver == AlloyBackendSolver.SAT4J)
135 }
136*/
137}
138/*
139class VampireCallerWithTimeout implements Callable<List<Pair<A4Solution,Long>>>{
140
141 val List<String> warnings
142 val List<String> debugs
143 val A4Reporter reporter
144 val A4Options options
145
146 val Command command
147 val CompModule compModule
148 val AlloySolverConfiguration configuration
149
150 val List<Pair<A4Solution,Long>> answers = new LinkedList()
151
152 new(List<String> warnings,
153 List<String> debugs,
154 A4Reporter reporter,
155 A4Options options,
156 Command command,
157 CompModule compModule,
158 AlloySolverConfiguration configuration)
159 {
160 this.warnings = warnings
161 this.debugs = debugs
162 this.reporter = reporter
163 this.options = options
164 this.command = command
165 this.compModule = compModule
166 this.configuration = configuration
167 }
168
169 override call() throws Exception {
170 val startTime = System.currentTimeMillis
171
172 // Start: Execute
173 var A4Solution lastAnswer = null
174 try {
175 if(!configuration.progressMonitor.isCancelled) {
176 do{
177 if(lastAnswer == null) {
178 lastAnswer = TranslateAlloyToKodkod.execute_command(reporter,compModule.allSigs,command,options)
179 } else {
180 lastAnswer = lastAnswer.next
181 }
182 configuration.progressMonitor.workedBackwardTransformation(configuration.solutionScope.numberOfRequiredSolution)
183
184 val runtime = System.currentTimeMillis -startTime
185 synchronized(this) {
186 answers += (lastAnswer->runtime)
187 }
188 } while(lastAnswer.satisfiable != false && !hasEnoughSolution(answers) && !configuration.progressMonitor.isCancelled)
189
190 }
191 }catch(Exception e) {
192 warnings +=e.message
193 }
194 // Finish: execute
195 return answers
196 }
197
198 def hasEnoughSolution(List<?> answers) {
199 if(configuration.solutionScope.numberOfRequiredSolution < 0) return false
200 else return answers.size() == configuration.solutionScope.numberOfRequiredSolution
201 }
202
203 public def getPartialAnswers() {
204 return answers
205 }
206
207}
208/*
209@Data class SolverConfiguration {
210 VampireBackendSolver backendSolver
211 String path
212 String[] options
213}
214*/
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireAnalyzerConfiguration.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireAnalyzerConfiguration.xtendbin
index b9a5c4e7..462a940b 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireAnalyzerConfiguration.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireAnalyzerConfiguration.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireSolver.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireSolver.xtendbin
index a9926cdc..d8b8ca61 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireSolver.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.VampireSolver.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.gitignore b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.gitignore
index 9efd2ac5..70f60102 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.gitignore
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/.gitignore
@@ -2,3 +2,9 @@
2/.TypeMappingTechnique.java._trace 2/.TypeMappingTechnique.java._trace
3/.VampireBackendSolver.java._trace 3/.VampireBackendSolver.java._trace
4/.VampireSolverConfiguration.java._trace 4/.VampireSolverConfiguration.java._trace
5/.VampireAnalyzerConfiguration.xtendbin
6/.VampireSolver.xtendbin
7/TypeMappingTechnique.java
8/VampireBackendSolver.java
9/VampireSolver.java
10/VampireSolverConfiguration.java
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java
index 81cae109..e1a1ca6e 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java
@@ -6,6 +6,8 @@ import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration;
6import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper; 6import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper;
7import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapperTrace; 7import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapperTrace;
8import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes; 8import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes;
9import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Vampire2LogicMapper;
10import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.VampireHandler;
9import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage; 11import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage;
10import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel; 12import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel;
11import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicModelInterpretation; 13import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicModelInterpretation;
@@ -17,10 +19,8 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem;
17import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; 19import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult;
18import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; 20import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult;
19import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace; 21import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace;
20import java.io.PrintWriter;
21import java.util.List; 22import java.util.List;
22import org.eclipse.xtend2.lib.StringConcatenation; 23import org.eclipse.xtend2.lib.StringConcatenation;
23import org.eclipse.xtext.xbase.lib.Exceptions;
24 24
25@SuppressWarnings("all") 25@SuppressWarnings("all")
26public class VampireSolver extends LogicReasoner { 26public class VampireSolver extends LogicReasoner {
@@ -32,32 +32,28 @@ public class VampireSolver extends LogicReasoner {
32 32
33 private final Logic2VampireLanguageMapper forwardMapper = new Logic2VampireLanguageMapper(new Logic2VampireLanguageMapper_TypeMapper_FilteredTypes()); 33 private final Logic2VampireLanguageMapper forwardMapper = new Logic2VampireLanguageMapper(new Logic2VampireLanguageMapper_TypeMapper_FilteredTypes());
34 34
35 private final String fileName = "problem.tptp"; 35 private final Vampire2LogicMapper backwardMapper = new Vampire2LogicMapper();
36
37 private final VampireHandler handler = new VampireHandler();
38
39 private final String fileName = "vampireProblem.tptp";
36 40
37 @Override 41 @Override
38 public LogicResult solve(final LogicProblem problem, final LogicSolverConfiguration configuration, final ReasonerWorkspace workspace) throws LogicReasonerException { 42 public LogicResult solve(final LogicProblem problem, final LogicSolverConfiguration config, final ReasonerWorkspace workspace) throws LogicReasonerException {
39 try { 43 final VampireSolverConfiguration vampireConfig = this.asConfig(config);
40 final VampireSolverConfiguration vampireConfig = this.asConfig(configuration); 44 final long transformationStart = System.currentTimeMillis();
41 final long transformationStart = System.currentTimeMillis(); 45 final TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> result = this.forwardMapper.transformProblem(problem, vampireConfig);
42 final TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> result = this.forwardMapper.transformProblem(problem, vampireConfig); 46 final VampireModel vampireProblem = result.getOutput();
43 final VampireModel vampireProblem = result.getOutput(); 47 final Logic2VampireLanguageMapperTrace forwardTrace = result.getTrace();
44 final Logic2VampireLanguageMapperTrace forwardTrace = result.getTrace(); 48 String fileURI = null;
45 String fileURI = null; 49 String vampireCode = null;
46 String vampireCode = null; 50 vampireCode = workspace.writeModelToString(vampireProblem, this.fileName);
47 if (vampireConfig.writeToFile) { 51 if (vampireConfig.writeToFile) {
48 fileURI = workspace.writeModel(vampireProblem, this.fileName).toFileString(); 52 fileURI = workspace.writeModel(vampireProblem, this.fileName).toFileString();
49 } else {
50 vampireCode = workspace.writeModelToString(vampireProblem, this.fileName);
51 }
52 long _currentTimeMillis = System.currentTimeMillis();
53 final long transformationTime = (_currentTimeMillis - transformationStart);
54 final PrintWriter out = new PrintWriter("output/files/vampireCode.tptp");
55 out.println(vampireCode);
56 out.close();
57 return null;
58 } catch (Throwable _e) {
59 throw Exceptions.sneakyThrow(_e);
60 } 53 }
54 long _currentTimeMillis = System.currentTimeMillis();
55 final long transformationTime = (_currentTimeMillis - transformationStart);
56 return null;
61 } 57 }
62 58
63 public VampireSolverConfiguration asConfig(final LogicSolverConfiguration configuration) { 59 public VampireSolverConfiguration asConfig(final LogicSolverConfiguration configuration) {
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper.xtendbin
index e4083dc1..d248b361 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapperTrace.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapperTrace.xtendbin
index bbda5634..d747e8ab 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapperTrace.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapperTrace.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_ConstantMapper.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_ConstantMapper.xtendbin
index 6c3f3a91..4dc095c0 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_ConstantMapper.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_ConstantMapper.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_RelationMapper.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_RelationMapper.xtendbin
index 9da7459d..9a948c6f 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_RelationMapper.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_RelationMapper.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_Support.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_Support.xtendbin
index 89400bab..4ef4809b 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_Support.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_Support.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper.xtendbin
index 6113caa7..0f4acafe 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbin
index d5504038..7d6865bb 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbin
index 3586a020..6db26bf7 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Vampire2LogicMapper.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Vampire2LogicMapper.xtendbin
new file mode 100644
index 00000000..8c96afa7
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.Vampire2LogicMapper.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireHandler.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireHandler.xtendbin
new file mode 100644
index 00000000..2427721d
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireHandler.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation.xtendbin
index 16b681bb..d2c93ab4 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbin b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbin
index c2f817a5..28c5d0f7 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbin
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbin
Binary files differ
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.gitignore b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.gitignore
index d27ff186..3d29fb07 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.gitignore
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/.gitignore
@@ -9,3 +9,31 @@
9/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.java._trace 9/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.java._trace
10/.Logic2VampireLanguageMapper_Support.java._trace 10/.Logic2VampireLanguageMapper_Support.java._trace
11/.Logic2VampireLanguageMapper_RelationMapper.java._trace 11/.Logic2VampireLanguageMapper_RelationMapper.java._trace
12/.Logic2VampireLanguageMapper.xtendbin
13/.Logic2VampireLanguageMapperTrace.xtendbin
14/.Logic2VampireLanguageMapper_ConstantMapper.xtendbin
15/.Logic2VampireLanguageMapper_RelationMapper.xtendbin
16/.Logic2VampireLanguageMapper_Support.xtendbin
17/.Logic2VampireLanguageMapper_TypeMapper.xtendbin
18/.Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.xtendbin
19/.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.xtendbin
20/.VampireModelInterpretation_TypeInterpretation.xtendbin
21/.VampireModelInterpretation_TypeInterpretation_FilteredTypes.xtendbin
22/Logic2VampireLanguageMapper.java
23/Logic2VampireLanguageMapperTrace.java
24/Logic2VampireLanguageMapper_ConstantMapper.java
25/Logic2VampireLanguageMapper_RelationMapper.java
26/Logic2VampireLanguageMapper_Support.java
27/Logic2VampireLanguageMapper_TypeMapper.java
28/Logic2VampireLanguageMapper_TypeMapperTrace.java
29/Logic2VampireLanguageMapper_TypeMapperTrace_FilteredTypes.java
30/Logic2VampireLanguageMapper_TypeMapper_FilteredTypes.java
31/VampireModelInterpretation_TypeInterpretation.java
32/VampireModelInterpretation_TypeInterpretation_FilteredTypes.java
33/.Vampire2LogicMapper.java._trace
34/.VampireHandler.java._trace
35/.MonitoredVampireSolution.java._trace
36/.SolverConfiguration.java._trace
37/.VampireSolverException.java._trace
38/.VampireSolutionModel.java._trace
39/.VampireCallerWithTimeout.java._trace
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java
index b2dd06ef..a1d80e58 100644
--- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper.java
@@ -90,7 +90,7 @@ public class Logic2VampireLanguageMapper {
90 this.typeMapper = typeMapper; 90 this.typeMapper = typeMapper;
91 } 91 }
92 92
93 public TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> transformProblem(final LogicProblem problem, final VampireSolverConfiguration configuration) { 93 public TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> transformProblem(final LogicProblem problem, final VampireSolverConfiguration config) {
94 VLSComment _createVLSComment = this.factory.createVLSComment(); 94 VLSComment _createVLSComment = this.factory.createVLSComment();
95 final Procedure1<VLSComment> _function = (VLSComment it) -> { 95 final Procedure1<VLSComment> _function = (VLSComment it) -> {
96 it.setComment("This is an initial Test Comment"); 96 it.setComment("This is an initial Test Comment");
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.java
new file mode 100644
index 00000000..f4380894
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Vampire2LogicMapper.java
@@ -0,0 +1,59 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder;
2
3import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapperTrace;
4import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.VampireSolutionModel;
5import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem;
6import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult;
7import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicresultFactory;
8import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.Statistics;
9import org.eclipse.xtext.xbase.lib.Extension;
10import org.eclipse.xtext.xbase.lib.Functions.Function2;
11import org.eclipse.xtext.xbase.lib.IterableExtensions;
12
13@SuppressWarnings("all")
14public class Vampire2LogicMapper {
15 @Extension
16 private final LogicresultFactory resultFactory = LogicresultFactory.eINSTANCE;
17
18 public LogicResult transformOutput(final LogicProblem problem, final int requiredNumberOfSolution, final VampireSolutionModel vampireSolution, final Logic2VampireLanguageMapperTrace trace, final long transformationTime) {
19 throw new Error("Unresolved compilation problems:"
20 + "\nThe method or field aswers is undefined for the type VampireSolutionModel"
21 + "\nThe method or field key is undefined for the type Object"
22 + "\nThe method or field monitoredAlloySolution is undefined"
23 + "\nThe method or field monitoredAlloySolution is undefined"
24 + "\nThe method or field monitoredAlloySolution is undefined"
25 + "\nThe method or field monitoredAlloySolution is undefined"
26 + "\nThe method transformStatistics(MonitoredAlloySolution, long) from the type Vampire2LogicMapper refers to the missing type MonitoredAlloySolution"
27 + "\nThe method transformStatistics(MonitoredAlloySolution, long) from the type Vampire2LogicMapper refers to the missing type MonitoredAlloySolution"
28 + "\nThe method transformStatistics(MonitoredAlloySolution, long) from the type Vampire2LogicMapper refers to the missing type MonitoredAlloySolution"
29 + "\nmap cannot be resolved"
30 + "\ntoList cannot be resolved"
31 + "\nfinishedBeforeTimeout cannot be resolved"
32 + "\n! cannot be resolved"
33 + "\nlast cannot be resolved"
34 + "\nsatisfiable cannot be resolved"
35 + "\n|| cannot be resolved");
36 }
37
38 public Statistics transformStatistics(final /* MonitoredAlloySolution */Object solution, final long transformationTime) {
39 throw new Error("Unresolved compilation problems:"
40 + "\nCannot cast from Object to int"
41 + "\nCannot cast from Object to int"
42 + "\naswers cannot be resolved"
43 + "\nsize cannot be resolved"
44 + "\naswers cannot be resolved"
45 + "\nget cannot be resolved"
46 + "\nvalue cannot be resolved"
47 + "\nintValue cannot be resolved"
48 + "\nkodkodTime cannot be resolved"
49 + "\nkodkodTime cannot be resolved"
50 + "\nwarnings cannot be resolved");
51 }
52
53 public Long sum(final Iterable<Long> ints) {
54 final Function2<Long, Long, Long> _function = (Long p1, Long p2) -> {
55 return Long.valueOf(((p1).longValue() + (p2).longValue()));
56 };
57 return IterableExtensions.<Long>reduce(ints, _function);
58 }
59}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.java
new file mode 100644
index 00000000..1cac2633
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireHandler.java
@@ -0,0 +1,12 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder;
2
3import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration;
4import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel;
5import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace;
6
7@SuppressWarnings("all")
8public class VampireHandler {
9 public Object callSolver(final VampireModel problem, final ReasonerWorkspace workspace, final VampireSolverConfiguration configuration, final String vampireCode) {
10 return null;
11 }
12}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolutionModel.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolutionModel.java
new file mode 100644
index 00000000..c665b9a6
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolutionModel.java
@@ -0,0 +1,35 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder;
2
3import org.eclipse.xtend.lib.annotations.Data;
4import org.eclipse.xtext.xbase.lib.Pure;
5import org.eclipse.xtext.xbase.lib.util.ToStringBuilder;
6
7@Data
8@SuppressWarnings("all")
9public class VampireSolutionModel {
10 @Override
11 @Pure
12 public int hashCode() {
13 int result = 1;
14 return result;
15 }
16
17 @Override
18 @Pure
19 public boolean equals(final Object obj) {
20 if (this == obj)
21 return true;
22 if (obj == null)
23 return false;
24 if (getClass() != obj.getClass())
25 return false;
26 return true;
27 }
28
29 @Override
30 @Pure
31 public String toString() {
32 ToStringBuilder b = new ToStringBuilder(this);
33 return b.toString();
34 }
35}
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolverException.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolverException.java
new file mode 100644
index 00000000..b96df82a
--- /dev/null
+++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/VampireSolverException.java
@@ -0,0 +1,19 @@
1package ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder;
2
3import java.util.List;
4import org.eclipse.xtext.xbase.lib.IterableExtensions;
5
6@SuppressWarnings("all")
7public class VampireSolverException extends Exception {
8 public VampireSolverException(final String s) {
9 super(s);
10 }
11
12 public VampireSolverException(final String s, final Exception e) {
13 super(s, e);
14 }
15
16 public VampireSolverException(final String s, final List<String> errors, final Exception e) {
17 super(((s + "\n") + IterableExtensions.join(errors, "\n")), e);
18 }
19}