diff options
author | 2023-03-07 16:26:26 +0100 | |
---|---|---|
committer | 2023-03-31 15:38:59 +0200 | |
commit | 372058e54825ab58a66c25ae528e81a656c22659 (patch) | |
tree | 3686057057ebcad2faae7233dc691ecacc3e9fe2 /subprojects/store/src | |
parent | refactor: use Cursor in query result sets (diff) | |
download | refinery-372058e54825ab58a66c25ae528e81a656c22659.tar.gz refinery-372058e54825ab58a66c25ae528e81a656c22659.tar.zst refinery-372058e54825ab58a66c25ae528e81a656c22659.zip |
feat: terms and improved query evaluation
* Implement data terms for computations in queries.
* Function-like queries with computed results.
* Improved query evaluation, including positive and negative diagonal
cosntraints.
* Preliminary local search support.
* Changes to the DNF representation for count and aggregation support.
feat: terms wip
feat: query terms wip
feat: query evaluation, diagonal constraints, local search wip
fix reasoning compilation wip
Diffstat (limited to 'subprojects/store/src')
-rw-r--r-- | subprojects/store/src/main/java/tools/refinery/store/tuple/TupleLike.java | 10 | ||||
-rw-r--r-- | subprojects/store/src/main/java/tools/refinery/store/tuple/TupleN.java | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleLike.java b/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleLike.java index 470ca298..953ea9f8 100644 --- a/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleLike.java +++ b/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleLike.java | |||
@@ -1,5 +1,8 @@ | |||
1 | package tools.refinery.store.tuple; | 1 | package tools.refinery.store.tuple; |
2 | 2 | ||
3 | import java.util.stream.Collectors; | ||
4 | import java.util.stream.IntStream; | ||
5 | |||
3 | public interface TupleLike { | 6 | public interface TupleLike { |
4 | int getSize(); | 7 | int getSize(); |
5 | 8 | ||
@@ -22,4 +25,11 @@ public interface TupleLike { | |||
22 | default -> Tuple.of(toArray()); | 25 | default -> Tuple.of(toArray()); |
23 | }; | 26 | }; |
24 | } | 27 | } |
28 | |||
29 | static String toString(TupleLike tuple) { | ||
30 | var valuesString = IntStream.range(0, tuple.getSize()) | ||
31 | .mapToObj(i -> Integer.toString(tuple.get(i))) | ||
32 | .collect(Collectors.joining(", ")); | ||
33 | return "[" + valuesString + "]"; | ||
34 | } | ||
25 | } | 35 | } |
diff --git a/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleN.java b/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleN.java index 15fd063b..c3aed847 100644 --- a/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleN.java +++ b/subprojects/store/src/main/java/tools/refinery/store/tuple/TupleN.java | |||
@@ -1,7 +1,6 @@ | |||
1 | package tools.refinery.store.tuple; | 1 | package tools.refinery.store.tuple; |
2 | 2 | ||
3 | import java.util.Arrays; | 3 | import java.util.Arrays; |
4 | import java.util.stream.Collectors; | ||
5 | 4 | ||
6 | public record TupleN(int[] values) implements Tuple { | 5 | public record TupleN(int[] values) implements Tuple { |
7 | static final int CUSTOM_TUPLE_SIZE = 2; | 6 | static final int CUSTOM_TUPLE_SIZE = 2; |
@@ -29,8 +28,7 @@ public record TupleN(int[] values) implements Tuple { | |||
29 | 28 | ||
30 | @Override | 29 | @Override |
31 | public String toString() { | 30 | public String toString() { |
32 | var valuesString = Arrays.stream(values).mapToObj(Integer::toString).collect(Collectors.joining(", ")); | 31 | return TupleLike.toString(this); |
33 | return "[" + valuesString + "]"; | ||
34 | } | 32 | } |
35 | 33 | ||
36 | @Override | 34 | @Override |