diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/rewriters/IPTraceableTraceProvider.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/rewriters/IPTraceableTraceProvider.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/rewriters/IPTraceableTraceProvider.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/rewriters/IPTraceableTraceProvider.java new file mode 100644 index 00000000..84da4d1b --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/rewriters/IPTraceableTraceProvider.java | |||
@@ -0,0 +1,55 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2017, Grill Balázs, IncQueryLabs | ||
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.matchers.psystem.rewriters; | ||
10 | |||
11 | import java.util.stream.Stream; | ||
12 | |||
13 | import tools.refinery.viatra.runtime.matchers.psystem.PTraceable; | ||
14 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery; | ||
15 | |||
16 | /** | ||
17 | * This interface provides methods to trace the {@link PTraceable}s of a transformed {@link PQuery} produced by | ||
18 | * a {@link PDisjunctionRewriter}. In case the associated rewriter is a composite (a.k.a. {@link PDisjunctionRewriterCacher}), | ||
19 | * this trace provider handles traces end-to-end, hiding all the intermediate transformation steps. | ||
20 | * | ||
21 | * @since 1.6 | ||
22 | * @noimplement This interface is not intended to be implemented by clients. | ||
23 | */ | ||
24 | public interface IPTraceableTraceProvider { | ||
25 | |||
26 | /** | ||
27 | * Find and return the canonical {@link PTraceable}s in the original query which are the sources of the given derivative | ||
28 | * {@link PTraceable} according to the transformation. | ||
29 | * | ||
30 | * @param derivative a {@link PTraceable} which is contained by the {@link PQuery} produced by the associated rewriter | ||
31 | * @since 2.0 | ||
32 | */ | ||
33 | public Stream<PTraceable> getCanonicalTraceables(PTraceable derivative); | ||
34 | |||
35 | /** | ||
36 | * Find and return the {@link PTraceable}s in the rewritten query which are the destinations of the given source | ||
37 | * {@link PTraceable} according to the transformation. | ||
38 | * | ||
39 | * @param source a {@link PTraceable} which is contained by a {@link PQuery} before rewriting | ||
40 | * @since 2.0 | ||
41 | */ | ||
42 | public Stream<PTraceable> getRewrittenTraceables(PTraceable source); | ||
43 | |||
44 | /** | ||
45 | * Returns whether the given traceable element has been removed by every rewriter for a reason. | ||
46 | */ | ||
47 | public boolean isRemoved(PTraceable traceable); | ||
48 | |||
49 | /** | ||
50 | * Returns the reasons for which the traceable element has been removed by the rewriters. | ||
51 | * @return the reasons of removal during rewriting | ||
52 | * @since 2.0 | ||
53 | */ | ||
54 | public Stream<IDerivativeModificationReason> getRemovalReasons(PTraceable traceable); | ||
55 | } | ||