From 2e52357dd2bff4dc81b916b814d8a5a5185ecd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 6 Sep 2016 22:36:48 +0200 Subject: [PATCH] Allowing universal quantifiers in effect expressions. --- src/plasp/pddl/Expression.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plasp/pddl/Expression.cpp b/src/plasp/pddl/Expression.cpp index 9a07b55..e6ec15f 100644 --- a/src/plasp/pddl/Expression.cpp +++ b/src/plasp/pddl/Expression.cpp @@ -85,11 +85,11 @@ ExpressionPointer parsePreconditionExpression(Context &context, ExpressionPointer expression; - if ((expression = expressions::And::parse(context, expressionContext, parsePreconditionExpression))) - return expression; - - if ((expression = expressions::ForAll::parse(context, expressionContext, parsePreconditionExpression))) + if ((expression = expressions::And::parse(context, expressionContext, parsePreconditionExpression)) + || (expression = expressions::ForAll::parse(context, expressionContext, parsePreconditionExpression))) + { return expression; + } const auto position = parser.position(); @@ -172,8 +172,11 @@ ExpressionPointer parseEffectExpression(Context &context, ExpressionContext &exp ExpressionPointer expression; - if ((expression = expressions::And::parse(context, expressionContext, parseEffectExpression))) + if ((expression = expressions::And::parse(context, expressionContext, parseEffectExpression)) + || (expression = expressions::ForAll::parse(context, expressionContext, parseEffectExpression))) + { return expression; + } const auto position = parser.position(); @@ -181,8 +184,7 @@ ExpressionPointer parseEffectExpression(Context &context, ExpressionContext &exp const auto expressionIdentifierPosition = parser.position(); - if (parser.testIdentifierAndSkip("forall") - || parser.testIdentifierAndSkip("when")) + if (parser.testIdentifierAndSkip("when")) { parser.seek(expressionIdentifierPosition); const auto expressionIdentifier = parser.parseIdentifier();