aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/SMTCheckerImpl.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-11 00:13:38 +0800
committerchriseth <chris@ethereum.org>2017-08-23 20:24:05 +0800
commitdf848859da0ce52a7bb1de6fcd836e0b7ebc2779 (patch)
tree12ba5b53db4d257f7f9e96b4d8f6bf6bf98f6d98 /libsolidity/formal/SMTCheckerImpl.h
parent1ece7bf4433a37feb449b7f3b4f820a1f5740eaf (diff)
downloaddexon-solidity-df848859da0ce52a7bb1de6fcd836e0b7ebc2779.tar.gz
dexon-solidity-df848859da0ce52a7bb1de6fcd836e0b7ebc2779.tar.zst
dexon-solidity-df848859da0ce52a7bb1de6fcd836e0b7ebc2779.zip
Rewrite using SMTLIB2 interface.
Diffstat (limited to 'libsolidity/formal/SMTCheckerImpl.h')
-rw-r--r--libsolidity/formal/SMTCheckerImpl.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/libsolidity/formal/SMTCheckerImpl.h b/libsolidity/formal/SMTCheckerImpl.h
index a82ec92a..e5179440 100644
--- a/libsolidity/formal/SMTCheckerImpl.h
+++ b/libsolidity/formal/SMTCheckerImpl.h
@@ -18,8 +18,7 @@
#pragma once
#include <libsolidity/ast/ASTVisitor.h>
-
-#include <z3++.h>
+#include <libsolidity/formal/SMTLib2Interface.h>
#include <map>
#include <string>
@@ -60,11 +59,11 @@ private:
void booleanOperation(BinaryOperation const& _op);
void checkCondition(
- z3::expr _condition,
+ smt::Expression _condition,
SourceLocation const& _location,
std::string const& _description,
std::string const& _additionalValueName = "",
- z3::expr* _additionalValue = nullptr
+ smt::Expression* _additionalValue = nullptr
);
void createVariable(VariableDeclaration const& _varDecl, bool _setToZero);
@@ -72,24 +71,23 @@ private:
std::string uniqueSymbol(Declaration const& _decl);
std::string uniqueSymbol(Expression const& _expr);
bool knownVariable(Declaration const& _decl);
- z3::expr currentValue(Declaration const& _decl);
- z3::expr newValue(Declaration const& _decl);
+ smt::Expression currentValue(Declaration const& _decl);
+ smt::Expression newValue(Declaration const& _decl);
- z3::expr minValue(IntegerType const& _t);
- z3::expr maxValue(IntegerType const& _t);
+ smt::Expression minValue(IntegerType const& _t);
+ smt::Expression maxValue(IntegerType const& _t);
/// Returns the z3 expression corresponding to the AST node. Creates a new expression
/// if it does not exist yet.
- z3::expr expr(Expression const& _e);
+ smt::Expression expr(Expression const& _e);
/// Returns the z3 function declaration corresponding to the given variable.
/// The function takes one argument which is the "sequence number".
- z3::func_decl var(Declaration const& _decl);
+ smt::Expression var(Declaration const& _decl);
- z3::context m_context;
- z3::solver m_solver;
+ smt::SMTLib2Interface m_interface;
std::map<Declaration const*, int> m_currentSequenceCounter;
- std::map<Expression const*, z3::expr> m_z3Expressions;
- std::map<Declaration const*, z3::func_decl> m_z3Variables;
+ std::map<Expression const*, smt::Expression> m_z3Expressions;
+ std::map<Declaration const*, smt::Expression> m_z3Variables;
ErrorReporter& m_errorReporter;
FunctionDefinition const* m_currentFunction = nullptr;