aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/CVC4Interface.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-02 19:04:58 +0800
committerGitHub <noreply@github.com>2018-08-02 19:04:58 +0800
commit6003ed2abdea76e809b1e6501b9e5a85b38e5859 (patch)
treeddef58c0184de1f80a6e5e9a791a6099f15dd98d /libsolidity/formal/CVC4Interface.cpp
parent9ec3fd1632e34abf6aca9d6d3bd0ac0fcfa34f62 (diff)
parent41ac3d6cfb7fedd054f8fbdedf5246ec15670941 (diff)
downloaddexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar.gz
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar.bz2
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar.lz
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar.xz
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.tar.zst
dexon-solidity-6003ed2abdea76e809b1e6501b9e5a85b38e5859.zip
Merge pull request #4603 from ethereum/smtlib2
[SMTLib2] Fix repeated declarations
Diffstat (limited to 'libsolidity/formal/CVC4Interface.cpp')
-rw-r--r--libsolidity/formal/CVC4Interface.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libsolidity/formal/CVC4Interface.cpp b/libsolidity/formal/CVC4Interface.cpp
index 84d36de0..6cb91483 100644
--- a/libsolidity/formal/CVC4Interface.cpp
+++ b/libsolidity/formal/CVC4Interface.cpp
@@ -52,18 +52,23 @@ void CVC4Interface::pop()
void CVC4Interface::declareFunction(string _name, Sort _domain, Sort _codomain)
{
- CVC4::Type fType = m_context.mkFunctionType(cvc4Sort(_domain), cvc4Sort(_codomain));
- m_functions.insert({_name, m_context.mkVar(_name.c_str(), fType)});
+ if (!m_functions.count(_name))
+ {
+ CVC4::Type fType = m_context.mkFunctionType(cvc4Sort(_domain), cvc4Sort(_codomain));
+ m_functions.insert({_name, m_context.mkVar(_name.c_str(), fType)});
+ }
}
void CVC4Interface::declareInteger(string _name)
{
- m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.integerType())});
+ if (!m_constants.count(_name))
+ m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.integerType())});
}
void CVC4Interface::declareBool(string _name)
{
- m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.booleanType())});
+ if (!m_constants.count(_name))
+ m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.booleanType())});
}
void CVC4Interface::addAssertion(Expression const& _expr)