aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/SymbolicVariables.h
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-11-22 21:48:31 +0800
committerLeonardo Alt <leo@ethereum.org>2018-11-22 23:42:51 +0800
commitec84a7dc9b7ed9cfd5b562ee570c6ad13bdfbeb7 (patch)
tree62b538aa9c93380bccdecb515494cb64ba68d1bd /libsolidity/formal/SymbolicVariables.h
parentbe321090e665da4919dc7a41e909032f60ea2dd7 (diff)
downloaddexon-solidity-ec84a7dc9b7ed9cfd5b562ee570c6ad13bdfbeb7.tar.gz
dexon-solidity-ec84a7dc9b7ed9cfd5b562ee570c6ad13bdfbeb7.tar.zst
dexon-solidity-ec84a7dc9b7ed9cfd5b562ee570c6ad13bdfbeb7.zip
[SMTChecker] Refactor setZeroValue and setUnknownValue
Diffstat (limited to 'libsolidity/formal/SymbolicVariables.h')
-rw-r--r--libsolidity/formal/SymbolicVariables.h21
1 files changed, 3 insertions, 18 deletions
diff --git a/libsolidity/formal/SymbolicVariables.h b/libsolidity/formal/SymbolicVariables.h
index 13b944a5..fcf32760 100644
--- a/libsolidity/formal/SymbolicVariables.h
+++ b/libsolidity/formal/SymbolicVariables.h
@@ -64,20 +64,15 @@ public:
unsigned index() const { return m_ssa->index(); }
unsigned& index() { return m_ssa->index(); }
- /// Sets the var to the default value of its type.
- /// Inherited types must implement.
- virtual void setZeroValue() = 0;
- /// The unknown value is the full range of valid values.
- /// It is sub-type dependent, but not mandatory.
- virtual void setUnknownValue() {}
+ TypePointer const& type() const { return m_type; }
protected:
std::string uniqueSymbol(unsigned _index) const;
- TypePointer m_type = nullptr;
+ TypePointer m_type;
std::string m_uniqueName;
smt::SolverInterface& m_interface;
- std::shared_ptr<SSAVariable> m_ssa = nullptr;
+ std::shared_ptr<SSAVariable> m_ssa;
};
/**
@@ -92,11 +87,6 @@ public:
smt::SolverInterface& _interface
);
- /// Sets the var to false.
- void setZeroValue();
- /// Does nothing since the SMT solver already knows the valid values for Bool.
- void setUnknownValue();
-
protected:
smt::Expression valueAtIndex(int _index) const;
};
@@ -113,11 +103,6 @@ public:
smt::SolverInterface& _interface
);
- /// Sets the var to 0.
- void setZeroValue();
- /// Sets the variable to the full valid value range.
- void setUnknownValue();
-
protected:
smt::Expression valueAtIndex(int _index) const;
};