[SMTChecker] Clear encoding context before engine starts

This commit is contained in:
Leonardo Alt
2019-07-08 11:56:04 +02:00
parent 019ec63f63
commit be663680d4
5 changed files with 18 additions and 5 deletions
+2
View File
@@ -49,6 +49,8 @@ void BMC::analyze(SourceUnit const& _source, shared_ptr<Scanner> const& _scanner
m_scanner = _scanner;
m_context.clear();
_source.accept(*this);
solAssert(m_interface->solvers() > 0, "");
+6
View File
@@ -44,6 +44,12 @@ void EncodingContext::reset()
m_assertions.clear();
}
void EncodingContext::clear()
{
m_variables.clear();
reset();
}
/// Variables.
shared_ptr<SymbolicVariable> EncodingContext::variable(solidity::VariableDeclaration const& _varDecl)
+6 -1
View File
@@ -38,8 +38,13 @@ class EncodingContext
public:
EncodingContext(std::shared_ptr<SolverInterface> _solver);
/// Resets the entire context.
/// Resets the entire context except for symbolic variables which stay
/// alive because of state variables and inlined function calls.
/// To be used in the beginning of a root function visit.
void reset();
/// Clears the entire context, erasing everything.
/// To be used before a model checking engine starts.
void clear();
/// Forwards variable creation to the solver.
Expression newVariable(std::string _name, SortPointer _sort)