Skip to content
Snippets Groups Projects
Commit 24c618eb authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

asString in AbstractZ3Solver

parent 97d7257f
No related branches found
No related tags found
No related merge requests found
...@@ -260,7 +260,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -260,7 +260,7 @@ trait AbstractZ3Solver extends Solver {
case other => case other =>
sorts.cachedB(other) { sorts.cachedB(other) {
reporter.warning(other.getPos, "Resorting to uninterpreted type for : " + other) reporter.warning(other.getPos, "Resorting to uninterpreted type for : " + other.asString)
val symbol = z3.mkIntSymbol(FreshIdentifier("unint").globalId) val symbol = z3.mkIntSymbol(FreshIdentifier("unint").globalId)
z3.mkUninterpretedSort(symbol) z3.mkUninterpretedSort(symbol)
} }
...@@ -546,7 +546,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -546,7 +546,7 @@ trait AbstractZ3Solver extends Solver {
z3.mkApp(genericValueToDecl(gv)) z3.mkApp(genericValueToDecl(gv))
case _ => { case _ => {
reporter.warning(ex.getPos, "Can't handle this in translation to Z3: " + ex) reporter.warning(ex.getPos, "Can't handle this in translation to Z3: " + ex.asString)
throw new IllegalArgumentException throw new IllegalArgumentException
} }
} }
...@@ -558,7 +558,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -558,7 +558,7 @@ trait AbstractZ3Solver extends Solver {
case rav: RawArrayValue => case rav: RawArrayValue =>
fromRawArray(rav, tpe) fromRawArray(rav, tpe)
case _ => case _ =>
scala.sys.error("Unable to extract from raw array for "+r) scala.sys.error("Unable to extract from raw array for "+r.asString)
} }
protected def fromRawArray(r: RawArrayValue, tpe: TypeTree): Expr = tpe match { protected def fromRawArray(r: RawArrayValue, tpe: TypeTree): Expr = tpe match {
...@@ -570,7 +570,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -570,7 +570,7 @@ trait AbstractZ3Solver extends Solver {
case _ => case _ =>
scala.sys.error("Unable to extract from raw array for "+tpe) scala.sys.error("Unable to extract from raw array for "+tpe.asString)
} }
protected[leon] def fromZ3Formula(model: Z3Model, tree: Z3AST, tpe: TypeTree): Expr = { protected[leon] def fromZ3Formula(model: Z3Model, tree: Z3AST, tpe: TypeTree): Expr = {
...@@ -588,7 +588,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -588,7 +588,7 @@ trait AbstractZ3Solver extends Solver {
case Int32Type => IntLiteral(hexa.toInt) case Int32Type => IntLiteral(hexa.toInt)
case CharType => CharLiteral(hexa.toInt.toChar) case CharType => CharLiteral(hexa.toInt.toChar)
case _ => case _ =>
reporter.warning("Unexpected target type for BV value: " + tpe) reporter.warning("Unexpected target type for BV value: " + tpe.asString)
throw new IllegalArgumentException throw new IllegalArgumentException
} }
case None => { case None => {
...@@ -607,7 +607,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -607,7 +607,7 @@ trait AbstractZ3Solver extends Solver {
case Int32Type => IntLiteral(hexa.toInt) case Int32Type => IntLiteral(hexa.toInt)
case CharType => CharLiteral(hexa.toInt.toChar) case CharType => CharLiteral(hexa.toInt.toChar)
case _ => case _ =>
reporter.warning("Unexpected target type for BV value: " + tpe) reporter.warning("Unexpected target type for BV value: " + tpe.asString)
throw new IllegalArgumentException throw new IllegalArgumentException
} }
case None => { case None => {
...@@ -680,10 +680,10 @@ trait AbstractZ3Solver extends Solver { ...@@ -680,10 +680,10 @@ trait AbstractZ3Solver extends Solver {
// We expect a RawArrayValue with keys in from and values in Option[to], // We expect a RawArrayValue with keys in from and values in Option[to],
// with default value == None // with default value == None
if (r.default.getType != library.noneType(to)) { if (r.default.getType != library.noneType(to)) {
reporter.warning("Co-finite maps are not supported. (Default was "+r.default+")") reporter.warning("Co-finite maps are not supported. (Default was "+r.default.asString+")")
throw new IllegalArgumentException throw new IllegalArgumentException
} }
require(r.keyTpe == from, s"Type error in solver model, expected $from, found ${r.keyTpe}") require(r.keyTpe == from, s"Type error in solver model, expected ${from.asString}, found ${r.keyTpe.asString}")
val elems = r.elems.flatMap { val elems = r.elems.flatMap {
case (k, CaseClass(leonSome, Seq(x))) => Some(k -> x) case (k, CaseClass(leonSome, Seq(x))) => Some(k -> x)
...@@ -737,7 +737,7 @@ trait AbstractZ3Solver extends Solver { ...@@ -737,7 +737,7 @@ trait AbstractZ3Solver extends Solver {
// case OpMod => Modulo(rargs(0), rargs(1)) // case OpMod => Modulo(rargs(0), rargs(1))
case other => case other =>
reporter.warning("Don't know what to do with this declKind : " + other) reporter.warning("Don't know what to do with this declKind : " + other)
reporter.warning("Expected type: " + tpe) reporter.warning("Expected type: " + tpe.asString)
reporter.warning("Tree: " + t) reporter.warning("Tree: " + t)
reporter.warning("The arguments are : " + args) reporter.warning("The arguments are : " + args)
throw new IllegalArgumentException throw new IllegalArgumentException
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment