diff options
author | 2023-09-16 13:19:31 +0200 | |
---|---|---|
committer | 2023-09-16 16:53:01 +0200 | |
commit | 97b0c4c1192fe5580a7957c844acc8092b56c604 (patch) | |
tree | bea3cdf9aaeb5da2864fcf87780d356661af8f63 /subprojects/viatra-runtime-rete-recipes | |
parent | build: fix Sonar quality gate issues (diff) | |
download | refinery-97b0c4c1192fe5580a7957c844acc8092b56c604.tar.gz refinery-97b0c4c1192fe5580a7957c844acc8092b56c604.tar.zst refinery-97b0c4c1192fe5580a7957c844acc8092b56c604.zip |
chore: remove VIATRA branding
Rename VIATRA subprojects to Refinery Interpreter to avoid interfering with
Eclipse Foundation trademarks.
Uses refering to a specific (historical) version of VIATRA were kept to avoid
ambiguity.
Diffstat (limited to 'subprojects/viatra-runtime-rete-recipes')
14 files changed, 0 insertions, 1050 deletions
diff --git a/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF b/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF deleted file mode 100644 index c732af46..00000000 --- a/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: %pluginName | ||
4 | Bundle-SymbolicName: viatra-runtime-rete-recipes;singleton:=true | ||
5 | Automatic-Module-Name: viatra-runtime-rete-recipes | ||
6 | Bundle-Version: 1.0.0.qualifier | ||
7 | Bundle-ClassPath: viatra-runtime-rete-recipes.jar | ||
8 | Bundle-Vendor: %providerName | ||
9 | Bundle-Localization: plugin | ||
10 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
11 | Export-Package: org.eclipse.viatra.query.runtime.rete.recipes, | ||
12 | org.eclipse.viatra.query.runtime.rete.recipes.impl, | ||
13 | org.eclipse.viatra.query.runtime.rete.recipes.util | ||
14 | Require-Bundle: org.eclipse.core.runtime, | ||
15 | org.eclipse.emf.ecore;visibility:=reexport, | ||
16 | org.eclipse.xtext.xbase.lib, | ||
17 | org.eclipse.emf.ecore.xcore.lib | ||
18 | Bundle-ActivationPolicy: lazy | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF.license b/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF.license deleted file mode 100644 index 03d1d42b..00000000 --- a/subprojects/viatra-runtime-rete-recipes/META-INF/MANIFEST.MF.license +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
2 | Copyright (c) 2023 The Refinery Authors <https://refinery.tools> | ||
3 | |||
4 | SPDX-License-Identifier: EPL-2.0 | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/about.html b/subprojects/viatra-runtime-rete-recipes/about.html deleted file mode 100644 index d1d5593a..00000000 --- a/subprojects/viatra-runtime-rete-recipes/about.html +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> | ||
2 | <html> | ||
3 | <!-- | ||
4 | Copyright (c) 2017, Eclipse.org Foundation, Inc. | ||
5 | |||
6 | SPDX-License-Identifier: LicenseRef-EPL-Steward | ||
7 | --> | ||
8 | <head> | ||
9 | <title>About</title> | ||
10 | <meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> | ||
11 | </head> | ||
12 | <body lang="EN-US"> | ||
13 | <h2>About This Content</h2> | ||
14 | |||
15 | <p>March 18, 2019</p> | ||
16 | <h3>License</h3> | ||
17 | |||
18 | <p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the | ||
19 | Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v20.php">http://www.eclipse.org/legal/epl-v20.html</a>. | ||
20 | For purposes of the EPL, "Program" will mean the Content.</p> | ||
21 | |||
22 | <p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may | ||
23 | apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise | ||
24 | indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> | ||
25 | </body> | ||
26 | </html> | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/build.gradle.kts b/subprojects/viatra-runtime-rete-recipes/build.gradle.kts deleted file mode 100644 index b0d0139a..00000000 --- a/subprojects/viatra-runtime-rete-recipes/build.gradle.kts +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | |||
7 | import tools.refinery.gradle.utils.SonarPropertiesUtils | ||
8 | |||
9 | plugins { | ||
10 | id("tools.refinery.gradle.java-library") | ||
11 | id("tools.refinery.gradle.mwe2") | ||
12 | id("tools.refinery.gradle.sonarqube") | ||
13 | // Vendor code from Eclipse VIATRA is maintained by the VIATRA project, | ||
14 | // so we don't need to keep track of coverage ourselves. | ||
15 | // Our own modifications are covered by tests in the `store-query-viatra` subproject. | ||
16 | id("tools.refinery.gradle.skip-coverage") | ||
17 | } | ||
18 | |||
19 | dependencies { | ||
20 | api(project(":refinery-viatra-runtime")) | ||
21 | api(libs.ecore) | ||
22 | mwe2(libs.ecore.codegen) | ||
23 | mwe2(libs.mwe.utils) | ||
24 | mwe2(libs.mwe2.lib) | ||
25 | mwe2(libs.slf4j.simple) | ||
26 | mwe2(libs.xtext.core) | ||
27 | mwe2(libs.xtext.xbase) | ||
28 | } | ||
29 | |||
30 | sourceSets { | ||
31 | main { | ||
32 | java.srcDir("src/main/emf-gen") | ||
33 | } | ||
34 | } | ||
35 | |||
36 | tasks { | ||
37 | val generateEPackage by registering(JavaExec::class) { | ||
38 | mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher") | ||
39 | classpath(configurations.mwe2) | ||
40 | inputs.file("src/main/java/tools/refinery/viatra/runtime/rete/recipes/GenerateReteRecipes.mwe2") | ||
41 | inputs.file("src/main/resources/model/recipes.ecore") | ||
42 | inputs.file("src/main/resources/model/rete-recipes.genmodel") | ||
43 | outputs.file("build.properties") | ||
44 | outputs.file("META-INF/MANIFEST.MF") | ||
45 | outputs.file("plugin.xml") | ||
46 | outputs.file("plugin.properties") | ||
47 | outputs.dir("src/main/emf-gen") | ||
48 | args("src/main/java/tools/refinery/viatra/runtime/rete/recipes/GenerateReteRecipes.mwe2", | ||
49 | "-p", "rootPath=/$projectDir") | ||
50 | } | ||
51 | |||
52 | for (taskName in listOf("compileJava", "processResources", "generateEclipseSourceFolders")) { | ||
53 | named(taskName) { | ||
54 | dependsOn(generateEPackage) | ||
55 | } | ||
56 | } | ||
57 | |||
58 | clean { | ||
59 | delete("src/main/emf-gen") | ||
60 | } | ||
61 | } | ||
62 | |||
63 | sonarqube.properties { | ||
64 | SonarPropertiesUtils.addToList(properties, "sonar.exclusions", "src/main/emf-gen/**") | ||
65 | } | ||
66 | |||
diff --git a/subprojects/viatra-runtime-rete-recipes/build.properties b/subprojects/viatra-runtime-rete-recipes/build.properties deleted file mode 100644 index 97e4d6bd..00000000 --- a/subprojects/viatra-runtime-rete-recipes/build.properties +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | # Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
2 | # This program and the accompanying materials are made available under the | ||
3 | # terms of the Eclipse Public License v. 2.0 which is available at | ||
4 | # http://www.eclipse.org/legal/epl-v20.html. | ||
5 | # | ||
6 | # SPDX-License-Identifier: EPL-2.0 | ||
7 | |||
8 | bin.includes = viatra-runtime-rete-recipes.jar,\ | ||
9 | model/,\ | ||
10 | META-INF/,\ | ||
11 | plugin.xml,\ | ||
12 | plugin.properties | ||
13 | jars.compile.order = viatra-runtime-rete-recipes.jar | ||
14 | source.viatra-runtime-rete-recipes.jar = src-gen/ | ||
15 | output.viatra-runtime-rete-recipes.jar = bin/ | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/plugin.properties b/subprojects/viatra-runtime-rete-recipes/plugin.properties deleted file mode 100644 index 43a7236d..00000000 --- a/subprojects/viatra-runtime-rete-recipes/plugin.properties +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | # Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
2 | # This program and the accompanying materials are made available under the | ||
3 | # terms of the Eclipse Public License v. 2.0 which is available at | ||
4 | # http://www.eclipse.org/legal/epl-v20.html. | ||
5 | # | ||
6 | # SPDX-License-Identifier: EPL-2.0 | ||
7 | |||
8 | pluginName = Rete-recipes Model | ||
9 | providerName = www.example.org | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/plugin.xml b/subprojects/viatra-runtime-rete-recipes/plugin.xml deleted file mode 100644 index e4917f5d..00000000 --- a/subprojects/viatra-runtime-rete-recipes/plugin.xml +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <?eclipse version="3.0"?> | ||
3 | |||
4 | <!-- | ||
5 | Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
6 | This program and the accompanying materials are made available under the | ||
7 | terms of the Eclipse Public License v. 2.0 which is available at | ||
8 | http://www.eclipse.org/legal/epl-v20.html. | ||
9 | |||
10 | SPDX-License-Identifier: EPL-2.0 | ||
11 | --> | ||
12 | |||
13 | <plugin> | ||
14 | |||
15 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
16 | <!-- @generated rete-recipes --> | ||
17 | <package | ||
18 | uri="https://refinery.tools/emf/2023/ViatraReteRecipes" | ||
19 | class="tools.refinery.viatra.runtime.rete.recipes.RecipesPackage" | ||
20 | genModel="src/main/resources/model/rete-recipes.genmodel"/> | ||
21 | </extension> | ||
22 | |||
23 | </plugin> | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/GenerateReteRecipes.mwe2 b/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/GenerateReteRecipes.mwe2 deleted file mode 100644 index 424cc9f5..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/GenerateReteRecipes.mwe2 +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | module tools.refinery.viatra.runtime.rete.recipes.GenerateReteRecipes | ||
7 | |||
8 | Workflow { | ||
9 | bean = org.eclipse.emf.mwe.utils.StandaloneSetup { | ||
10 | projectMapping = { | ||
11 | projectName = "tools.refinery.refinery-viatra-runtime-rete-recipes" | ||
12 | path = "." | ||
13 | } | ||
14 | } | ||
15 | |||
16 | component = org.eclipse.emf.mwe.utils.DirectoryCleaner { | ||
17 | directory = "src/main/emf-gen" | ||
18 | } | ||
19 | |||
20 | component = org.eclipse.emf.mwe2.ecore.EcoreGenerator { | ||
21 | generateCustomClasses = false | ||
22 | genModel = "platform:/resource/tools.refinery.refinery-viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel" | ||
23 | srcPath = "platform:/resource/tools.refinery.refinery-viatra-runtime-rete-recipes/src/main/emf-gen" | ||
24 | } | ||
25 | } | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipeRecognizer.java b/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipeRecognizer.java deleted file mode 100644 index 2c252593..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipeRecognizer.java +++ /dev/null | |||
@@ -1,204 +0,0 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2016, Gabor Bergmann, Istvan Rath and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.rete.recipes.helper; | ||
10 | |||
11 | import org.eclipse.emf.common.util.EList; | ||
12 | import org.eclipse.emf.ecore.EAttribute; | ||
13 | import org.eclipse.emf.ecore.EClass; | ||
14 | import org.eclipse.emf.ecore.EObject; | ||
15 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
16 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
17 | import tools.refinery.viatra.runtime.matchers.context.IQueryRuntimeContext; | ||
18 | import tools.refinery.viatra.runtime.rete.recipes.RecipesPackage; | ||
19 | import tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe; | ||
20 | |||
21 | import java.util.*; | ||
22 | |||
23 | /** | ||
24 | * Stores a set of known <em>canonical</em> recipes, each representing a disjoint equivalence class of recipes, modulo | ||
25 | * {@link #isEquivalentRecipe(ReteNodeRecipe, ReteNodeRecipe)}. | ||
26 | * | ||
27 | * @author Gabor Bergmann | ||
28 | * @since 1.3 | ||
29 | * | ||
30 | */ | ||
31 | public class RecipeRecognizer { | ||
32 | private static long nextRecipeEquivalenceClassID = 0; | ||
33 | |||
34 | /** | ||
35 | * if EcoreUtil.equals(recipe1, recipe2), only one of them will be included here | ||
36 | */ | ||
37 | Map<EClass, Set<ReteNodeRecipe>> canonicalRecipesByClass = new HashMap<>(); | ||
38 | Map<Long, ReteNodeRecipe> canonicalRecipeByEquivalenceClassID = new HashMap<>(); | ||
39 | |||
40 | private IQueryRuntimeContext runtimeContext; | ||
41 | |||
42 | /** | ||
43 | * @param can be null; if provided, further equivalences can be detected based on {@link IQueryRuntimeContext#wrapElement(Object)} | ||
44 | * @since 1.6 | ||
45 | */ | ||
46 | public RecipeRecognizer(IQueryRuntimeContext runtimeContext) { | ||
47 | this.runtimeContext = runtimeContext; | ||
48 | } | ||
49 | public RecipeRecognizer() { | ||
50 | this(null); | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * Recognizes when an equivalent canonical recipe is already known. | ||
55 | * | ||
56 | * @return an equivalent canonical recipe, or the null if no known equivalent found | ||
57 | */ | ||
58 | public ReteNodeRecipe peekCanonicalRecipe(final ReteNodeRecipe recipe) { | ||
59 | // equivalence class already known | ||
60 | for (Long classID : recipe.getEquivalenceClassIDs()) { | ||
61 | ReteNodeRecipe knownRecipe = canonicalRecipeByEquivalenceClassID.get(classID); | ||
62 | if (knownRecipe != null) | ||
63 | return knownRecipe; | ||
64 | } | ||
65 | |||
66 | // equivalence class not known, but maybe equivalent recipe still | ||
67 | // available | ||
68 | Collection<ReteNodeRecipe> sameClassRecipes = getSameClassCanonicalRecipes(recipe); | ||
69 | for (ReteNodeRecipe knownRecipe : sameClassRecipes) { | ||
70 | if (isEquivalentRecipe(recipe, knownRecipe)) { | ||
71 | // FOUND EQUIVALENT RECIPE | ||
72 | recipe.getEquivalenceClassIDs().add(knownRecipe.getEquivalenceClassIDs().get(0)); | ||
73 | return knownRecipe; | ||
74 | } | ||
75 | } | ||
76 | |||
77 | return null; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * This recipe will be remembered as a canonical recipe. Method maintains both internal data structures and the | ||
82 | * equivalence class attribute of the recipe. PRECONDITION: {@link #peekCanonicalRecipe(ReteNodeRecipe)} must return | ||
83 | * null or the recipe itself | ||
84 | */ | ||
85 | public void makeCanonical(final ReteNodeRecipe recipe) { | ||
86 | // this is a canonical recipe, chosen representative of its new | ||
87 | // equivalence class | ||
88 | if (recipe.getEquivalenceClassIDs().isEmpty()) { | ||
89 | recipe.getEquivalenceClassIDs().add(nextRecipeEquivalenceClassID++); | ||
90 | } | ||
91 | for (Long classID : recipe.getEquivalenceClassIDs()) { | ||
92 | canonicalRecipeByEquivalenceClassID.put(classID, recipe); | ||
93 | } | ||
94 | getSameClassCanonicalRecipes(recipe).add(recipe); | ||
95 | } | ||
96 | |||
97 | /** | ||
98 | * Ensures that there is an equivalent canonical recipe; if none is known yet, this recipe will be remembered as | ||
99 | * canonical. | ||
100 | * | ||
101 | * @return an equivalent canonical recipe; the argument recipe itself (which is made canonical) if no known | ||
102 | * equivalent found | ||
103 | */ | ||
104 | public ReteNodeRecipe canonicalizeRecipe(final ReteNodeRecipe recipe) { | ||
105 | ReteNodeRecipe knownRecipe = peekCanonicalRecipe(recipe); | ||
106 | if (knownRecipe == null) { | ||
107 | knownRecipe = recipe; | ||
108 | makeCanonical(recipe); | ||
109 | } | ||
110 | return knownRecipe; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * @return true iff recipe is a canonical recipe | ||
115 | */ | ||
116 | public boolean isKnownCanonicalRecipe(final ReteNodeRecipe recipe) { | ||
117 | if (recipe.getEquivalenceClassIDs().isEmpty()) { | ||
118 | return false; | ||
119 | } | ||
120 | ReteNodeRecipe knownRecipe = canonicalRecipeByEquivalenceClassID.get(recipe.getEquivalenceClassIDs().get(0)); | ||
121 | return recipe == knownRecipe; | ||
122 | } | ||
123 | |||
124 | private Set<ReteNodeRecipe> getSameClassCanonicalRecipes(final ReteNodeRecipe recipe) { | ||
125 | Set<ReteNodeRecipe> sameClassRecipes = canonicalRecipesByClass.get(recipe.eClass()); | ||
126 | if (sameClassRecipes == null) { | ||
127 | sameClassRecipes = new HashSet<>(); | ||
128 | canonicalRecipesByClass.put(recipe.eClass(), sameClassRecipes); | ||
129 | } | ||
130 | return sameClassRecipes; | ||
131 | } | ||
132 | |||
133 | private boolean isEquivalentRecipe(ReteNodeRecipe recipe, ReteNodeRecipe knownRecipe) { | ||
134 | return new EqualityHelper(runtimeContext).equals(recipe, knownRecipe); | ||
135 | } | ||
136 | |||
137 | // TODO reuse in more cases later, e.g. switching join node parents, etc. | ||
138 | private static class EqualityHelper extends EcoreUtil.EqualityHelper { | ||
139 | |||
140 | |||
141 | |||
142 | |||
143 | private static final long serialVersionUID = -8841971394686015188L; | ||
144 | |||
145 | private static final EAttribute RETE_NODE_RECIPE_EQUIVALENCE_CLASS_IDS = | ||
146 | RecipesPackage.eINSTANCE.getReteNodeRecipe_EquivalenceClassIDs(); | ||
147 | private static final EAttribute CONSTANT_RECIPE_CONSTANT_VALUES = | ||
148 | RecipesPackage.eINSTANCE.getConstantRecipe_ConstantValues(); | ||
149 | private static final EAttribute DISCRIMINATOR_BUCKET_RECIPE_BUCKET_KEY = | ||
150 | RecipesPackage.eINSTANCE.getDiscriminatorBucketRecipe_BucketKey(); | ||
151 | |||
152 | private IQueryRuntimeContext runtimeContext; | ||
153 | |||
154 | public EqualityHelper(IQueryRuntimeContext runtimeContext) { | ||
155 | this.runtimeContext = runtimeContext; | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | protected boolean haveEqualFeature(EObject eObject1, EObject eObject2, EStructuralFeature feature) { | ||
160 | // ignore differences in this attribute, as it may only be assigned | ||
161 | // after the equivalence check | ||
162 | if (RETE_NODE_RECIPE_EQUIVALENCE_CLASS_IDS.equals(feature)) | ||
163 | return true; | ||
164 | |||
165 | if (runtimeContext != null) { | ||
166 | // constant values | ||
167 | if (/*CONSTANT_RECIPE_CONSTANT_VALUES.equals(feature) ||*/ DISCRIMINATOR_BUCKET_RECIPE_BUCKET_KEY.equals(feature)) { | ||
168 | // use runtime context to map to canonical wrapped form | ||
169 | // this is costly for constant recipes (TODO improve this), but essential for discriminator buckets | ||
170 | |||
171 | Object val1 = eObject1.eGet(feature); | ||
172 | Object val2 = eObject2.eGet(feature); | ||
173 | |||
174 | if (val1 != null && val2 != null) { | ||
175 | return runtimeContext.wrapElement(val1).equals(runtimeContext.wrapElement(val2)); | ||
176 | } else { | ||
177 | return val1 == null && val2 == null; | ||
178 | } | ||
179 | |||
180 | } | ||
181 | } | ||
182 | |||
183 | // fallback to general comparison | ||
184 | return super.haveEqualFeature(eObject1, eObject2, feature); | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public boolean equals(EObject eObject1, EObject eObject2) { | ||
189 | // short-circuit if already known to be equivalent | ||
190 | if (eObject1 instanceof ReteNodeRecipe) { | ||
191 | if (eObject2 instanceof ReteNodeRecipe) { | ||
192 | EList<Long> eqClassIDs1 = ((ReteNodeRecipe) eObject1).getEquivalenceClassIDs(); | ||
193 | EList<Long> eqClassIDs2 = ((ReteNodeRecipe) eObject2).getEquivalenceClassIDs(); | ||
194 | |||
195 | if (!Collections.disjoint(eqClassIDs1, eqClassIDs2)) | ||
196 | return true; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | // fallback to general comparison | ||
201 | return super.equals(eObject1, eObject2); | ||
202 | } | ||
203 | } | ||
204 | } | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipesHelper.java b/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipesHelper.java deleted file mode 100644 index 3070fcf5..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/java/tools/refinery/viatra/runtime/rete/recipes/helper/RecipesHelper.java +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | /** | ||
2 | * Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | */ | ||
9 | package tools.refinery.viatra.runtime.rete.recipes.helper; | ||
10 | |||
11 | import org.eclipse.emf.common.util.EList; | ||
12 | import tools.refinery.viatra.runtime.rete.recipes.*; | ||
13 | |||
14 | import java.util.Collection; | ||
15 | |||
16 | /** | ||
17 | * Static helper class for easy construction of recipes. | ||
18 | * | ||
19 | * @author Bergmann Gabor | ||
20 | */ | ||
21 | public class RecipesHelper { | ||
22 | private static final RecipesFactory FACTORY = RecipesFactory.eINSTANCE; | ||
23 | |||
24 | private RecipesHelper() {/* Utility class constructor */} | ||
25 | |||
26 | /** | ||
27 | * @since 2.0 | ||
28 | */ | ||
29 | public static Mask mask(final int sourceArity, final Collection<Integer> sourceIndices) { | ||
30 | Mask mask = RecipesHelper.FACTORY.createMask(); | ||
31 | mask.setSourceArity(sourceArity); | ||
32 | mask.getSourceIndices().addAll(sourceIndices); | ||
33 | return mask; | ||
34 | } | ||
35 | |||
36 | public static Mask mask(final int sourceArity, final int... sourceIndices) { | ||
37 | Mask mask = RecipesHelper.FACTORY.createMask(); | ||
38 | mask.setSourceArity(sourceArity); | ||
39 | final EList<Integer> maskIndeces = mask.getSourceIndices(); | ||
40 | for (int index : sourceIndices) { | ||
41 | maskIndeces.add(index); | ||
42 | } | ||
43 | return mask; | ||
44 | } | ||
45 | |||
46 | public static ProjectionIndexerRecipe projectionIndexerRecipe(final ReteNodeRecipe parent, final Mask mask) { | ||
47 | ProjectionIndexerRecipe recipe = RecipesHelper.FACTORY.createProjectionIndexerRecipe(); | ||
48 | recipe.setParent(parent); | ||
49 | recipe.setMask(mask); | ||
50 | return recipe; | ||
51 | } | ||
52 | |||
53 | public static ExpressionDefinition expressionDefinition(final Object evaluator) { | ||
54 | ExpressionDefinition definition = RecipesHelper.FACTORY.createExpressionDefinition(); | ||
55 | definition.setEvaluator(evaluator); | ||
56 | return definition; | ||
57 | } | ||
58 | |||
59 | public static InputRecipe inputRecipe(final Object inputKey, final String inputKeyID, final int arity) { | ||
60 | InputRecipe recipe = RecipesHelper.FACTORY.createInputRecipe(); | ||
61 | recipe.setInputKey(inputKey); | ||
62 | recipe.setKeyArity(arity); | ||
63 | recipe.setKeyID(inputKeyID); | ||
64 | recipe.setTraceInfo(inputKeyID); | ||
65 | return recipe; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * Mask can be null in case no tuple reordering or trimming is needed | ||
70 | */ | ||
71 | public static InputFilterRecipe inputFilterRecipe(final ReteNodeRecipe parent, final Object inputKey, | ||
72 | final String inputKeyID, final Mask mask) { | ||
73 | InputFilterRecipe it = RecipesHelper.FACTORY.createInputFilterRecipe(); | ||
74 | it.setParent(parent); | ||
75 | it.setInputKey(inputKey); | ||
76 | it.setKeyID(inputKeyID); | ||
77 | it.setTraceInfo(inputKeyID); | ||
78 | it.setMask(mask); | ||
79 | return it; | ||
80 | } | ||
81 | } | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore b/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore deleted file mode 100644 index 4eda701e..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore +++ /dev/null | |||
@@ -1,400 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="recipes" nsURI="https://refinery.tools/emf/2023/ViatraReteRecipes" | ||
4 | nsPrefix="recipes"> | ||
5 | <eClassifiers xsi:type="ecore:EClass" name="ReteRecipe"> | ||
6 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
7 | <details key="documentation" value="Container for Rete recipes."/> | ||
8 | </eAnnotations> | ||
9 | <eStructuralFeatures xsi:type="ecore:EReference" name="recipeNodes" upperBound="-1" | ||
10 | eType="#//ReteNodeRecipe" containment="true" resolveProxies="false"/> | ||
11 | </eClassifiers> | ||
12 | <eClassifiers xsi:type="ecore:EClass" name="ReteNodeRecipe" abstract="true"> | ||
13 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
14 | <details key="documentation" value="Abstract base class for model elements that represent "Rete node recipes",
that is DTOs that carry information for Rete network construction.

@noimplement"/> | ||
15 | </eAnnotations> | ||
16 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
17 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
18 | <details key="documentation" value=" The width of tuples contained by this node."/> | ||
19 | <details key="body" value="throw new <%java.lang.UnsupportedOperationException%>();"/> | ||
20 | </eAnnotations> | ||
21 | </eOperations> | ||
22 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="traceInfo" unique="false" | ||
23 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"> | ||
24 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
25 | <details key="documentation" value="Temporary construct for storing traceability information."/> | ||
26 | </eAnnotations> | ||
27 | </eStructuralFeatures> | ||
28 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="equivalenceClassIDs" upperBound="-1" | ||
29 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong" transient="true"> | ||
30 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
31 | <details key="documentation" value="If two recipes were found equivalent, a matching equivalence ID can be assigned to them by {@link RecipeRecognizer}. 
If two recipes share (at least one) equivalence ID, they are known to be equivalent.

<p>
A difference in this attribute only does not preclude two recipe elements to be considered equal. 
If they are shown to be equivalent using deeper analysis, equivalence ids can be set so that the equivalence is recognized more easily the next time.

@since 1.3"/> | ||
32 | </eAnnotations> | ||
33 | </eStructuralFeatures> | ||
34 | </eClassifiers> | ||
35 | <eClassifiers xsi:type="ecore:EClass" name="SingleParentNodeRecipe" abstract="true" | ||
36 | eSuperTypes="#//ReteNodeRecipe"> | ||
37 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
38 | <details key="documentation" value="Abstract base class for single-parent node recipes."/> | ||
39 | </eAnnotations> | ||
40 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//ReteNodeRecipe"/> | ||
41 | </eClassifiers> | ||
42 | <eClassifiers xsi:type="ecore:EClass" name="AlphaRecipe" abstract="true" eSuperTypes="#//SingleParentNodeRecipe"> | ||
43 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
44 | <details key="documentation" value="Abstract base class for alpha node recipes."/> | ||
45 | </eAnnotations> | ||
46 | </eClassifiers> | ||
47 | <eClassifiers xsi:type="ecore:EClass" name="MultiParentNodeRecipe" abstract="true" | ||
48 | eSuperTypes="#//ReteNodeRecipe"> | ||
49 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
50 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
51 | <details key="body" value="<%org.eclipse.emf.common.util.EList%><<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%>> _parents = this.getParents();
<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _get = _parents.get(0);
return _get.getArity();"/> | ||
52 | </eAnnotations> | ||
53 | </eOperations> | ||
54 | <eStructuralFeatures xsi:type="ecore:EReference" name="parents" upperBound="-1" | ||
55 | eType="#//ReteNodeRecipe"/> | ||
56 | </eClassifiers> | ||
57 | <eClassifiers xsi:type="ecore:EClass" name="MonotonicityInfo"> | ||
58 | <eStructuralFeatures xsi:type="ecore:EReference" name="coreMask" eType="#//Mask" | ||
59 | containment="true" resolveProxies="false"/> | ||
60 | <eStructuralFeatures xsi:type="ecore:EReference" name="posetMask" eType="#//Mask" | ||
61 | containment="true" resolveProxies="false"/> | ||
62 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="posetComparator" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> | ||
63 | </eClassifiers> | ||
64 | <eClassifiers xsi:type="ecore:EClass" name="UniquenessEnforcerRecipe" eSuperTypes="#//MultiParentNodeRecipe #//RederivableNodeRecipe"> | ||
65 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
66 | <details key="documentation" value="Represents nodes that enforce tuple uniqueness, i.e. filter out
duplicate input tuples for output."/> | ||
67 | </eAnnotations> | ||
68 | </eClassifiers> | ||
69 | <eClassifiers xsi:type="ecore:EClass" name="ProductionRecipe" eSuperTypes="#//MultiParentNodeRecipe #//RederivableNodeRecipe"> | ||
70 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
71 | <details key="documentation" value="The production node represents the output of the Rete network,
from which the results of a query can be read."/> | ||
72 | </eAnnotations> | ||
73 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
74 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
75 | <details key="body" value="return this.getMappedIndices().size();"/> | ||
76 | </eAnnotations> | ||
77 | </eOperations> | ||
78 | <eStructuralFeatures xsi:type="ecore:EReference" name="mappedIndices" upperBound="-1" | ||
79 | eType="#//StringIndexMapEntry" containment="true" resolveProxies="false"> | ||
80 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
81 | <details key="documentation" value="String -> Index map.
Indicates the positions of parameters."/> | ||
82 | </eAnnotations> | ||
83 | </eStructuralFeatures> | ||
84 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="pattern" unique="false" | ||
85 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"> | ||
86 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
87 | <details key="documentation" value="Traceability link to defining pattern object (from EMFPatternLanguage)
TODO unused?"/> | ||
88 | </eAnnotations> | ||
89 | </eStructuralFeatures> | ||
90 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="patternFQN" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
91 | </eClassifiers> | ||
92 | <eClassifiers xsi:type="ecore:EClass" name="IndexerRecipe" abstract="true" eSuperTypes="#//SingleParentNodeRecipe"> | ||
93 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
94 | <details key="documentation" value="Represents a node that indexes the contents of a parent based on a projection defined by a Mask."/> | ||
95 | </eAnnotations> | ||
96 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
97 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
98 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = this.getMask();
return _mask.getSourceArity();"/> | ||
99 | </eAnnotations> | ||
100 | </eOperations> | ||
101 | <eStructuralFeatures xsi:type="ecore:EReference" name="mask" eType="#//Mask" containment="true" | ||
102 | resolveProxies="false"/> | ||
103 | </eClassifiers> | ||
104 | <eClassifiers xsi:type="ecore:EClass" name="ProjectionIndexerRecipe" eSuperTypes="#//IndexerRecipe"> | ||
105 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
106 | <details key="documentation" value="Represents helper nodes that provide projection indexing for Beta nodes and user queries."/> | ||
107 | </eAnnotations> | ||
108 | </eClassifiers> | ||
109 | <eClassifiers xsi:type="ecore:EClass" name="AggregatorIndexerRecipe" eSuperTypes="#//IndexerRecipe"> | ||
110 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
111 | <details key="documentation" value="Attached to an aggregator node, provides the aggregated values for outer join."/> | ||
112 | </eAnnotations> | ||
113 | </eClassifiers> | ||
114 | <eClassifiers xsi:type="ecore:EClass" name="BetaRecipe" abstract="true" eSuperTypes="#//ReteNodeRecipe"> | ||
115 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
116 | <details key="documentation" value="Abstract base class for Beta node recipes."/> | ||
117 | </eAnnotations> | ||
118 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftParent" eType="#//ProjectionIndexerRecipe" | ||
119 | containment="true" resolveProxies="false"/> | ||
120 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightParent" eType="#//IndexerRecipe" | ||
121 | containment="true" resolveProxies="false"> | ||
122 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
123 | <details key="documentation" value=" can be an AggregatorIndexer"/> | ||
124 | </eAnnotations> | ||
125 | </eStructuralFeatures> | ||
126 | </eClassifiers> | ||
127 | <eClassifiers xsi:type="ecore:EClass" name="Mask"> | ||
128 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
129 | <details key="documentation" value="A mask defines the set of tuple variables that need to be taken into consideration for operations."/> | ||
130 | </eAnnotations> | ||
131 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="sourceIndices" unique="false" | ||
132 | upperBound="-1" eType="#//Index"> | ||
133 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
134 | <details key="documentation" value="The indices that are relevant for tuple operations."/> | ||
135 | </eAnnotations> | ||
136 | </eStructuralFeatures> | ||
137 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="sourceArity" unique="false" | ||
138 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
139 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
140 | <details key="documentation" value="The arity of tuples."/> | ||
141 | </eAnnotations> | ||
142 | </eStructuralFeatures> | ||
143 | </eClassifiers> | ||
144 | <eClassifiers xsi:type="ecore:EDataType" name="Index" instanceClassName="java.lang.Integer"> | ||
145 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
146 | <details key="documentation" value="Indexes tell which variable of tuples are relevant for a given operation.
TODO: is this necessary at all?"/> | ||
147 | </eAnnotations> | ||
148 | </eClassifiers> | ||
149 | <eClassifiers xsi:type="ecore:EClass" name="StringIndexMapEntry" instanceClassName="java.util.Map$Entry"> | ||
150 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="key" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
151 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" unique="false" eType="#//Index"/> | ||
152 | </eClassifiers> | ||
153 | <eClassifiers xsi:type="ecore:EClass" name="InputRecipe" eSuperTypes="#//ReteNodeRecipe"> | ||
154 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
155 | <details key="documentation" value="Represents input nodes for the Rete network, i.e. nodes
that generate input tuples for processing."/> | ||
156 | </eAnnotations> | ||
157 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
158 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
159 | <details key="body" value="return getKeyArity();"/> | ||
160 | </eAnnotations> | ||
161 | </eOperations> | ||
162 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="inputKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject" | ||
163 | transient="true"/> | ||
164 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="keyID" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"> | ||
165 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
166 | <details key="documentation" value="Temporary construct for identifying types over the wire.
TODO improve type references"/> | ||
167 | </eAnnotations> | ||
168 | </eStructuralFeatures> | ||
169 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="keyArity" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
170 | </eClassifiers> | ||
171 | <eClassifiers xsi:type="ecore:EClass" name="ConstantRecipe" eSuperTypes="#//ReteNodeRecipe"> | ||
172 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
173 | <details key="documentation" value="Simple node that stores constant values."/> | ||
174 | </eAnnotations> | ||
175 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
176 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
177 | <details key="body" value="return this.getConstantValues().size();"/> | ||
178 | </eAnnotations> | ||
179 | </eOperations> | ||
180 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="constantValues" unique="false" | ||
181 | upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"> | ||
182 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
183 | <details key="documentation" value="Stores constant values. May be empty.

TODO store constants as strings instead? (for easier serialization)"/> | ||
184 | </eAnnotations> | ||
185 | </eStructuralFeatures> | ||
186 | </eClassifiers> | ||
187 | <eClassifiers xsi:type="ecore:EClass" name="TransitiveClosureRecipe" eSuperTypes="#//AlphaRecipe"> | ||
188 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
189 | <details key="documentation" value="Represents transitive closure."/> | ||
190 | </eAnnotations> | ||
191 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
192 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
193 | <details key="body" value="return 2;"/> | ||
194 | </eAnnotations> | ||
195 | </eOperations> | ||
196 | </eClassifiers> | ||
197 | <eClassifiers xsi:type="ecore:EClass" name="FilterRecipe" abstract="true" eSuperTypes="#//AlphaRecipe"> | ||
198 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
199 | <details key="documentation" value="Abstract base class for nodes that implement filtering operations."/> | ||
200 | </eAnnotations> | ||
201 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
202 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
203 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
204 | </eAnnotations> | ||
205 | </eOperations> | ||
206 | </eClassifiers> | ||
207 | <eClassifiers xsi:type="ecore:EClass" name="InequalityFilterRecipe" eSuperTypes="#//FilterRecipe"> | ||
208 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="subject" unique="false" | ||
209 | eType="#//Index"/> | ||
210 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="inequals" unique="false" | ||
211 | upperBound="-1" eType="#//Index"/> | ||
212 | </eClassifiers> | ||
213 | <eClassifiers xsi:type="ecore:EClass" name="EqualityFilterRecipe" eSuperTypes="#//FilterRecipe"> | ||
214 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="indices" unique="false" | ||
215 | upperBound="-1" eType="#//Index"/> | ||
216 | </eClassifiers> | ||
217 | <eClassifiers xsi:type="ecore:EClass" name="TransparentRecipe" eSuperTypes="#//FilterRecipe"/> | ||
218 | <eClassifiers xsi:type="ecore:EClass" name="TrimmerRecipe" eSuperTypes="#//AlphaRecipe"> | ||
219 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
220 | <details key="documentation" value="Implements projection without uniqueness checking."/> | ||
221 | </eAnnotations> | ||
222 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
223 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
224 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = this.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
return _sourceIndices.size();"/> | ||
225 | </eAnnotations> | ||
226 | </eOperations> | ||
227 | <eStructuralFeatures xsi:type="ecore:EReference" name="mask" eType="#//Mask" containment="true" | ||
228 | resolveProxies="false"/> | ||
229 | </eClassifiers> | ||
230 | <eClassifiers xsi:type="ecore:EClass" name="ExpressionDefinition"> | ||
231 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="evaluator" unique="false" | ||
232 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> | ||
233 | </eClassifiers> | ||
234 | <eClassifiers xsi:type="ecore:EClass" name="ExpressionEnforcerRecipe" abstract="true" | ||
235 | eSuperTypes="#//AlphaRecipe"> | ||
236 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
237 | <details key="documentation" value="type RuntimeExpressionEvaluator wraps tools.refinery.viatra.runtime.matchers.psystem.IExpressionEvaluator
class RuntimeExpressionDefinition extends ExpressionDefinition {
	RuntimeExpressionEvaluator evaluator
}"/> | ||
238 | </eAnnotations> | ||
239 | <eStructuralFeatures xsi:type="ecore:EReference" name="expression" eType="#//ExpressionDefinition" | ||
240 | containment="true" resolveProxies="false"> | ||
241 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
242 | <details key="documentation" value="Provides traceability to expression representation."/> | ||
243 | </eAnnotations> | ||
244 | </eStructuralFeatures> | ||
245 | <eStructuralFeatures xsi:type="ecore:EReference" name="mappedIndices" upperBound="-1" | ||
246 | eType="#//StringIndexMapEntry" containment="true" resolveProxies="false"> | ||
247 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
248 | <details key="documentation" value="String -> Index map.
Maps variable names in the expression to tuple indices."/> | ||
249 | </eAnnotations> | ||
250 | </eStructuralFeatures> | ||
251 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="cacheOutput" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | ||
252 | </eClassifiers> | ||
253 | <eClassifiers xsi:type="ecore:EClass" name="CheckRecipe" eSuperTypes="#//ExpressionEnforcerRecipe"> | ||
254 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
255 | <details key="documentation" value="Computes the result of the boolean expression evaluation and
only passes tuples for which the result is true."/> | ||
256 | </eAnnotations> | ||
257 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
258 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
259 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
260 | </eAnnotations> | ||
261 | </eOperations> | ||
262 | </eClassifiers> | ||
263 | <eClassifiers xsi:type="ecore:EClass" name="EvalRecipe" eSuperTypes="#//ExpressionEnforcerRecipe"> | ||
264 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
265 | <details key="documentation" value="Computes the result of expression evaluation and suffixes the result
to output tuples as the last element."/> | ||
266 | </eAnnotations> | ||
267 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
268 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
269 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
int _arity = _parent.getArity();
return (1 + _arity);"/> | ||
270 | </eAnnotations> | ||
271 | </eOperations> | ||
272 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="unwinding" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> | ||
273 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
274 | <details key="documentation" value="@since 2.4"/> | ||
275 | </eAnnotations> | ||
276 | </eStructuralFeatures> | ||
277 | </eClassifiers> | ||
278 | <eClassifiers xsi:type="ecore:EClass" name="IndexerBasedAggregatorRecipe" abstract="true" | ||
279 | eSuperTypes="#//ReteNodeRecipe"> | ||
280 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
281 | <details key="documentation" value="Represents a (compound) node that performs an aggregation operation.
Parent must be a ProjectionIndexer, which defines how tuples are to be aggregated.
Usable only through an Join with an AggregatorIndexer as the right parent"/> | ||
282 | </eAnnotations> | ||
283 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
284 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
285 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _parent = this.getParent();
<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = _parent.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
int _size = _sourceIndices.size();
return (1 + _size);"/> | ||
286 | </eAnnotations> | ||
287 | </eOperations> | ||
288 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//ProjectionIndexerRecipe" | ||
289 | containment="true" resolveProxies="false"/> | ||
290 | </eClassifiers> | ||
291 | <eClassifiers xsi:type="ecore:EClass" name="CountAggregatorRecipe" eSuperTypes="#//IndexerBasedAggregatorRecipe"> | ||
292 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
293 | <details key="documentation" value="The count aggregator node represents a "count find" operation."/> | ||
294 | </eAnnotations> | ||
295 | </eClassifiers> | ||
296 | <eClassifiers xsi:type="ecore:EClass" name="JoinRecipe" eSuperTypes="#//BetaRecipe"> | ||
297 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
298 | <details key="documentation" value="The most basic beta operation, the join node performs a join operation over two input tuple sets."/> | ||
299 | </eAnnotations> | ||
300 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
301 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
302 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _leftParent = this.getLeftParent();
int _arity = _leftParent.getArity();
<%tools.refinery.viatra.runtime.rete.recipes.IndexerRecipe%> _rightParent = this.getRightParent();
int _arity_1 = _rightParent.getArity();
int _plus = (_arity + _arity_1);
<%tools.refinery.viatra.runtime.rete.recipes.IndexerRecipe%> _rightParent_1 = this.getRightParent();
<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = _rightParent_1.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
int _size = _sourceIndices.size();
return (_plus - _size);"/> | ||
303 | </eAnnotations> | ||
304 | </eOperations> | ||
305 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightParentComplementaryMask" | ||
306 | eType="#//Mask" containment="true" resolveProxies="false"/> | ||
307 | </eClassifiers> | ||
308 | <eClassifiers xsi:type="ecore:EClass" name="ExistenceJoinRecipe" abstract="true" | ||
309 | eSuperTypes="#//BetaRecipe"> | ||
310 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
311 | <details key="documentation" value="Existence joins are TODO

See http://en.wikipedia.org/wiki/Relational_algebra"/> | ||
312 | </eAnnotations> | ||
313 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
314 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
315 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _leftParent = this.getLeftParent();
return _leftParent.getArity();"/> | ||
316 | </eAnnotations> | ||
317 | </eOperations> | ||
318 | </eClassifiers> | ||
319 | <eClassifiers xsi:type="ecore:EClass" name="SemiJoinRecipe" eSuperTypes="#//ExistenceJoinRecipe"> | ||
320 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
321 | <details key="documentation" value="A semi-join is TODO

See http://en.wikipedia.org/wiki/Relational_algebra"/> | ||
322 | </eAnnotations> | ||
323 | </eClassifiers> | ||
324 | <eClassifiers xsi:type="ecore:EClass" name="AntiJoinRecipe" eSuperTypes="#//ExistenceJoinRecipe"> | ||
325 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
326 | <details key="documentation" value="An anti-join is TODO

See http://en.wikipedia.org/wiki/Relational_algebra"/> | ||
327 | </eAnnotations> | ||
328 | </eClassifiers> | ||
329 | <eClassifiers xsi:type="ecore:EClass" name="InputFilterRecipe" eSuperTypes="#//FilterRecipe"> | ||
330 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="inputKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject" | ||
331 | transient="true"/> | ||
332 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="keyID" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"> | ||
333 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
334 | <details key="documentation" value="Temporary construct for identifying types over the wire.
TODO improve type references"/> | ||
335 | </eAnnotations> | ||
336 | </eStructuralFeatures> | ||
337 | <eStructuralFeatures xsi:type="ecore:EReference" name="mask" eType="#//Mask" containment="true" | ||
338 | resolveProxies="false"/> | ||
339 | </eClassifiers> | ||
340 | <eClassifiers xsi:type="ecore:EClass" name="SingleColumnAggregatorRecipe" eSuperTypes="#//AlphaRecipe #//RederivableNodeRecipe"> | ||
341 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
342 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
343 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.MonotonicityInfo%> info = getOptionalMonotonicityInfo();
if (info == null) {
	return 1 + getGroupByMask().getSourceIndices().size();
} else {	
	return info.getCoreMask().getSourceIndices().size() + info.getPosetMask().getSourceIndices().size();
}"/> | ||
344 | </eAnnotations> | ||
345 | </eOperations> | ||
346 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="multisetAggregationOperator" | ||
347 | eType="#//AggregationOperator"/> | ||
348 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="aggregableIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
349 | <eStructuralFeatures xsi:type="ecore:EReference" name="groupByMask" lowerBound="1" | ||
350 | eType="#//Mask" containment="true"/> | ||
351 | </eClassifiers> | ||
352 | <eClassifiers xsi:type="ecore:EDataType" name="AggregationOperator" instanceTypeName="tools.refinery.viatra.runtime.matchers.psystem.aggregations.IMultisetAggregationOperator<?, ?, ?>"/> | ||
353 | <eClassifiers xsi:type="ecore:EClass" name="DiscriminatorDispatcherRecipe" eSuperTypes="#//SingleParentNodeRecipe"> | ||
354 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
355 | <details key="documentation" value="Node that sends tuples off to different buckets (attached as children) based on the value of a given column."/> | ||
356 | </eAnnotations> | ||
357 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
358 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
359 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
360 | </eAnnotations> | ||
361 | </eOperations> | ||
362 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminationColumnIndex" | ||
363 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
364 | </eClassifiers> | ||
365 | <eClassifiers xsi:type="ecore:EClass" name="DiscriminatorBucketRecipe" eSuperTypes="#//SingleParentNodeRecipe"> | ||
366 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
367 | <details key="documentation" value="A bucket holds a filtered set of tuples of its parent DiscriminatorDispatcher; exactly those that have the given bucket key at their discrimination column."/> | ||
368 | </eAnnotations> | ||
369 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
370 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
371 | <details key="body" value="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
372 | </eAnnotations> | ||
373 | </eOperations> | ||
374 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="bucketKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> | ||
375 | </eClassifiers> | ||
376 | <eClassifiers xsi:type="ecore:EClass" name="RederivableNodeRecipe" abstract="true"> | ||
377 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteRederiveEvaluation" | ||
378 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/> | ||
379 | <eStructuralFeatures xsi:type="ecore:EReference" name="optionalMonotonicityInfo" | ||
380 | eType="#//MonotonicityInfo" containment="true"/> | ||
381 | </eClassifiers> | ||
382 | <eClassifiers xsi:type="ecore:EClass" name="RelationEvaluationRecipe" eSuperTypes="#//MultiParentNodeRecipe"> | ||
383 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
384 | <details key="documentation" value="@since 2.8"/> | ||
385 | </eAnnotations> | ||
386 | <eStructuralFeatures xsi:type="ecore:EReference" name="evaluator" eType="#//ExpressionDefinition"/> | ||
387 | </eClassifiers> | ||
388 | <eClassifiers xsi:type="ecore:EClass" name="RepresentativeElectionRecipe" eSuperTypes="#//AlphaRecipe"> | ||
389 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
390 | <details key="documentation" value="Represents represenative election."/> | ||
391 | </eAnnotations> | ||
392 | <eOperations name="getArity" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"> | ||
393 | <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> | ||
394 | <details key="body" value="return 2;"/> | ||
395 | </eAnnotations> | ||
396 | </eOperations> | ||
397 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="connectivity" eType="#//Connectivity"/> | ||
398 | </eClassifiers> | ||
399 | <eClassifiers xsi:type="ecore:EDataType" name="Connectivity" instanceClassName="tools.refinery.viatra.runtime.matchers.psystem.basicenumerables.Connectivity"/> | ||
400 | </ecore:EPackage> | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore.license b/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore.license deleted file mode 100644 index 03d1d42b..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/recipes.ecore.license +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
2 | Copyright (c) 2023 The Refinery Authors <https://refinery.tools> | ||
3 | |||
4 | SPDX-License-Identifier: EPL-2.0 | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel b/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel deleted file mode 100644 index 6b44fde6..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel +++ /dev/null | |||
@@ -1,171 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" | ||
3 | xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro
Copyright (c) 2023 The Refinery Authors <https://refinery.tools>
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-v20.html.

SPDX-License-Identifier: EPL-2.0" | ||
4 | modelDirectory="/tools.refinery.refinery-viatra-runtime-rete-recipes/src/main/emf-gen" | ||
5 | modelPluginID="viatra-runtime-rete-recipes" runtimeJar="true" forceOverwrite="true" | ||
6 | modelName="Rete-recipes" updateClasspath="false" nonNLSMarkers="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
7 | testsDirectory="" importerID="org.eclipse.emf.importer.ecore" containmentProxies="true" | ||
8 | complianceLevel="7.0" language="en" operationReflection="true"> | ||
9 | <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/exporter/org.eclipse.xsd.ecore.exporter"> | ||
10 | <genAnnotations source="selectedPackages"> | ||
11 | <details key="http://www.eclipse.org/emf/2002/Ecore" value="Ecore.xsd"/> | ||
12 | </genAnnotations> | ||
13 | <details key="directoryURI" value="."/> | ||
14 | </genAnnotations> | ||
15 | <genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/exporter/org.eclipse.xsd.ecore.exporter.xmi"> | ||
16 | <genAnnotations source="selectedPackages"> | ||
17 | <details key="http://www.eclipse.org/emf/2002/Ecore" value="EcoreXMI.xsd"/> | ||
18 | </genAnnotations> | ||
19 | <details key="directoryURI" value="."/> | ||
20 | </genAnnotations> | ||
21 | <foreignModel>recipes.ecore</foreignModel> | ||
22 | <modelPluginVariables>org.eclipse.xtext.xbase.lib</modelPluginVariables> | ||
23 | <modelPluginVariables>org.eclipse.emf.ecore.xcore.lib</modelPluginVariables> | ||
24 | <genPackages prefix="Recipes" basePackage="tools.refinery.viatra.runtime.rete" disposableProviderFactory="true" | ||
25 | ecorePackage="recipes.ecore#/"> | ||
26 | <genDataTypes ecoreDataType="recipes.ecore#//Index"/> | ||
27 | <genDataTypes ecoreDataType="recipes.ecore#//AggregationOperator"/> | ||
28 | <genDataTypes ecoreDataType="recipes.ecore#//Connectivity"/> | ||
29 | <genClasses ecoreClass="recipes.ecore#//ReteRecipe"> | ||
30 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//ReteRecipe/recipeNodes"/> | ||
31 | </genClasses> | ||
32 | <genClasses image="false" ecoreClass="recipes.ecore#//ReteNodeRecipe"> | ||
33 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ReteNodeRecipe/traceInfo"/> | ||
34 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ReteNodeRecipe/equivalenceClassIDs"/> | ||
35 | <genOperations ecoreOperation="recipes.ecore#//ReteNodeRecipe/getArity" body="throw new <%java.lang.UnsupportedOperationException%>();"/> | ||
36 | </genClasses> | ||
37 | <genClasses image="false" ecoreClass="recipes.ecore#//SingleParentNodeRecipe"> | ||
38 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference recipes.ecore#//SingleParentNodeRecipe/parent"/> | ||
39 | </genClasses> | ||
40 | <genClasses image="false" ecoreClass="recipes.ecore#//AlphaRecipe"/> | ||
41 | <genClasses image="false" ecoreClass="recipes.ecore#//MultiParentNodeRecipe"> | ||
42 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference recipes.ecore#//MultiParentNodeRecipe/parents"/> | ||
43 | <genOperations ecoreOperation="recipes.ecore#//MultiParentNodeRecipe/getArity" | ||
44 | body="<%org.eclipse.emf.common.util.EList%><<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%>> _parents = this.getParents();
<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _get = _parents.get(0);
return _get.getArity();"/> | ||
45 | </genClasses> | ||
46 | <genClasses ecoreClass="recipes.ecore#//MonotonicityInfo"> | ||
47 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//MonotonicityInfo/coreMask"/> | ||
48 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//MonotonicityInfo/posetMask"/> | ||
49 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//MonotonicityInfo/posetComparator"/> | ||
50 | </genClasses> | ||
51 | <genClasses ecoreClass="recipes.ecore#//UniquenessEnforcerRecipe"/> | ||
52 | <genClasses ecoreClass="recipes.ecore#//ProductionRecipe"> | ||
53 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//ProductionRecipe/mappedIndices"/> | ||
54 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ProductionRecipe/pattern"/> | ||
55 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ProductionRecipe/patternFQN"/> | ||
56 | <genOperations ecoreOperation="recipes.ecore#//ProductionRecipe/getArity" body="return this.getMappedIndices().size();"/> | ||
57 | </genClasses> | ||
58 | <genClasses image="false" ecoreClass="recipes.ecore#//IndexerRecipe"> | ||
59 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//IndexerRecipe/mask"/> | ||
60 | <genOperations ecoreOperation="recipes.ecore#//IndexerRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = this.getMask();
return _mask.getSourceArity();"/> | ||
61 | </genClasses> | ||
62 | <genClasses ecoreClass="recipes.ecore#//ProjectionIndexerRecipe"/> | ||
63 | <genClasses ecoreClass="recipes.ecore#//AggregatorIndexerRecipe"/> | ||
64 | <genClasses image="false" ecoreClass="recipes.ecore#//BetaRecipe"> | ||
65 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//BetaRecipe/leftParent"/> | ||
66 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//BetaRecipe/rightParent"/> | ||
67 | </genClasses> | ||
68 | <genClasses ecoreClass="recipes.ecore#//Mask"> | ||
69 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//Mask/sourceIndices"/> | ||
70 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//Mask/sourceArity"/> | ||
71 | </genClasses> | ||
72 | <genClasses ecoreClass="recipes.ecore#//StringIndexMapEntry"> | ||
73 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//StringIndexMapEntry/key"/> | ||
74 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//StringIndexMapEntry/value"/> | ||
75 | </genClasses> | ||
76 | <genClasses ecoreClass="recipes.ecore#//InputRecipe"> | ||
77 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InputRecipe/inputKey"/> | ||
78 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InputRecipe/keyID"/> | ||
79 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InputRecipe/keyArity"/> | ||
80 | <genOperations ecoreOperation="recipes.ecore#//InputRecipe/getArity" body="return getKeyArity();"/> | ||
81 | </genClasses> | ||
82 | <genClasses ecoreClass="recipes.ecore#//ConstantRecipe"> | ||
83 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ConstantRecipe/constantValues"/> | ||
84 | <genOperations ecoreOperation="recipes.ecore#//ConstantRecipe/getArity" body="return this.getConstantValues().size();"/> | ||
85 | </genClasses> | ||
86 | <genClasses ecoreClass="recipes.ecore#//TransitiveClosureRecipe"> | ||
87 | <genOperations ecoreOperation="recipes.ecore#//TransitiveClosureRecipe/getArity" | ||
88 | body="return 2;"/> | ||
89 | </genClasses> | ||
90 | <genClasses image="false" ecoreClass="recipes.ecore#//FilterRecipe"> | ||
91 | <genOperations ecoreOperation="recipes.ecore#//FilterRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
92 | </genClasses> | ||
93 | <genClasses ecoreClass="recipes.ecore#//InequalityFilterRecipe"> | ||
94 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InequalityFilterRecipe/subject"/> | ||
95 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InequalityFilterRecipe/inequals"/> | ||
96 | </genClasses> | ||
97 | <genClasses ecoreClass="recipes.ecore#//EqualityFilterRecipe"> | ||
98 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//EqualityFilterRecipe/indices"/> | ||
99 | </genClasses> | ||
100 | <genClasses ecoreClass="recipes.ecore#//TransparentRecipe"/> | ||
101 | <genClasses ecoreClass="recipes.ecore#//TrimmerRecipe"> | ||
102 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//TrimmerRecipe/mask"/> | ||
103 | <genOperations ecoreOperation="recipes.ecore#//TrimmerRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = this.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
return _sourceIndices.size();"/> | ||
104 | </genClasses> | ||
105 | <genClasses ecoreClass="recipes.ecore#//ExpressionDefinition"> | ||
106 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ExpressionDefinition/evaluator"/> | ||
107 | </genClasses> | ||
108 | <genClasses image="false" ecoreClass="recipes.ecore#//ExpressionEnforcerRecipe"> | ||
109 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//ExpressionEnforcerRecipe/expression"/> | ||
110 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//ExpressionEnforcerRecipe/mappedIndices"/> | ||
111 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//ExpressionEnforcerRecipe/cacheOutput"/> | ||
112 | </genClasses> | ||
113 | <genClasses ecoreClass="recipes.ecore#//CheckRecipe"> | ||
114 | <genOperations ecoreOperation="recipes.ecore#//CheckRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
115 | </genClasses> | ||
116 | <genClasses ecoreClass="recipes.ecore#//EvalRecipe"> | ||
117 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//EvalRecipe/unwinding"/> | ||
118 | <genOperations ecoreOperation="recipes.ecore#//EvalRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
int _arity = _parent.getArity();
return (1 + _arity);"/> | ||
119 | </genClasses> | ||
120 | <genClasses image="false" ecoreClass="recipes.ecore#//IndexerBasedAggregatorRecipe"> | ||
121 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//IndexerBasedAggregatorRecipe/parent"/> | ||
122 | <genOperations ecoreOperation="recipes.ecore#//IndexerBasedAggregatorRecipe/getArity" | ||
123 | body="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _parent = this.getParent();
<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = _parent.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
int _size = _sourceIndices.size();
return (1 + _size);"/> | ||
124 | </genClasses> | ||
125 | <genClasses ecoreClass="recipes.ecore#//CountAggregatorRecipe"/> | ||
126 | <genClasses ecoreClass="recipes.ecore#//JoinRecipe"> | ||
127 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//JoinRecipe/rightParentComplementaryMask"/> | ||
128 | <genOperations ecoreOperation="recipes.ecore#//JoinRecipe/getArity" body="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _leftParent = this.getLeftParent();
int _arity = _leftParent.getArity();
<%tools.refinery.viatra.runtime.rete.recipes.IndexerRecipe%> _rightParent = this.getRightParent();
int _arity_1 = _rightParent.getArity();
int _plus = (_arity + _arity_1);
<%tools.refinery.viatra.runtime.rete.recipes.IndexerRecipe%> _rightParent_1 = this.getRightParent();
<%tools.refinery.viatra.runtime.rete.recipes.Mask%> _mask = _rightParent_1.getMask();
<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _sourceIndices = _mask.getSourceIndices();
int _size = _sourceIndices.size();
return (_plus - _size);"/> | ||
129 | </genClasses> | ||
130 | <genClasses image="false" ecoreClass="recipes.ecore#//ExistenceJoinRecipe"> | ||
131 | <genOperations ecoreOperation="recipes.ecore#//ExistenceJoinRecipe/getArity" | ||
132 | body="<%tools.refinery.viatra.runtime.rete.recipes.ProjectionIndexerRecipe%> _leftParent = this.getLeftParent();
return _leftParent.getArity();"/> | ||
133 | </genClasses> | ||
134 | <genClasses ecoreClass="recipes.ecore#//SemiJoinRecipe"/> | ||
135 | <genClasses ecoreClass="recipes.ecore#//AntiJoinRecipe"/> | ||
136 | <genClasses ecoreClass="recipes.ecore#//InputFilterRecipe"> | ||
137 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InputFilterRecipe/inputKey"/> | ||
138 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//InputFilterRecipe/keyID"/> | ||
139 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//InputFilterRecipe/mask"/> | ||
140 | </genClasses> | ||
141 | <genClasses ecoreClass="recipes.ecore#//SingleColumnAggregatorRecipe"> | ||
142 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//SingleColumnAggregatorRecipe/multisetAggregationOperator"/> | ||
143 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//SingleColumnAggregatorRecipe/aggregableIndex"/> | ||
144 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//SingleColumnAggregatorRecipe/groupByMask"/> | ||
145 | <genOperations ecoreOperation="recipes.ecore#//SingleColumnAggregatorRecipe/getArity" | ||
146 | body="<%tools.refinery.viatra.runtime.rete.recipes.MonotonicityInfo%> info = getOptionalMonotonicityInfo();
if (info == null) {
	return 1 + getGroupByMask().getSourceIndices().size();
} else {	
	return info.getCoreMask().getSourceIndices().size() + info.getPosetMask().getSourceIndices().size();
}"/> | ||
147 | </genClasses> | ||
148 | <genClasses ecoreClass="recipes.ecore#//DiscriminatorDispatcherRecipe"> | ||
149 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//DiscriminatorDispatcherRecipe/discriminationColumnIndex"/> | ||
150 | <genOperations ecoreOperation="recipes.ecore#//DiscriminatorDispatcherRecipe/getArity" | ||
151 | body="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
152 | </genClasses> | ||
153 | <genClasses ecoreClass="recipes.ecore#//DiscriminatorBucketRecipe"> | ||
154 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//DiscriminatorBucketRecipe/bucketKey"/> | ||
155 | <genOperations ecoreOperation="recipes.ecore#//DiscriminatorBucketRecipe/getArity" | ||
156 | body="<%tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe%> _parent = this.getParent();
return _parent.getArity();"/> | ||
157 | </genClasses> | ||
158 | <genClasses image="false" ecoreClass="recipes.ecore#//RederivableNodeRecipe"> | ||
159 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//RederivableNodeRecipe/deleteRederiveEvaluation"/> | ||
160 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference recipes.ecore#//RederivableNodeRecipe/optionalMonotonicityInfo"/> | ||
161 | </genClasses> | ||
162 | <genClasses ecoreClass="recipes.ecore#//RelationEvaluationRecipe"> | ||
163 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference recipes.ecore#//RelationEvaluationRecipe/evaluator"/> | ||
164 | </genClasses> | ||
165 | <genClasses ecoreClass="recipes.ecore#//RepresentativeElectionRecipe"> | ||
166 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute recipes.ecore#//RepresentativeElectionRecipe/connectivity"/> | ||
167 | <genOperations ecoreOperation="recipes.ecore#//RepresentativeElectionRecipe/getArity" | ||
168 | body="return 2;"/> | ||
169 | </genClasses> | ||
170 | </genPackages> | ||
171 | </genmodel:GenModel> | ||
diff --git a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel.license b/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel.license deleted file mode 100644 index 03d1d42b..00000000 --- a/subprojects/viatra-runtime-rete-recipes/src/main/resources/model/rete-recipes.genmodel.license +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | Copyright (c) 2004-2014 Gabor Bergmann and Daniel Varro | ||
2 | Copyright (c) 2023 The Refinery Authors <https://refinery.tools> | ||
3 | |||
4 | SPDX-License-Identifier: EPL-2.0 | ||