diff options
author | chriseth <chris@ethereum.org> | 2017-09-29 22:53:26 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-11-22 10:35:34 +0800 |
commit | 22c689d516bc69b49797005de0cd64c23fcaad2f (patch) | |
tree | e36791f5d514af7cdb133de89198c2e1906d5eba /libsolidity/formal/SMTChecker.h | |
parent | e5de4a66eda8211bb38b874f7683534d6cfc1c24 (diff) | |
download | dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar.gz dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar.bz2 dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar.lz dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar.xz dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.tar.zst dexon-solidity-22c689d516bc69b49797005de0cd64c23fcaad2f.zip |
Check for conditions being constant.
Diffstat (limited to 'libsolidity/formal/SMTChecker.h')
-rw-r--r-- | libsolidity/formal/SMTChecker.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libsolidity/formal/SMTChecker.h b/libsolidity/formal/SMTChecker.h index b2726a42..85a37f2c 100644 --- a/libsolidity/formal/SMTChecker.h +++ b/libsolidity/formal/SMTChecker.h @@ -72,6 +72,7 @@ private: void visitBranch(Statement const& _statement, smt::Expression const* _condition = nullptr); void visitBranch(Statement const& _statement, smt::Expression _condition); + /// Check that a condition can be satisfied. void checkCondition( smt::Expression _condition, SourceLocation const& _location, @@ -79,6 +80,18 @@ private: std::string const& _additionalValueName = "", smt::Expression* _additionalValue = nullptr ); + /// Checks that a boolean condition is not constant. Do not warn if the expression + /// is a literal constant. + /// @param _description the warning string, $VALUE will be replaced by the constant value. + void checkBooleanNotConstant( + Expression const& _condition, + std::string const& _description + ); + + std::pair<smt::CheckResult, std::vector<std::string>> + checkSatisifableAndGenerateModel(std::vector<smt::Expression> const& _expressionsToEvaluate); + + smt::CheckResult checkSatisifable(); void initializeLocalVariables(FunctionDefinition const& _function); void resetVariables(std::vector<Declaration const*> _variables); |