diff options
author | Kristóf Marussy <kristof@marussy.com> | 2023-03-07 16:26:26 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2023-03-31 15:38:59 +0200 |
commit | 372058e54825ab58a66c25ae528e81a656c22659 (patch) | |
tree | 3686057057ebcad2faae7233dc691ecacc3e9fe2 /subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java | |
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-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java')
-rw-r--r-- | subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java b/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java new file mode 100644 index 00000000..c2dcc565 --- /dev/null +++ b/subprojects/store-query-viatra/src/main/java/tools/refinery/store/query/viatra/internal/matcher/RelationalCursor.java | |||
@@ -0,0 +1,42 @@ | |||
1 | package tools.refinery.store.query.viatra.internal.matcher; | ||
2 | |||
3 | import org.eclipse.viatra.query.runtime.matchers.tuple.ITuple; | ||
4 | import tools.refinery.store.map.Cursor; | ||
5 | import tools.refinery.store.tuple.TupleLike; | ||
6 | |||
7 | import java.util.Iterator; | ||
8 | |||
9 | class RelationalCursor implements Cursor<TupleLike, Boolean> { | ||
10 | private final Iterator<? extends ITuple> tuplesIterator; | ||
11 | private boolean terminated; | ||
12 | private TupleLike key; | ||
13 | |||
14 | public RelationalCursor(Iterator<? extends ITuple> tuplesIterator) { | ||
15 | this.tuplesIterator = tuplesIterator; | ||
16 | } | ||
17 | |||
18 | @Override | ||
19 | public TupleLike getKey() { | ||
20 | return key; | ||
21 | } | ||
22 | |||
23 | @Override | ||
24 | public Boolean getValue() { | ||
25 | return true; | ||
26 | } | ||
27 | |||
28 | @Override | ||
29 | public boolean isTerminated() { | ||
30 | return terminated; | ||
31 | } | ||
32 | |||
33 | @Override | ||
34 | public boolean move() { | ||
35 | if (!terminated && tuplesIterator.hasNext()) { | ||
36 | key = new ViatraTupleLike(tuplesIterator.next()); | ||
37 | return true; | ||
38 | } | ||
39 | terminated = true; | ||
40 | return false; | ||
41 | } | ||
42 | } | ||