diff options
Diffstat (limited to 'subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java')
-rw-r--r-- | subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java index 3be9e9ac..78fdbb89 100644 --- a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/QueryBasedRelationRewriter.java | |||
@@ -5,30 +5,49 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.store.reasoning.interpretation; | 6 | package tools.refinery.store.reasoning.interpretation; |
7 | 7 | ||
8 | import tools.refinery.store.query.dnf.Query; | 8 | import tools.refinery.store.query.dnf.RelationalQuery; |
9 | import tools.refinery.store.query.literal.AbstractCallLiteral; | 9 | import tools.refinery.store.query.literal.AbstractCallLiteral; |
10 | import tools.refinery.store.query.literal.Literal; | 10 | import tools.refinery.store.query.literal.Literal; |
11 | import tools.refinery.store.query.term.Variable; | ||
11 | import tools.refinery.store.reasoning.literal.Concreteness; | 12 | import tools.refinery.store.reasoning.literal.Concreteness; |
12 | import tools.refinery.store.reasoning.literal.Modality; | 13 | import tools.refinery.store.reasoning.literal.Modality; |
13 | 14 | ||
14 | import java.util.List; | 15 | import java.util.List; |
16 | import java.util.Set; | ||
15 | 17 | ||
16 | public class QueryBasedRelationRewriter implements PartialRelationRewriter { | 18 | public class QueryBasedRelationRewriter implements PartialRelationRewriter { |
17 | private final Query<Boolean> may; | 19 | private final RelationalQuery may; |
18 | private final Query<Boolean> must; | 20 | private final RelationalQuery must; |
19 | private final Query<Boolean> candidateMay; | 21 | private final RelationalQuery candidateMay; |
20 | private final Query<Boolean> candidateMust; | 22 | private final RelationalQuery candidateMust; |
21 | 23 | ||
22 | public QueryBasedRelationRewriter(Query<Boolean> may, Query<Boolean> must, Query<Boolean> candidateMay, | 24 | public QueryBasedRelationRewriter(RelationalQuery may, RelationalQuery must, RelationalQuery candidateMay, |
23 | Query<Boolean> candidateMust) { | 25 | RelationalQuery candidateMust) { |
24 | this.may = may; | 26 | this.may = may; |
25 | this.must = must; | 27 | this.must = must; |
26 | this.candidateMay = candidateMay; | 28 | this.candidateMay = candidateMay; |
27 | this.candidateMust = candidateMust; | 29 | this.candidateMust = candidateMust; |
28 | } | 30 | } |
29 | 31 | ||
32 | public RelationalQuery getMay() { | ||
33 | return may; | ||
34 | } | ||
35 | |||
36 | public RelationalQuery getMust() { | ||
37 | return must; | ||
38 | } | ||
39 | |||
40 | public RelationalQuery getCandidateMay() { | ||
41 | return candidateMay; | ||
42 | } | ||
43 | |||
44 | public RelationalQuery getCandidateMust() { | ||
45 | return candidateMust; | ||
46 | } | ||
47 | |||
30 | @Override | 48 | @Override |
31 | public List<Literal> rewriteLiteral(AbstractCallLiteral literal, Modality modality, Concreteness concreteness) { | 49 | public List<Literal> rewriteLiteral(Set<Variable> positiveVariables, AbstractCallLiteral literal, |
50 | Modality modality, Concreteness concreteness) { | ||
32 | var query = switch (concreteness) { | 51 | var query = switch (concreteness) { |
33 | case PARTIAL -> switch (modality) { | 52 | case PARTIAL -> switch (modality) { |
34 | case MAY -> may; | 53 | case MAY -> may; |