mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rebase on rational solver.
This commit is contained in:
@@ -45,7 +45,9 @@ LinearExpression FuzzerSolverInterface::linearExpression(vector<int> _factors)
|
||||
|
||||
void FuzzerSolverInterface::addLPConstraint(pair<bool, vector<int>> _constraint)
|
||||
{
|
||||
m_lpSolvingState.constraints.push_back({linearExpression(move(_constraint.second)), _constraint.first});
|
||||
m_lpSolvingState.constraints.push_back(
|
||||
{linearExpression(move(_constraint.second)), _constraint.first, {}}
|
||||
);
|
||||
}
|
||||
|
||||
void FuzzerSolverInterface::addLPVariable(string _varName)
|
||||
@@ -95,7 +97,7 @@ void FuzzerSolverInterface::addZ3Constraints(vector<pair<bool, vector<int>>> _co
|
||||
addZ3Constraint(c);
|
||||
}
|
||||
|
||||
solution FuzzerSolverInterface::checkLP()
|
||||
Solution FuzzerSolverInterface::checkLP()
|
||||
{
|
||||
return m_lpSolver.check(m_lpSolvingState);
|
||||
}
|
||||
|
||||
@@ -28,10 +28,9 @@
|
||||
namespace solidity::test::fuzzer::lpsolver
|
||||
{
|
||||
|
||||
using solution = std::pair<
|
||||
solidity::util::LPResult,
|
||||
std::map<std::string, solidity::util::rational>
|
||||
>;
|
||||
using Model = std::map<std::string, solidity::util::rational>;
|
||||
using ReasonSet = std::set<size_t>;
|
||||
using Solution = std::pair<solidity::util::LPResult, std::variant<Model, ReasonSet>>;
|
||||
|
||||
class FuzzerSolverInterface
|
||||
{
|
||||
@@ -54,7 +53,7 @@ public:
|
||||
solidity::util::LinearExpression linearExpression(std::vector<int> _factors);
|
||||
|
||||
/// Queries LP solver and @returns solution.
|
||||
solution checkLP();
|
||||
Solution checkLP();
|
||||
|
||||
/// Queries Z3 solver and @returns solution.
|
||||
z3::check_result checkZ3();
|
||||
|
||||
Reference in New Issue
Block a user