Skip to content

Commit 93550f1

Browse files
authored
Merge pull request #132 from jad-hamza/cvc4-1.8
Minor fixes for CVC4 1.8
2 parents 6dfb351 + d51ea2c commit 93550f1

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

src/main/scala/inox/solvers/smtlib/CVC4Solver.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ trait CVC4Solver extends SMTLIBSolver with CVC4Target {
2424
"--produce-models",
2525
"--incremental",
2626
// "--dt-rewrite-error-sel", // Removing since it causes CVC4 to segfault on some inputs
27-
"--rewrite-divk",
2827
"--print-success",
2928
"--lang", "smt2.5"
3029
) ++ options.findOptionOrDefault(optCVC4Options)

src/main/scala/inox/solvers/smtlib/SMTLIBParser.scala

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,20 @@ trait SMTLIBParser {
8181
case _ => IntegerLiteral(n)
8282
}
8383

84-
case FixedSizeBitVectors.BitVectorLit(bs) => otpe match {
85-
case Some(BVType(signed, _)) =>
86-
BVLiteral(signed, BitSet.empty ++ bs.reverse.zipWithIndex.collect { case (true, i) => i + 1 }, bs.size)
87-
case _ =>
88-
BVLiteral(true, BitSet.empty ++ bs.reverse.zipWithIndex.collect { case (true, i) => i + 1 }, bs.size)
89-
}
84+
case FixedSizeBitVectors.BitVectorLit(bs) =>
85+
otpe match {
86+
case Some(BVType(signed, _)) =>
87+
BVLiteral(signed, BitSet.empty ++ bs.reverse.zipWithIndex.collect { case (true, i) => i + 1 }, bs.size)
88+
case Some(CharType()) =>
89+
val bv = BVLiteral(true, BitSet.empty ++ bs.reverse.zipWithIndex.collect { case (true, i) => i + 1 }, 16)
90+
CharLiteral(bv.toBigInt.toInt.toChar)
91+
case _ =>
92+
BVLiteral(true, BitSet.empty ++ bs.reverse.zipWithIndex.collect { case (true, i) => i + 1 }, bs.size)
93+
}
9094

9195
case FixedSizeBitVectors.BitVectorConstant(n, size) => otpe match {
9296
case Some(BVType(signed, _)) => BVLiteral(signed, n, size.intValue)
97+
case Some(CharType()) => CharLiteral(n.toChar)
9398
case _ => BVLiteral(true, n, size.intValue)
9499
}
95100

src/main/scala/inox/utils/ASCIIHelpers.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,23 @@ object ASCIIHelpers {
7272

7373
val sb = new StringBuffer
7474

75-
val barH = if (asciiOnly) "#" else ""
76-
val topLeft = if (asciiOnly) "#" else ""
77-
val topRight = if (asciiOnly) "#" else ""
78-
val bottomLeft = if (asciiOnly) "#" else ""
79-
val bottomRight = if (asciiOnly) "#" else ""
75+
val barH = if (asciiOnly) "" else ""
76+
val topLeft = if (asciiOnly) "" else ""
77+
val topRight = if (asciiOnly) "" else ""
78+
val bottomLeft = if (asciiOnly) "" else ""
79+
val bottomRight = if (asciiOnly) "" else ""
8080
val dots = if (asciiOnly) "." else ""
81-
val doubleBarH = if (asciiOnly) "#" else ""
82-
val doubleBarV = if (asciiOnly) "#" else ""
83-
val doubleTopLeft = if (asciiOnly) "#" else ""
84-
val doubleTopRight = if (asciiOnly) "#" else ""
85-
val doubleBottomLeft = if (asciiOnly) "#" else ""
86-
val doubleBottomRight = if (asciiOnly) "#" else ""
87-
88-
val leftConnect = if (asciiOnly) "#" else ""
89-
val rightConnect = if (asciiOnly) "#" else ""
90-
val doubleRightConnect = if (asciiOnly) "#" else ""
91-
val doubleLeftConnect = if (asciiOnly) "#" else ""
81+
val doubleBarH = if (asciiOnly) "" else ""
82+
val doubleBarV = if (asciiOnly) "" else ""
83+
val doubleTopLeft = if (asciiOnly) "" else ""
84+
val doubleTopRight = if (asciiOnly) "" else ""
85+
val doubleBottomLeft = if (asciiOnly) "" else ""
86+
val doubleBottomRight = if (asciiOnly) "" else ""
87+
88+
val leftConnect = if (asciiOnly) "" else ""
89+
val rightConnect = if (asciiOnly) "" else ""
90+
val doubleRightConnect = if (asciiOnly) "" else ""
91+
val doubleLeftConnect = if (asciiOnly) "" else ""
9292

9393
sb append s" $topLeft$barH" + (barH * titleWidth) + s"$barH$topRight\n"
9494
sb append s"$doubleTopLeft$doubleBarH$leftConnect " + title + s" $rightConnect" + (doubleBarH * padWidth) + s"$doubleTopRight\n"
@@ -99,7 +99,7 @@ object ASCIIHelpers {
9999
sb append doubleRightConnect + (dots * fullWidth) + s"$doubleLeftConnect\n"
100100

101101
case Row(cells) =>
102-
sb append s"$doubleBarV "
102+
if (!asciiOnly) sb append s"$doubleBarV "
103103
var i = 0
104104
for (c <- cells) {
105105
if (i > 0) {

0 commit comments

Comments
 (0)