patrick
/
plasp
Archived
1
0
Fork 0

Implemented removal of double negations.

This commit is contained in:
Patrick Lühne 2016-09-02 18:07:37 +02:00
parent 56ce55677f
commit b084a1f727
1 changed files with 8 additions and 0 deletions

View File

@ -47,6 +47,14 @@ ExpressionPointer Not::normalize()
{
BOOST_ASSERT(m_argumentStorage);
// Remove double negations
if (m_argumentStorage->expressionType() == Expression::Type::Not)
{
auto &argument = dynamic_cast<Not &>(*m_argumentStorage);
return std::move(argument.m_argumentStorage);
}
auto normalizedArgument = m_argumentStorage->normalize();
// Replace argument if changed by normalization