summaryrefslogtreecommitdiffstats
path: root/rba.tool.core/src/rba/tool/core/sort/SortValue.java
diff options
context:
space:
mode:
Diffstat (limited to 'rba.tool.core/src/rba/tool/core/sort/SortValue.java')
-rw-r--r--rba.tool.core/src/rba/tool/core/sort/SortValue.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/rba.tool.core/src/rba/tool/core/sort/SortValue.java b/rba.tool.core/src/rba/tool/core/sort/SortValue.java
new file mode 100644
index 0000000..61ceaa9
--- /dev/null
+++ b/rba.tool.core/src/rba/tool/core/sort/SortValue.java
@@ -0,0 +1,45 @@
+package rba.tool.core.sort;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import rba.tool.core.z3.Z3Constants;
+
+public class SortValue {
+ private Map<String, Integer> sortMap = new HashMap<String, Integer>();
+
+ private boolean unsat = false;
+
+ public void setSortValue(Map<String, Integer> map) {
+ if (map == null) {
+ clear();
+ return;
+ }
+
+ sortMap = map;
+ Integer result = map.get(Z3Constants.TOTAL_RESULT);
+ if (result == Z3Constants.UNSAT_VAL) {
+ unsat = true;
+ }
+ }
+
+ public boolean isUnsat() {
+ return unsat;
+ }
+
+ public Integer getValue(String name) {
+ if (!sortMap.isEmpty()) {
+ Integer integer = sortMap.get(name);
+ if (integer != null) {
+ return integer;
+ }
+ }
+
+ return Z3Constants.UNKNOWN_VAL;
+ }
+
+ public void clear() {
+ sortMap.clear();
+ unsat = false;
+ }
+}