diff --git a/src/plasp/pddl/expressions/Not.cpp b/src/plasp/pddl/expressions/Not.cpp index c65bcd0..b31382e 100644 --- a/src/plasp/pddl/expressions/Not.cpp +++ b/src/plasp/pddl/expressions/Not.cpp @@ -41,7 +41,7 @@ ExpressionPointer Not::normalized() { BOOST_ASSERT(m_argument); - // Remove double negations immediately + // Remove immediate double negations if (m_argument->expressionType() == Expression::Type::Not) { auto &argument = dynamic_cast(*m_argument); @@ -49,8 +49,17 @@ ExpressionPointer Not::normalized() return argument.m_argument->normalized(); } + // Normalize argument m_argument = m_argument->normalized(); + // Remove double negations occurring after normalizing the argument + if (m_argument->expressionType() == Expression::Type::Not) + { + auto &argument = dynamic_cast(*m_argument); + + return argument.m_argument->normalized(); + } + // De Morgan for negative conjunctions if (m_argument->expressionType() == Expression::Type::And) {