From da88a8816c94db4027f872d832845c9eeecf105e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 3 Sep 2016 00:25:58 +0200 Subject: [PATCH] Fixed issue with multiple negations. --- src/plasp/pddl/expressions/Not.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plasp/pddl/expressions/Not.cpp b/src/plasp/pddl/expressions/Not.cpp index 0190d0b..40ed93b 100644 --- a/src/plasp/pddl/expressions/Not.cpp +++ b/src/plasp/pddl/expressions/Not.cpp @@ -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(*m_argumentStorage); auto normalized = std::move(argument.m_argumentStorage); - normalized->normalize(); + auto normalizedInner = normalized->normalize(); + + if (normalizedInner) + return normalizedInner; return normalized; }