Fixed generation of smt2 concat statements
authorClifford Wolf <clifford@clifford.at>
Sat, 15 Aug 2015 09:45:44 +0000 (11:45 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 15 Aug 2015 09:45:44 +0000 (11:45 +0200)
backends/smt2/smt2.cc

index 9b1972b14e7cd65c5be0e468ea30da76a4580e6a..1e00ac7185a24d2386ffbfb5c16047a22b5ea7d8 100644 (file)
@@ -201,10 +201,12 @@ struct Smt2Worker
                }
 
                if (GetSize(subexpr) > 1) {
-                       std::string expr = "(concat";
-                       for (int i = GetSize(subexpr)-1; i >= 0; i--)
+                       std::string expr = "", end_str = "";
+                       for (int i = GetSize(subexpr)-1; i >= 0; i--) {
+                               if (i > 0) expr += " (concat", end_str += ")";
                                expr += " " + subexpr[i];
-                       return expr + ")";
+                       }
+                       return expr.substr(1) + end_str;
                } else {
                        log_assert(GetSize(subexpr) == 1);
                        return subexpr[0];