diff options
Diffstat (limited to 'libsolidity/formal/Z3Interface.cpp')
-rw-r--r-- | libsolidity/formal/Z3Interface.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libsolidity/formal/Z3Interface.cpp b/libsolidity/formal/Z3Interface.cpp index 6111b2c8..e5c1aef4 100644 --- a/libsolidity/formal/Z3Interface.cpp +++ b/libsolidity/formal/Z3Interface.cpp @@ -91,7 +91,7 @@ pair<CheckResult, vector<string>> Z3Interface::check(vector<Expression> const& _ solAssert(false, ""); } - if (result != CheckResult::UNSATISFIABLE) + if (result != CheckResult::UNSATISFIABLE && !_expressionsToEvaluate.empty()) { z3::model m = m_solver.get_model(); for (Expression const& e: _expressionsToEvaluate) @@ -139,8 +139,13 @@ z3::expr Z3Interface::toZ3Expr(Expression const& _expr) } else if (arguments.empty()) { - // We assume it is an integer... - return m_context.int_val(n.c_str()); + if (n == "true") + return m_context.bool_val(true); + else if (n == "false") + return m_context.bool_val(false); + else + // We assume it is an integer... + return m_context.int_val(n.c_str()); } solAssert(arity.count(n) && arity.at(n) == arguments.size(), ""); |