diff options
author | 2023-01-23 20:27:55 +0100 | |
---|---|---|
committer | 2023-01-29 00:02:28 +0100 | |
commit | d91acf3690682d243dbc150df902525b6e545c2f (patch) | |
tree | f39695cc193828df0b78030b5a56bd968e277457 /subprojects/language-semantics/src/main | |
parent | chore(deps): bump dependencies (diff) | |
download | refinery-d91acf3690682d243dbc150df902525b6e545c2f.tar.gz refinery-d91acf3690682d243dbc150df902525b6e545c2f.tar.zst refinery-d91acf3690682d243dbc150df902525b6e545c2f.zip |
refactor: Model store and query API
Use Adapters to simplify API usage.
Diffstat (limited to 'subprojects/language-semantics/src/main')
7 files changed, 10 insertions, 10 deletions
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java index 13bb20d7..a6712a89 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java | |||
@@ -7,8 +7,8 @@ import tools.refinery.language.model.problem.*; | |||
7 | import tools.refinery.language.semantics.model.internal.DecisionTree; | 7 | import tools.refinery.language.semantics.model.internal.DecisionTree; |
8 | import tools.refinery.language.utils.ProblemDesugarer; | 8 | import tools.refinery.language.utils.ProblemDesugarer; |
9 | import tools.refinery.language.utils.RelationInfo; | 9 | import tools.refinery.language.utils.RelationInfo; |
10 | import tools.refinery.store.model.representation.Relation; | 10 | import tools.refinery.store.representation.Symbol; |
11 | import tools.refinery.store.model.representation.TruthValue; | 11 | import tools.refinery.store.representation.TruthValue; |
12 | import tools.refinery.store.tuple.Tuple; | 12 | import tools.refinery.store.tuple.Tuple; |
13 | 13 | ||
14 | import java.util.HashMap; | 14 | import java.util.HashMap; |
@@ -20,7 +20,7 @@ public class ModelInitializer { | |||
20 | 20 | ||
21 | private final MutableObjectIntMap<Node> nodeTrace = ObjectIntMaps.mutable.empty(); | 21 | private final MutableObjectIntMap<Node> nodeTrace = ObjectIntMaps.mutable.empty(); |
22 | 22 | ||
23 | private final Map<tools.refinery.language.model.problem.Relation, Relation<TruthValue>> relationTrace = | 23 | private final Map<tools.refinery.language.model.problem.Relation, Symbol<TruthValue>> relationTrace = |
24 | new HashMap<>(); | 24 | new HashMap<>(); |
25 | 25 | ||
26 | private int nodeCount = 0; | 26 | private int nodeCount = 0; |
@@ -39,7 +39,7 @@ public class ModelInitializer { | |||
39 | var isEqualsRelation = relation == builtinSymbols.equals(); | 39 | var isEqualsRelation = relation == builtinSymbols.equals(); |
40 | var decisionTree = mergeAssertions(relationInfo, isEqualsRelation); | 40 | var decisionTree = mergeAssertions(relationInfo, isEqualsRelation); |
41 | var defaultValue = isEqualsRelation ? TruthValue.FALSE : TruthValue.UNKNOWN; | 41 | var defaultValue = isEqualsRelation ? TruthValue.FALSE : TruthValue.UNKNOWN; |
42 | relationTrace.put(relation, new Relation<>(relationInfo.name(), relationInfo.arity(), TruthValue.class, defaultValue | 42 | relationTrace.put(relation, new Symbol<>(relationInfo.name(), relationInfo.arity(), TruthValue.class, defaultValue |
43 | )); | 43 | )); |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTree.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTree.java index 3893f396..55edee6d 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTree.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTree.java | |||
@@ -3,7 +3,7 @@ package tools.refinery.language.semantics.model.internal; | |||
3 | import org.eclipse.collections.api.factory.primitive.IntObjectMaps; | 3 | import org.eclipse.collections.api.factory.primitive.IntObjectMaps; |
4 | import tools.refinery.store.map.Cursor; | 4 | import tools.refinery.store.map.Cursor; |
5 | import tools.refinery.store.tuple.Tuple; | 5 | import tools.refinery.store.tuple.Tuple; |
6 | import tools.refinery.store.model.representation.TruthValue; | 6 | import tools.refinery.store.representation.TruthValue; |
7 | 7 | ||
8 | public class DecisionTree { | 8 | public class DecisionTree { |
9 | private final int levels; | 9 | private final int levels; |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeCursor.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeCursor.java index a1fdc73d..fdf8e452 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeCursor.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeCursor.java | |||
@@ -1,7 +1,7 @@ | |||
1 | package tools.refinery.language.semantics.model.internal; | 1 | package tools.refinery.language.semantics.model.internal; |
2 | 2 | ||
3 | import tools.refinery.store.map.Cursor; | 3 | import tools.refinery.store.map.Cursor; |
4 | import tools.refinery.store.model.representation.TruthValue; | 4 | import tools.refinery.store.representation.TruthValue; |
5 | import tools.refinery.store.tuple.Tuple; | 5 | import tools.refinery.store.tuple.Tuple; |
6 | 6 | ||
7 | import java.util.ArrayDeque; | 7 | import java.util.ArrayDeque; |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeNode.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeNode.java index 8ca54969..b81ea3fe 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeNode.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeNode.java | |||
@@ -2,7 +2,7 @@ package tools.refinery.language.semantics.model.internal; | |||
2 | 2 | ||
3 | import org.eclipse.collections.api.LazyIntIterable; | 3 | import org.eclipse.collections.api.LazyIntIterable; |
4 | import tools.refinery.store.tuple.Tuple; | 4 | import tools.refinery.store.tuple.Tuple; |
5 | import tools.refinery.store.model.representation.TruthValue; | 5 | import tools.refinery.store.representation.TruthValue; |
6 | 6 | ||
7 | abstract class DecisionTreeNode { | 7 | abstract class DecisionTreeNode { |
8 | public DecisionTreeValue getReducedValue() { | 8 | public DecisionTreeValue getReducedValue() { |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeValue.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeValue.java index 993987f5..495a53dd 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeValue.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/DecisionTreeValue.java | |||
@@ -1,6 +1,6 @@ | |||
1 | package tools.refinery.language.semantics.model.internal; | 1 | package tools.refinery.language.semantics.model.internal; |
2 | 2 | ||
3 | import tools.refinery.store.model.representation.TruthValue; | 3 | import tools.refinery.store.representation.TruthValue; |
4 | 4 | ||
5 | public enum DecisionTreeValue { | 5 | public enum DecisionTreeValue { |
6 | UNSET(null), | 6 | UNSET(null), |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/IntermediateNode.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/IntermediateNode.java index a7486ecb..c4200509 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/IntermediateNode.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/IntermediateNode.java | |||
@@ -5,7 +5,7 @@ import org.eclipse.collections.api.factory.primitive.IntObjectMaps; | |||
5 | import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; | 5 | import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; |
6 | import org.eclipse.collections.api.tuple.primitive.IntObjectPair; | 6 | import org.eclipse.collections.api.tuple.primitive.IntObjectPair; |
7 | import tools.refinery.store.tuple.Tuple; | 7 | import tools.refinery.store.tuple.Tuple; |
8 | import tools.refinery.store.model.representation.TruthValue; | 8 | import tools.refinery.store.representation.TruthValue; |
9 | 9 | ||
10 | final class IntermediateNode extends DecisionTreeNode { | 10 | final class IntermediateNode extends DecisionTreeNode { |
11 | private final MutableIntObjectMap<DecisionTreeNode> children; | 11 | private final MutableIntObjectMap<DecisionTreeNode> children; |
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/TerminalNode.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/TerminalNode.java index c0197e89..4af836ff 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/TerminalNode.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/internal/TerminalNode.java | |||
@@ -5,7 +5,7 @@ import org.eclipse.collections.api.factory.primitive.IntObjectMaps; | |||
5 | import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; | 5 | import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; |
6 | import org.eclipse.collections.api.tuple.primitive.IntObjectPair; | 6 | import org.eclipse.collections.api.tuple.primitive.IntObjectPair; |
7 | import tools.refinery.store.tuple.Tuple; | 7 | import tools.refinery.store.tuple.Tuple; |
8 | import tools.refinery.store.model.representation.TruthValue; | 8 | import tools.refinery.store.representation.TruthValue; |
9 | 9 | ||
10 | class TerminalNode extends DecisionTreeNode { | 10 | class TerminalNode extends DecisionTreeNode { |
11 | private MutableIntObjectMap<TruthValue> children; | 11 | private MutableIntObjectMap<TruthValue> children; |