diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-11-21 22:13:50 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-11-21 22:46:47 +0800 |
commit | 01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64 (patch) | |
tree | b84619e480c5f88cc1f3c57b8b738845e32093d8 /libsolidity/formal/SymbolicTypes.cpp | |
parent | d3f66ca0fab130e801b012bd192e1e8e97fb3761 (diff) | |
download | dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar.gz dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar.bz2 dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar.lz dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar.xz dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.tar.zst dexon-solidity-01ce43e51ba8ced7f2e53f5e9f9e0ea6b718df64.zip |
[SMTChecker] Refactor smt::Sort and its usage
Diffstat (limited to 'libsolidity/formal/SymbolicTypes.cpp')
-rw-r--r-- | libsolidity/formal/SymbolicTypes.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libsolidity/formal/SymbolicTypes.cpp b/libsolidity/formal/SymbolicTypes.cpp index 78bf861b..a3b6e3a8 100644 --- a/libsolidity/formal/SymbolicTypes.cpp +++ b/libsolidity/formal/SymbolicTypes.cpp @@ -24,12 +24,24 @@ using namespace std; using namespace dev::solidity; -smt::Sort dev::solidity::smtSort(Type::Category _category) +smt::SortPointer dev::solidity::smtSort(Type const& _type) +{ + switch (smtKind(_type.category())) + { + case smt::Kind::Int: + return make_shared<smt::Sort>(smt::Kind::Int); + case smt::Kind::Bool: + return make_shared<smt::Sort>(smt::Kind::Bool); + } + solAssert(false, "Invalid type"); +} + +smt::Kind dev::solidity::smtKind(Type::Category _category) { if (isNumber(_category)) - return smt::Sort::Int; + return smt::Kind::Int; else if (isBool(_category)) - return smt::Sort::Bool; + return smt::Kind::Bool; solAssert(false, "Invalid type"); } |