diff options
author | Kristóf Marussy <kristof@marussy.com> | 2023-10-14 14:54:38 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2023-10-14 14:54:38 +0200 |
commit | 54c4c91097c50f6cedb02cb5b1aea32ae16a3421 (patch) | |
tree | 222b86f87511582c2b602c896e210d1b138220a9 /subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore | |
parent | fix(query-interpreter): register Recipes package (diff) | |
download | refinery-54c4c91097c50f6cedb02cb5b1aea32ae16a3421.tar.gz refinery-54c4c91097c50f6cedb02cb5b1aea32ae16a3421.tar.zst refinery-54c4c91097c50f6cedb02cb5b1aea32ae16a3421.zip |
refactor(interpreter-rete): recipe hashing
Use isomorphism-aware hashing to speed up RecipeRecognizer.
Due to possibly cyclic (recursive) recipes, we can't recursively turn recipes
into a canonical form. Recipes referring to already canonical (non-recurisve, or
recursive and entirely canonicalized) recipes can be hashed, while recursive
recipes in the middle of caninicalization still have to be compared more slowly
by their contents.
To keep the list of recipes compared by contents small, recipes are assigned a
hash code whenever possible.
We keep the equivalence class IDs for recipes, as there might be hash code
clashes, as well as recursive recipes that only later get assigned a hash code.
Also fixes a concurrency problem with equivalence class IDs by using an
AtomicLong.
Also reworks recipe instantiation, as now recipes might be canonicalized before
they are instantiated.
Diffstat (limited to 'subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore')
-rw-r--r-- | subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore b/subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore index a4617833..6b8f10ea 100644 --- a/subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore +++ b/subprojects/interpreter-rete-recipes/src/main/resources/model/recipes.ecore | |||
@@ -31,6 +31,8 @@ | |||
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"/> | 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> | 32 | </eAnnotations> |
33 | </eStructuralFeatures> | 33 | </eStructuralFeatures> |
34 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="cachedHashCode" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELongObject"/> | ||
35 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="constructed" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | ||
34 | </eClassifiers> | 36 | </eClassifiers> |
35 | <eClassifiers xsi:type="ecore:EClass" name="SingleParentNodeRecipe" abstract="true" | 37 | <eClassifiers xsi:type="ecore:EClass" name="SingleParentNodeRecipe" abstract="true" |
36 | eSuperTypes="#//ReteNodeRecipe"> | 38 | eSuperTypes="#//ReteNodeRecipe"> |