mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove repeated declarations in Z3 and CVC4 as well
This commit is contained in:
parent
f249f9c86f
commit
41ac3d6cfb
@ -52,17 +52,22 @@ void CVC4Interface::pop()
|
||||
|
||||
void CVC4Interface::declareFunction(string _name, Sort _domain, Sort _codomain)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (!m_constants.count(_name))
|
||||
m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.integerType())});
|
||||
}
|
||||
|
||||
void CVC4Interface::declareBool(string _name)
|
||||
{
|
||||
if (!m_constants.count(_name))
|
||||
m_constants.insert({_name, m_context.mkVar(_name.c_str(), m_context.booleanType())});
|
||||
}
|
||||
|
||||
|
@ -53,16 +53,19 @@ void Z3Interface::pop()
|
||||
|
||||
void Z3Interface::declareFunction(string _name, Sort _domain, Sort _codomain)
|
||||
{
|
||||
if (!m_functions.count(_name))
|
||||
m_functions.insert({_name, m_context.function(_name.c_str(), z3Sort(_domain), z3Sort(_codomain))});
|
||||
}
|
||||
|
||||
void Z3Interface::declareInteger(string _name)
|
||||
{
|
||||
if (!m_constants.count(_name))
|
||||
m_constants.insert({_name, m_context.int_const(_name.c_str())});
|
||||
}
|
||||
|
||||
void Z3Interface::declareBool(string _name)
|
||||
{
|
||||
if (!m_constants.count(_name))
|
||||
m_constants.insert({_name, m_context.bool_const(_name.c_str())});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user