diff options
author | 2022-11-19 21:39:00 +0100 | |
---|---|---|
committer | 2022-11-22 16:40:03 +0100 | |
commit | 3aa4a2b58221a3e83b17d0c04c9a6e9c41e5500c (patch) | |
tree | 1e25f513e3b34b2ea29dbcc6cc3795e5927a1362 /subprojects/language-semantics/src/main/java | |
parent | feat(language): numeric expressions (diff) | |
download | refinery-3aa4a2b58221a3e83b17d0c04c9a6e9c41e5500c.tar.gz refinery-3aa4a2b58221a3e83b17d0c04c9a6e9c41e5500c.tar.zst refinery-3aa4a2b58221a3e83b17d0c04c9a6e9c41e5500c.zip |
refactor: separate primitive types from nodes
Diffstat (limited to 'subprojects/language-semantics/src/main/java')
-rw-r--r-- | subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java | 9 |
1 files changed, 5 insertions, 4 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 233cc156..557e9752 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 | |||
@@ -75,8 +75,6 @@ public class ModelInitializer { | |||
75 | var argument = arguments.get(i); | 75 | var argument = arguments.get(i); |
76 | if (argument instanceof NodeAssertionArgument nodeArgument) { | 76 | if (argument instanceof NodeAssertionArgument nodeArgument) { |
77 | nodes[i] = nodeTrace.getOrThrow(nodeArgument.getNode()); | 77 | nodes[i] = nodeTrace.getOrThrow(nodeArgument.getNode()); |
78 | } else if (argument instanceof ConstantAssertionArgument constantArgument) { | ||
79 | nodes[i] = nodeTrace.getOrThrow(constantArgument.getNode()); | ||
80 | } else if (argument instanceof WildcardAssertionArgument) { | 78 | } else if (argument instanceof WildcardAssertionArgument) { |
81 | nodes[i] = -1; | 79 | nodes[i] = -1; |
82 | } else { | 80 | } else { |
@@ -86,8 +84,11 @@ public class ModelInitializer { | |||
86 | return Tuple.of(nodes); | 84 | return Tuple.of(nodes); |
87 | } | 85 | } |
88 | 86 | ||
89 | private static TruthValue getTruthValue(LogicValue value) { | 87 | private static TruthValue getTruthValue(AssertionValue value) { |
90 | return switch (value) { | 88 | if (!(value instanceof LogicAssertionValue logicAssertionValue)) { |
89 | return TruthValue.ERROR; | ||
90 | } | ||
91 | return switch (logicAssertionValue.getLogicValue()) { | ||
91 | case TRUE -> TruthValue.TRUE; | 92 | case TRUE -> TruthValue.TRUE; |
92 | case FALSE -> TruthValue.FALSE; | 93 | case FALSE -> TruthValue.FALSE; |
93 | case UNKNOWN -> TruthValue.UNKNOWN; | 94 | case UNKNOWN -> TruthValue.UNKNOWN; |