aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/Z3Interface.cpp
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-10-25 22:00:09 +0800
committerLeonardo Alt <leo@ethereum.org>2018-11-15 16:12:42 +0800
commit70bb0eaf95ab6a549f875b845395b31a5d49f99e (patch)
tree99853ad465f155d92598d2a152510b066efa395a /libsolidity/formal/Z3Interface.cpp
parent92ebf6606764748229acf07e83dbe3824bde540e (diff)
downloaddexon-solidity-70bb0eaf95ab6a549f875b845395b31a5d49f99e.tar.gz
dexon-solidity-70bb0eaf95ab6a549f875b845395b31a5d49f99e.tar.zst
dexon-solidity-70bb0eaf95ab6a549f875b845395b31a5d49f99e.zip
[SMTChecker] Implement uninterpreted functions and use it for blockhash()
Diffstat (limited to 'libsolidity/formal/Z3Interface.cpp')
-rw-r--r--libsolidity/formal/Z3Interface.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libsolidity/formal/Z3Interface.cpp b/libsolidity/formal/Z3Interface.cpp
index 9a0ccf48..2519e41b 100644
--- a/libsolidity/formal/Z3Interface.cpp
+++ b/libsolidity/formal/Z3Interface.cpp
@@ -51,7 +51,7 @@ void Z3Interface::pop()
m_solver.pop();
}
-void Z3Interface::declareFunction(string _name, Sort _domain, Sort _codomain)
+void Z3Interface::declareFunction(string _name, vector<Sort> const& _domain, Sort _codomain)
{
if (!m_functions.count(_name))
m_functions.insert({_name, m_context.function(_name.c_str(), z3Sort(_domain), z3Sort(_codomain))});
@@ -183,3 +183,11 @@ z3::sort Z3Interface::z3Sort(Sort _sort)
// Cannot be reached.
return m_context.int_sort();
}
+
+z3::sort_vector Z3Interface::z3Sort(vector<Sort> const& _sorts)
+{
+ z3::sort_vector z3Sorts(m_context);
+ for (auto const& _sort: _sorts)
+ z3Sorts.push_back(z3Sort(_sort));
+ return z3Sorts;
+}