diff options
author | chriseth <chris@ethereum.org> | 2018-04-20 01:24:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 01:24:01 +0800 |
commit | 124ca40dc525a987a88176c6e5170978e82fa290 (patch) | |
tree | b1c1da8a9a6ba886bb43f115328a18222f59553d /libsolidity/formal/SolverInterface.h | |
parent | 4cb486ee993cadde5564fb6c611d2bcf4fc44414 (diff) | |
parent | 7fb431ad7d0f7667c83d3f9b2350c3a1cef73b9e (diff) | |
download | dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar.gz dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar.bz2 dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar.lz dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar.xz dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.tar.zst dexon-solidity-124ca40dc525a987a88176c6e5170978e82fa290.zip |
Merge pull request #3950 from ethereum/develop
Merge develop into release for 0.4.23
Diffstat (limited to 'libsolidity/formal/SolverInterface.h')
-rw-r--r-- | libsolidity/formal/SolverInterface.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libsolidity/formal/SolverInterface.h b/libsolidity/formal/SolverInterface.h index 0bdebb6c..e127bb55 100644 --- a/libsolidity/formal/SolverInterface.h +++ b/libsolidity/formal/SolverInterface.h @@ -65,6 +65,26 @@ public: Expression& operator=(Expression const&) = default; Expression& operator=(Expression&&) = default; + bool hasCorrectArity() const + { + static std::map<std::string, unsigned> const operatorsArity{ + {"ite", 3}, + {"not", 1}, + {"and", 2}, + {"or", 2}, + {"=", 2}, + {"<", 2}, + {"<=", 2}, + {">", 2}, + {">=", 2}, + {"+", 2}, + {"-", 2}, + {"*", 2}, + {"/", 2} + }; + return operatorsArity.count(name) && operatorsArity.at(name) == arguments.size(); + } + static Expression ite(Expression _condition, Expression _trueValue, Expression _falseValue) { solAssert(_trueValue.sort == _falseValue.sort, ""); |