Added support for derived predicates in goals.

By accident, the support for derived predicates in goals was missing.
This commit adds this, in a very similar way to how normal predicates
are handled in the goal description.
This commit is contained in:
Patrick Lühne 2017-10-27 16:46:38 +02:00
parent 6d07fcbd6c
commit 27f773e091
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
2 changed files with 4 additions and 4 deletions

View File

@ -7,6 +7,7 @@
#include <plasp/TranslatorException.h> #include <plasp/TranslatorException.h>
#include <plasp/pddl/translation/DerivedPredicate.h>
#include <plasp/pddl/translation/Predicate.h> #include <plasp/pddl/translation/Predicate.h>
#include <plasp/pddl/translation/Primitives.h> #include <plasp/pddl/translation/Primitives.h>
@ -39,12 +40,11 @@ inline void translateGoal(colorlog::ColorStream &outputStream, const ::pddl::nor
}; };
const auto handleDerivedPredicate = const auto handleDerivedPredicate =
[&](const ::pddl::normalizedAST::DerivedPredicatePointer &, bool = true) [&](const ::pddl::normalizedAST::DerivedPredicatePointer &derivedPredicate, bool isPositive = true)
{ {
outputStream << std::endl << colorlog::Function("goal") << "("; outputStream << std::endl << colorlog::Function("goal") << "(";
// TODO: assert that goal is variable-free // TODO: assert that goal is variable-free
// TODO: implement translateDerivedPredicateToVariable(outputStream, *derivedPredicate, isPositive);
//translatePredicateToVariable(outputStream, *predicate, isPositive);
outputStream << ")."; outputStream << ").";
}; };

View File

@ -463,7 +463,7 @@ void TranslatorASP::translateGoal() const
m_outputStream << colorlog::Heading2("goal"); m_outputStream << colorlog::Heading2("goal");
const auto &goal = m_description.problem.value()->goal.value(); const auto &goal = m_description.problem.value()->goal.value();
// TODO: refactor
::plasp::pddl::translateGoal(m_outputStream, goal); ::plasp::pddl::translateGoal(m_outputStream, goal);
m_outputStream << std::endl; m_outputStream << std::endl;