Implemented simplification of directly nested n-ary expressions of the same type.

This commit is contained in:
2016-09-05 00:37:43 +02:00
parent 79d449d0df
commit 263b611a7b
4 changed files with 70 additions and 10 deletions

View File

@@ -26,7 +26,7 @@ namespace pddl
ExpressionPointer Expression::normalized()
{
return reduced()->negationNormalized();
return reduced()->negationNormalized()->simplified();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -45,6 +45,13 @@ ExpressionPointer Expression::negationNormalized()
////////////////////////////////////////////////////////////////////////////////////////////////////
ExpressionPointer Expression::simplified()
{
return this;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
ExpressionPointer Expression::negated()
{
if (expressionType() == Type::Not)