From 458dbd723c0ba25e2bb5021429a94b3066e70893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Fri, 10 Jun 2016 17:48:17 +0200 Subject: [PATCH] Restructured translated PDDL type output. --- src/plasp/pddl/TranslatorASP.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/plasp/pddl/TranslatorASP.cpp b/src/plasp/pddl/TranslatorASP.cpp index 200bb7e..fb44568 100644 --- a/src/plasp/pddl/TranslatorASP.cpp +++ b/src/plasp/pddl/TranslatorASP.cpp @@ -40,28 +40,23 @@ void TranslatorASP::translateDomain(std::ostream &ostream) const const auto &domain = m_description.domain(); // Types - ostream << "% types" << std::endl; + ostream << "% types"; const auto &types = domain.types(); std::for_each(types.cbegin(), types.cend(), [&](const auto &type) { + ostream << std::endl; + ostream << "type(" << type->name() << ")." << std::endl; - }); - // Type inheritance - ostream << std::endl << "% type inheritance" << std::endl; - - std::for_each(types.cbegin(), types.cend(), - [&](const auto &type) - { const auto &parentTypes = type->parentTypes(); std::for_each(parentTypes.cbegin(), parentTypes.cend(), [&](const auto &parentType) { - ostream << "inheritsFrom(type(" << type->name() << "), type(" << parentType->name() << "))." << std::endl; + ostream << "inherits(type(" << type->name() << "), type(" << parentType->name() << "))." << std::endl; }); }); }