2018-01-17 20:02:23 +00:00
|
|
|
/*
|
|
|
|
This file is part of solidity.
|
|
|
|
|
|
|
|
solidity is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
solidity is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libsolidity/formal/SymbolicVariable.h>
|
|
|
|
|
|
|
|
#include <libsolidity/ast/Types.h>
|
|
|
|
|
|
|
|
namespace dev
|
|
|
|
{
|
|
|
|
namespace solidity
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specialization of SymbolicVariable for Integers
|
|
|
|
*/
|
2018-02-28 17:00:13 +00:00
|
|
|
class SymbolicIntVariable: public SymbolicVariable
|
2018-01-17 20:02:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-02-28 17:00:13 +00:00
|
|
|
SymbolicIntVariable(
|
2018-03-09 15:19:03 +00:00
|
|
|
Declaration const& _decl,
|
2018-02-28 17:00:13 +00:00
|
|
|
smt::SolverInterface& _interface
|
|
|
|
);
|
2018-01-17 20:02:23 +00:00
|
|
|
|
2018-02-17 08:34:38 +00:00
|
|
|
/// Sets the var to 0.
|
2018-01-17 20:02:23 +00:00
|
|
|
void setZeroValue(int _seq);
|
2018-02-28 17:00:13 +00:00
|
|
|
/// Sets the variable to the full valid value range.
|
2018-01-17 20:02:23 +00:00
|
|
|
void setUnknownValue(int _seq);
|
|
|
|
|
2018-02-17 08:34:38 +00:00
|
|
|
static smt::Expression minValue(IntegerType const& _t);
|
|
|
|
static smt::Expression maxValue(IntegerType const& _t);
|
2018-04-05 10:20:41 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
smt::Expression valueAtSequence(int _seq) const;
|
2018-01-17 20:02:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|