diff options
Diffstat (limited to 'subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java')
-rw-r--r-- | subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java index 6d5d6f89..7f0ef8b4 100644 --- a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/ReasoningAdapter.java | |||
@@ -5,26 +5,51 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.store.reasoning; | 6 | package tools.refinery.store.reasoning; |
7 | 7 | ||
8 | import org.jetbrains.annotations.Nullable; | ||
8 | import tools.refinery.store.adapter.ModelAdapter; | 9 | import tools.refinery.store.adapter.ModelAdapter; |
9 | import tools.refinery.store.query.resultset.ResultSet; | 10 | import tools.refinery.store.reasoning.internal.ReasoningBuilderImpl; |
10 | import tools.refinery.store.query.dnf.Dnf; | 11 | import tools.refinery.store.reasoning.interpretation.AnyPartialInterpretation; |
12 | import tools.refinery.store.reasoning.interpretation.PartialInterpretation; | ||
13 | import tools.refinery.store.reasoning.literal.Concreteness; | ||
14 | import tools.refinery.store.reasoning.refinement.AnyPartialInterpretationRefiner; | ||
15 | import tools.refinery.store.reasoning.refinement.PartialInterpretationRefiner; | ||
11 | import tools.refinery.store.reasoning.representation.AnyPartialSymbol; | 16 | import tools.refinery.store.reasoning.representation.AnyPartialSymbol; |
12 | import tools.refinery.store.reasoning.representation.PartialRelation; | 17 | import tools.refinery.store.reasoning.representation.PartialRelation; |
13 | import tools.refinery.store.reasoning.representation.PartialSymbol; | 18 | import tools.refinery.store.reasoning.representation.PartialSymbol; |
19 | import tools.refinery.store.tuple.Tuple1; | ||
14 | 20 | ||
15 | public interface ReasoningAdapter extends ModelAdapter { | 21 | public interface ReasoningAdapter extends ModelAdapter { |
16 | PartialRelation EXISTS = new PartialRelation("exists", 1); | 22 | PartialRelation EXISTS_SYMBOL = PartialSymbol.of("exists", 1); |
23 | PartialRelation EQUALS_SYMBOL = PartialSymbol.of("equals", 2); | ||
17 | 24 | ||
18 | @Override | 25 | @Override |
19 | ReasoningStoreAdapter getStoreAdapter(); | 26 | ReasoningStoreAdapter getStoreAdapter(); |
20 | 27 | ||
21 | default AnyPartialInterpretation getPartialInterpretation(AnyPartialSymbol partialSymbol) { | 28 | default AnyPartialInterpretation getPartialInterpretation(Concreteness concreteness, |
22 | // Cast to disambiguate overloads. | 29 | AnyPartialSymbol partialSymbol) { |
23 | var typedPartialSymbol = (PartialSymbol<?, ?>) partialSymbol; | 30 | return getPartialInterpretation(concreteness, (PartialSymbol<?, ?>) partialSymbol); |
24 | return getPartialInterpretation(typedPartialSymbol); | ||
25 | } | 31 | } |
26 | 32 | ||
27 | <A, C> PartialInterpretation<A, C> getPartialInterpretation(PartialSymbol<A, C> partialSymbol); | 33 | <A, C> PartialInterpretation<A, C> getPartialInterpretation(Concreteness concreteness, |
34 | PartialSymbol<A, C> partialSymbol); | ||
28 | 35 | ||
29 | ResultSet<Boolean> getLiftedResultSet(Dnf query); | 36 | default AnyPartialInterpretationRefiner getRefiner(AnyPartialSymbol partialSymbol) { |
37 | return getRefiner((PartialSymbol<?, ?>) partialSymbol); | ||
38 | } | ||
39 | |||
40 | <A, C> PartialInterpretationRefiner<A, C> getRefiner(PartialSymbol<A, C> partialSymbol); | ||
41 | |||
42 | @Nullable | ||
43 | Tuple1 split(int parentMultiObject); | ||
44 | |||
45 | @Nullable | ||
46 | Tuple1 focus(int parentObject); | ||
47 | |||
48 | boolean cleanup(int nodeToDelete); | ||
49 | |||
50 | int getNodeCount(); | ||
51 | |||
52 | static ReasoningBuilder builder() { | ||
53 | return new ReasoningBuilderImpl(); | ||
54 | } | ||
30 | } | 55 | } |