Added missing argument to ASP predicate.

This commit is contained in:
Patrick Lühne 2017-06-28 00:35:28 +02:00
parent d82ae8544b
commit a5038535f4
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -240,7 +240,14 @@ void TranslatorASP::translateDerivedPredicates() const
if (enumerateExistentialParameters && !derivedPredicate->existentialParameters.empty())
translateVariablesForRuleHead(m_outputStream, derivedPredicate->existentialParameters);
m_outputStream << "))";
m_outputStream << ")), " << colorlog::Keyword("type") << "(";
if (derivedPredicate->precondition.value().is<::pddl::normalizedAST::OrPointer<::pddl::normalizedAST::Literal>>())
m_outputStream << colorlog::Reserved("or");
else
m_outputStream << colorlog::Reserved("and");
m_outputStream << ")";
};
m_outputStream << std::endl;
@ -248,14 +255,7 @@ void TranslatorASP::translateDerivedPredicates() const
// Name
m_outputStream << colorlog::Function("derivedPredicate") << "(";
printDerivedPredicateName();
m_outputStream << ", " << colorlog::Keyword("type") << "(";
if (derivedPredicate->precondition.value().is<::pddl::normalizedAST::OrPointer<::pddl::normalizedAST::Literal>>())
m_outputStream << colorlog::Reserved("or");
else
m_outputStream << colorlog::Reserved("and");
m_outputStream << "))";
m_outputStream << ")";
if (!derivedPredicate->parameters.empty() || !derivedPredicate->existentialParameters.empty())
m_outputStream << " :- ";