From 1dd55715f1c50fcde9155dfcba711787e0bd673f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sun, 22 May 2016 20:21:31 +0200 Subject: [PATCH] Reordered ASP output. --- src/plasp/sas/TranslatorASP.cpp | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/plasp/sas/TranslatorASP.cpp b/src/plasp/sas/TranslatorASP.cpp index 05da185..41718be 100644 --- a/src/plasp/sas/TranslatorASP.cpp +++ b/src/plasp/sas/TranslatorASP.cpp @@ -96,32 +96,6 @@ void TranslatorASP::translate(std::ostream &ostream) const ostream << "fluent(" << *fluent << ")." << std::endl; }); - ostream << std::endl; - ostream << "% initial state" << std::endl; - - const auto &initialStateFacts = m_description.initialState().facts(); - - std::for_each(initialStateFacts.cbegin(), initialStateFacts.cend(), - [&](const auto &fact) - { - ostream << "init("; - fact.value().printAsASPCommaSeparated(ostream); - ostream << ")." << std::endl; - }); - - ostream << std::endl; - ostream << "% goal" << std::endl; - - const auto &goalFacts = m_description.goal().facts(); - - std::for_each(goalFacts.cbegin(), goalFacts.cend(), - [&](const auto &fact) - { - ostream << "goal("; - fact.value().printAsASPCommaSeparated(ostream); - ostream << ")." << std::endl; - }); - ostream << std::endl; ostream << "% actions" << std::endl; @@ -159,6 +133,32 @@ void TranslatorASP::translate(std::ostream &ostream) const }); }); + ostream << std::endl; + ostream << "% initial state" << std::endl; + + const auto &initialStateFacts = m_description.initialState().facts(); + + std::for_each(initialStateFacts.cbegin(), initialStateFacts.cend(), + [&](const auto &fact) + { + ostream << "init("; + fact.value().printAsASPCommaSeparated(ostream); + ostream << ")." << std::endl; + }); + + ostream << std::endl; + ostream << "% goal" << std::endl; + + const auto &goalFacts = m_description.goal().facts(); + + std::for_each(goalFacts.cbegin(), goalFacts.cend(), + [&](const auto &fact) + { + ostream << "goal("; + fact.value().printAsASPCommaSeparated(ostream); + ostream << ")." << std::endl; + }); + ostream << std::endl; ostream << "% constraints derived from SAS variables" << std::endl;