diff --git a/src/plasp/pddl/TranslatorASP.cpp b/src/plasp/pddl/TranslatorASP.cpp index af45d8d..3d609a0 100644 --- a/src/plasp/pddl/TranslatorASP.cpp +++ b/src/plasp/pddl/TranslatorASP.cpp @@ -333,6 +333,29 @@ void TranslatorASP::translateActions() const } } + // Effect + if (action->effect()) + { + const auto &effect = *action->effect(); + + if (effect.expressionType() == Expression::Type::Predicate + || effect.expressionType() == Expression::Type::Not) + { + translateLiteral("postcondition", effect); + } + // Assuming a conjunction + else + { + const auto &andExpression = dynamic_cast(effect); + + std::for_each(andExpression.arguments().cbegin(), andExpression.arguments().cend(), + [&](const auto *argument) + { + translateLiteral("postcondition", *argument); + }); + } + } + m_ostream << std::endl; }); }