aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-27 20:56:30 +0800
committerGitHub <noreply@github.com>2018-07-27 20:56:30 +0800
commitc633ebe2e6abb9799458c5e1730bd8919232f916 (patch)
tree5746de73ba539bbae43c50093dedd8fc8b9a0801
parentbc51b0f6c257e8abc47a7375a6397e1310e8d298 (diff)
parent06dbcb3afea63a935afc492b926f6b434bb78fa4 (diff)
downloaddexon-solidity-c633ebe2e6abb9799458c5e1730bd8919232f916.tar.gz
dexon-solidity-c633ebe2e6abb9799458c5e1730bd8919232f916.tar.zst
dexon-solidity-c633ebe2e6abb9799458c5e1730bd8919232f916.zip
Merge pull request #4599 from ethereum/smt_sat_model
SMTChecker: Only ask for a model if it's SAT
-rw-r--r--libsolidity/formal/CVC4Interface.cpp2
-rw-r--r--libsolidity/formal/SMTLib2Interface.cpp2
-rw-r--r--libsolidity/formal/Z3Interface.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/formal/CVC4Interface.cpp b/libsolidity/formal/CVC4Interface.cpp
index c6f2771d..0cb70d2f 100644
--- a/libsolidity/formal/CVC4Interface.cpp
+++ b/libsolidity/formal/CVC4Interface.cpp
@@ -109,7 +109,7 @@ pair<CheckResult, vector<string>> CVC4Interface::check(vector<Expression> const&
solAssert(false, "");
}
- if (result != CheckResult::UNSATISFIABLE && !_expressionsToEvaluate.empty())
+ if (result == CheckResult::SATISFIABLE && !_expressionsToEvaluate.empty())
{
for (Expression const& e: _expressionsToEvaluate)
values.push_back(toString(m_solver.getValue(toCVC4Expr(e))));
diff --git a/libsolidity/formal/SMTLib2Interface.cpp b/libsolidity/formal/SMTLib2Interface.cpp
index 0e00665a..00ac523f 100644
--- a/libsolidity/formal/SMTLib2Interface.cpp
+++ b/libsolidity/formal/SMTLib2Interface.cpp
@@ -112,7 +112,7 @@ pair<CheckResult, vector<string>> SMTLib2Interface::check(vector<Expression> con
result = CheckResult::ERROR;
vector<string> values;
- if (result != CheckResult::UNSATISFIABLE && result != CheckResult::ERROR)
+ if (result == CheckResult::SATISFIABLE && result != CheckResult::ERROR)
values = parseValues(find(response.cbegin(), response.cend(), '\n'), response.cend());
return make_pair(result, values);
}
diff --git a/libsolidity/formal/Z3Interface.cpp b/libsolidity/formal/Z3Interface.cpp
index 41943c92..7e0788b3 100644
--- a/libsolidity/formal/Z3Interface.cpp
+++ b/libsolidity/formal/Z3Interface.cpp
@@ -92,7 +92,7 @@ pair<CheckResult, vector<string>> Z3Interface::check(vector<Expression> const& _
solAssert(false, "");
}
- if (result != CheckResult::UNSATISFIABLE && !_expressionsToEvaluate.empty())
+ if (result == CheckResult::SATISFIABLE && !_expressionsToEvaluate.empty())
{
z3::model m = m_solver.get_model();
for (Expression const& e: _expressionsToEvaluate)