diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/planning/IOperationCompiler.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/planning/IOperationCompiler.java | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/planning/IOperationCompiler.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/planning/IOperationCompiler.java new file mode 100644 index 00000000..c9f4b305 --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/planning/IOperationCompiler.java | |||
@@ -0,0 +1,108 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2004-2008 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 | |||
10 | package tools.refinery.viatra.runtime.matchers.planning; | ||
11 | |||
12 | import java.util.Map; | ||
13 | |||
14 | import tools.refinery.viatra.runtime.matchers.ViatraQueryRuntimeException; | ||
15 | import tools.refinery.viatra.runtime.matchers.psystem.IExpressionEvaluator; | ||
16 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery; | ||
17 | import tools.refinery.viatra.runtime.matchers.tuple.Tuple; | ||
18 | import tools.refinery.viatra.runtime.matchers.tuple.TupleMask; | ||
19 | |||
20 | /** | ||
21 | * | ||
22 | * An implicit common parameter is the "effort" PatternDescription. This | ||
23 | * indicates that the build request is part of an effort to build the matcher of | ||
24 | * the given pattern; it it important to record this during code generation so | ||
25 | * that the generated code can be separated according to patterns. | ||
26 | * | ||
27 | * @param <Collector> | ||
28 | * the handle of a receiver-like RETE ending to which plans can be | ||
29 | * connected | ||
30 | * @author Gabor Bergmann | ||
31 | * @noimplement This interface is not intended to be implemented by clients. | ||
32 | */ | ||
33 | public interface IOperationCompiler<Collector> { | ||
34 | |||
35 | /** | ||
36 | * @throws ViatraQueryRuntimeException | ||
37 | */ | ||
38 | public Collector patternCollector(PQuery pattern); | ||
39 | |||
40 | public void buildConnection(SubPlan parentPlan, Collector collector); | ||
41 | |||
42 | /** | ||
43 | * @since 0.9 | ||
44 | */ | ||
45 | public void patternFinished(PQuery pattern, Collector collector); | ||
46 | |||
47 | /** | ||
48 | * @throws ViatraQueryRuntimeException | ||
49 | */ | ||
50 | public SubPlan patternCallPlan(Tuple nodes, PQuery supplierKey); | ||
51 | |||
52 | public SubPlan transitiveInstantiationPlan(Tuple nodes); | ||
53 | |||
54 | public SubPlan directInstantiationPlan(Tuple nodes); | ||
55 | |||
56 | public SubPlan transitiveGeneralizationPlan(Tuple nodes); | ||
57 | |||
58 | public SubPlan directGeneralizationPlan(Tuple nodes); | ||
59 | |||
60 | public SubPlan transitiveContainmentPlan(Tuple nodes); | ||
61 | |||
62 | public SubPlan directContainmentPlan(Tuple nodes); | ||
63 | |||
64 | public SubPlan binaryEdgeTypePlan(Tuple nodes, Object supplierKey); | ||
65 | |||
66 | public SubPlan ternaryEdgeTypePlan(Tuple nodes, Object supplierKey); | ||
67 | |||
68 | public SubPlan unaryTypePlan(Tuple nodes, Object supplierKey); | ||
69 | |||
70 | public SubPlan buildStartingPlan(Object[] constantValues, Object[] constantNames); | ||
71 | |||
72 | public SubPlan buildEqualityChecker(SubPlan parentPlan, int[] indices); | ||
73 | |||
74 | public SubPlan buildInjectivityChecker(SubPlan parentPlan, int subject, int[] inequalIndices); | ||
75 | |||
76 | public SubPlan buildTransitiveClosure(SubPlan parentPlan); | ||
77 | |||
78 | public SubPlan buildTrimmer(SubPlan parentPlan, TupleMask trimMask, boolean enforceUniqueness); | ||
79 | |||
80 | public SubPlan buildBetaNode(SubPlan primaryPlan, SubPlan sidePlan, | ||
81 | TupleMask primaryMask, TupleMask sideMask, TupleMask complementer, boolean negative); | ||
82 | |||
83 | public SubPlan buildCounterBetaNode(SubPlan primaryPlan, SubPlan sidePlan, | ||
84 | TupleMask primaryMask, TupleMask originalSideMask, TupleMask complementer, | ||
85 | Object aggregateResultCalibrationElement); | ||
86 | |||
87 | public SubPlan buildCountCheckBetaNode(SubPlan primaryPlan, SubPlan sidePlan, | ||
88 | TupleMask primaryMask, TupleMask originalSideMask, int resultPositionInSignature); | ||
89 | |||
90 | public SubPlan buildPredicateChecker(IExpressionEvaluator evaluator, Map<String, Integer> tupleNameMap, | ||
91 | SubPlan parentPlan); | ||
92 | public SubPlan buildFunctionEvaluator(IExpressionEvaluator evaluator, Map<String, Integer> tupleNameMap, | ||
93 | SubPlan parentPlan, Object computedResultCalibrationElement); | ||
94 | |||
95 | /** | ||
96 | * @return an operation compiler that potentially acts on a separate container | ||
97 | */ | ||
98 | public IOperationCompiler<Collector> getNextContainer(); | ||
99 | |||
100 | /** | ||
101 | * @return an operation compiler that puts build actions on the tab of the given pattern | ||
102 | * @since 0.9 | ||
103 | */ | ||
104 | public IOperationCompiler<Collector> putOnTab(PQuery effort /*, IPatternMatcherContext context*/); | ||
105 | |||
106 | public void reinitialize(); | ||
107 | |||
108 | } \ No newline at end of file | ||