Fixed issue with multiple negations.
This commit is contained in:
parent
63de1891af
commit
da88a8816c
@ -47,13 +47,16 @@ ExpressionPointer Not::normalize()
|
||||
{
|
||||
BOOST_ASSERT(m_argumentStorage);
|
||||
|
||||
// Remove double negations
|
||||
// Remove double negations immediately
|
||||
if (m_argumentStorage->expressionType() == Expression::Type::Not)
|
||||
{
|
||||
auto &argument = dynamic_cast<Not &>(*m_argumentStorage);
|
||||
|
||||
auto normalized = std::move(argument.m_argumentStorage);
|
||||
normalized->normalize();
|
||||
auto normalizedInner = normalized->normalize();
|
||||
|
||||
if (normalizedInner)
|
||||
return normalizedInner;
|
||||
|
||||
return normalized;
|
||||
}
|
||||
|
Reference in New Issue
Block a user