mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Replace real division by integer division
This commit is contained in:
parent
fdf4c1ed9a
commit
3a0358bfb7
@ -188,7 +188,7 @@ CVC4::Expr CVC4Interface::toCVC4Expr(Expression const& _expr)
|
|||||||
return m_context.mkExpr(CVC4::kind::MINUS, arguments[0], arguments[1]);
|
return m_context.mkExpr(CVC4::kind::MINUS, arguments[0], arguments[1]);
|
||||||
else if (n == "*")
|
else if (n == "*")
|
||||||
return m_context.mkExpr(CVC4::kind::MULT, arguments[0], arguments[1]);
|
return m_context.mkExpr(CVC4::kind::MULT, arguments[0], arguments[1]);
|
||||||
else if (n == "/")
|
else if (n == "div")
|
||||||
return m_context.mkExpr(CVC4::kind::INTS_DIVISION_TOTAL, arguments[0], arguments[1]);
|
return m_context.mkExpr(CVC4::kind::INTS_DIVISION_TOTAL, arguments[0], arguments[1]);
|
||||||
else if (n == "mod")
|
else if (n == "mod")
|
||||||
return m_context.mkExpr(CVC4::kind::INTS_MODULUS, arguments[0], arguments[1]);
|
return m_context.mkExpr(CVC4::kind::INTS_MODULUS, arguments[0], arguments[1]);
|
||||||
|
@ -95,7 +95,7 @@ public:
|
|||||||
{"+", 2},
|
{"+", 2},
|
||||||
{"-", 2},
|
{"-", 2},
|
||||||
{"*", 2},
|
{"*", 2},
|
||||||
{"/", 2},
|
{"div", 2},
|
||||||
{"mod", 2},
|
{"mod", 2},
|
||||||
{"bvnot", 1},
|
{"bvnot", 1},
|
||||||
{"bvand", 2},
|
{"bvand", 2},
|
||||||
@ -300,7 +300,7 @@ public:
|
|||||||
friend Expression operator/(Expression _a, Expression _b)
|
friend Expression operator/(Expression _a, Expression _b)
|
||||||
{
|
{
|
||||||
auto intSort = _a.sort;
|
auto intSort = _a.sort;
|
||||||
return Expression("/", {std::move(_a), std::move(_b)}, intSort);
|
return Expression("div", {std::move(_a), std::move(_b)}, intSort);
|
||||||
}
|
}
|
||||||
friend Expression operator%(Expression _a, Expression _b)
|
friend Expression operator%(Expression _a, Expression _b)
|
||||||
{
|
{
|
||||||
|
@ -207,7 +207,7 @@ z3::expr Z3Interface::toZ3Expr(Expression const& _expr)
|
|||||||
return arguments[0] - arguments[1];
|
return arguments[0] - arguments[1];
|
||||||
else if (n == "*")
|
else if (n == "*")
|
||||||
return arguments[0] * arguments[1];
|
return arguments[0] * arguments[1];
|
||||||
else if (n == "/")
|
else if (n == "div")
|
||||||
return arguments[0] / arguments[1];
|
return arguments[0] / arguments[1];
|
||||||
else if (n == "mod")
|
else if (n == "mod")
|
||||||
return z3::mod(arguments[0], arguments[1]);
|
return z3::mod(arguments[0], arguments[1]);
|
||||||
|
Loading…
Reference in New Issue
Block a user