From 31182b6de9867442b5c0373af1da83ca5bf9e095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 8 Dec 2016 01:28:00 +0100 Subject: [PATCH] Implemented translation of derived predicates in action preconditions. --- include/plasp/pddl/translation/Primitives.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/plasp/pddl/translation/Primitives.h b/include/plasp/pddl/translation/Primitives.h index 51f2b29..24d3dbb 100644 --- a/include/plasp/pddl/translation/Primitives.h +++ b/include/plasp/pddl/translation/Primitives.h @@ -56,15 +56,13 @@ inline void translateLiteral(output::ColorStream &outputStream, const Expression } else if (literal.is()) { - //const auto &derivedPredicate = literal.as(); + const auto &derivedPredicate = literal.as(); - /*m_outputStream << output::Keyword("variable") << "("; - translation::translatePredicate(predicate); - m_outputStream << "), " << output::Keyword("value") << "("; - translation::translatePredicate(predicate); - m_outputStream << ", " << output::Boolean("true") << ")";*/ - - outputStream << "(derived predicate)"; + outputStream << output::Keyword("derivedVariable") << "("; + translation::translateDerivedPredicate(outputStream, derivedPredicate); + outputStream << "), " << output::Keyword("value") << "("; + translation::translateDerivedPredicate(outputStream, derivedPredicate); + outputStream << ", " << output::Boolean("true") << ")"; } else throw output::TranslatorException("only primitive predicates and their negations supported as literals currently");