From a8ba375e36f36e3de3603e0adef983683b0999a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Wed, 7 Dec 2016 02:58:25 +0100 Subject: [PATCH] Implemented printing body of derived predicate definition rules. --- src/plasp/pddl/Action.cpp | 11 +++++++++++ src/plasp/pddl/TranslatorASP.cpp | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/plasp/pddl/Action.cpp b/src/plasp/pddl/Action.cpp index 8e29923..1d86e51 100644 --- a/src/plasp/pddl/Action.cpp +++ b/src/plasp/pddl/Action.cpp @@ -92,7 +92,18 @@ void Action::normalize(expressions::DerivedPredicates &derivedPredicates) { // Normalize preconditions and effects m_precondition = m_precondition->normalized()->decomposed(derivedPredicates); + { + // TODO: refactor + std::set parameters; + m_precondition->collectParameters(parameters); + } + m_effect = m_effect->normalized(); + { + // TODO: refactor + std::set parameters; + m_effect->collectParameters(parameters); + } // Normalize parameter names for (size_t i = 0; i < m_parameters.size(); i++) diff --git a/src/plasp/pddl/TranslatorASP.cpp b/src/plasp/pddl/TranslatorASP.cpp index f9c00ee..20271c8 100644 --- a/src/plasp/pddl/TranslatorASP.cpp +++ b/src/plasp/pddl/TranslatorASP.cpp @@ -235,8 +235,7 @@ void TranslatorASP::translateDerivedPredicates() const m_outputStream << "))"; - // TODO: implement - //translateVariablesBody(m_outputStream, predicate->arguments()); + translateVariablesBody(m_outputStream, predicate->parameters()); m_outputStream << "."; });