Fixed missing normalization step of arguments to imply statements and extended test to cover the issue.

This commit is contained in:
Patrick Lühne 2016-09-02 19:25:25 +02:00
parent 23e851ccef
commit 63de1891af
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,11 @@ ExpressionPointer Imply::normalize()
orExpression->addArgument(std::move(notArgument0)); orExpression->addArgument(std::move(notArgument0));
orExpression->addArgument(std::move(m_argumentStorage[1])); orExpression->addArgument(std::move(m_argumentStorage[1]));
auto normalizedOrExpression = orExpression->normalize();
if (normalizedOrExpression)
return normalizedOrExpression;
return std::move(orExpression); return std::move(orExpression);
} }

View File

@ -32,6 +32,8 @@ TEST(PDDLNormalizationTests, Implication)
ASSERT_EQ(n.argument(), d1p); ASSERT_EQ(n.argument(), d1p);
ASSERT_EQ(o.arguments()[1], d2p); ASSERT_EQ(o.arguments()[1], d2p);
ASSERT_TRUE(d1p->isNormalized());
ASSERT_TRUE(d2p->isNormalized());
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////