|
12 | 12 | import static org.sosy_lab.common.collect.Collections3.transformedImmutableSetCopy; |
13 | 13 |
|
14 | 14 | import com.google.common.base.Preconditions; |
| 15 | +import com.google.common.collect.HashBasedTable; |
15 | 16 | import com.google.common.collect.ImmutableList; |
16 | 17 | import com.google.common.collect.Table; |
17 | | -import com.google.common.collect.TreeBasedTable; |
18 | 18 | import java.math.BigInteger; |
19 | 19 | import java.util.ArrayDeque; |
20 | 20 | import java.util.ArrayList; |
21 | 21 | import java.util.Collection; |
22 | | -import java.util.Comparator; |
23 | 22 | import java.util.Deque; |
24 | 23 | import java.util.HashMap; |
25 | 24 | import java.util.LinkedHashSet; |
|
57 | 56 | public class BitwuzlaFormulaCreator extends FormulaCreator<Term, Sort, Void, BitwuzlaDeclaration> { |
58 | 57 | private final TermManager termManager; |
59 | 58 |
|
60 | | - /** |
61 | | - * Returns the symbol name without any SMTLIB quotes. |
62 | | - * |
63 | | - * <p>Will turn <code>| 1var\n|</code> into just <code> 1 var\n</code>. Symbols that are not |
64 | | - * quoted are unaffected. |
65 | | - */ |
66 | | - private String removeQuotes(String symbol) { |
67 | | - return (symbol.startsWith("|") && symbol.endsWith("|")) |
68 | | - ? symbol.substring(1, symbol.length() - 1) |
69 | | - : symbol; |
70 | | - } |
71 | | - |
72 | | - /** |
73 | | - * Stores Bitwuzla terms for all defined symbols. |
74 | | - * |
75 | | - * <p>The cache maps from <code>String x Sort</code> to <code>Term</code>. Here the first argument |
76 | | - * is the name of the symbol, and we allow polymorphic symbols where the same name can have more |
77 | | - * than one sort. If the symbol can be printed as a simple symbol or a quoted symbol (like <code> |
78 | | - * var1</code> and <code>|var1|</code>) in SMTLIB we identify both version as they refer to the |
79 | | - * same variable. |
80 | | - */ |
81 | | - private final Table<String, Sort, Term> formulaCache = |
82 | | - TreeBasedTable.create( |
83 | | - (String symA, String symB) -> removeQuotes(symA).compareTo(removeQuotes(symB)), |
84 | | - Comparator.comparing(Sort::toString)); |
| 59 | + private final Table<String, Sort, Term> formulaCache = HashBasedTable.create(); |
85 | 60 |
|
86 | 61 | /** |
87 | 62 | * This mapping stores symbols and their constraints, such as from fp-to-bv casts with their |
|
0 commit comments