mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support some xor.
This commit is contained in:
parent
973442c206
commit
faa3a242ee
@ -318,6 +318,12 @@ void BooleanLPSolver::addAssertion(Expression const& _expr, map<string, LetBindi
|
|||||||
literals.emplace_back(parseLiteralOrReturnEqualBoolean(arg, _letBindings));
|
literals.emplace_back(parseLiteralOrReturnEqualBoolean(arg, _letBindings));
|
||||||
state().clauses.emplace_back(Clause{move(literals)});
|
state().clauses.emplace_back(Clause{move(literals)});
|
||||||
}
|
}
|
||||||
|
else if (_expr.name == "xor")
|
||||||
|
{
|
||||||
|
solAssert(_expr.arguments.size() == 2);
|
||||||
|
addAssertion(_expr.arguments.at(0) || _expr.arguments.at(1));
|
||||||
|
addAssertion(!_expr.arguments.at(0) || !_expr.arguments.at(1));
|
||||||
|
}
|
||||||
else if (_expr.name == "not")
|
else if (_expr.name == "not")
|
||||||
{
|
{
|
||||||
solAssert(_expr.arguments.size() == 1);
|
solAssert(_expr.arguments.size() == 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user