aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/SMTChecker.h
diff options
context:
space:
mode:
authorLeonardo Alt <leonardoaltt@gmail.com>2017-12-12 03:09:17 +0800
committerLeonardo Alt <leonardoaltt@gmail.com>2017-12-14 00:39:10 +0800
commit2af4d7c7dd3379d8956907413258cea884c80794 (patch)
tree3a71dc6e65b555f11d6cc3667c12564f1c647808 /libsolidity/formal/SMTChecker.h
parentbfc54463181a617c1a523826b34c210222c98740 (diff)
downloaddexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar.gz
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar.bz2
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar.lz
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar.xz
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.tar.zst
dexon-solidity-2af4d7c7dd3379d8956907413258cea884c80794.zip
[SMTChecker] Keep track of current path conditions
Diffstat (limited to 'libsolidity/formal/SMTChecker.h')
-rw-r--r--libsolidity/formal/SMTChecker.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/formal/SMTChecker.h b/libsolidity/formal/SMTChecker.h
index e7481cca..7f990b97 100644
--- a/libsolidity/formal/SMTChecker.h
+++ b/libsolidity/formal/SMTChecker.h
@@ -26,6 +26,7 @@
#include <map>
#include <string>
+#include <vector>
namespace dev
{
@@ -145,6 +146,13 @@ private:
/// The function takes one argument which is the "sequence number".
smt::Expression var(Declaration const& _decl);
+ /// Adds a new path condition
+ void pushPathCondition(smt::Expression const& _e);
+ /// Remove the last path condition
+ void popPathCondition();
+ /// Returns the conjunction of all path conditions or True if empty
+ smt::Expression currentPathConditions();
+
std::shared_ptr<smt::SolverInterface> m_interface;
std::shared_ptr<VariableUsage> m_variableUsage;
bool m_conditionalExecutionHappened = false;
@@ -152,6 +160,7 @@ private:
std::map<Declaration const*, int> m_nextFreeSequenceCounter;
std::map<Expression const*, smt::Expression> m_expressions;
std::map<Declaration const*, smt::Expression> m_variables;
+ std::vector<smt::Expression> m_pathConditions;
ErrorReporter& m_errorReporter;
FunctionDefinition const* m_currentFunction = nullptr;