Further simplified the output of the PDDL variable value facts.
This commit is contained in:
parent
363070b579
commit
5e28dd046b
@ -130,10 +130,7 @@ void TranslatorASP::translateTypes() const
|
|||||||
|
|
||||||
void TranslatorASP::translatePredicates() const
|
void TranslatorASP::translatePredicates() const
|
||||||
{
|
{
|
||||||
m_outputStream
|
m_outputStream << utils::Heading2("variables");
|
||||||
<< utils::Heading2("variables") << std::endl
|
|
||||||
<< utils::RuleName("boolean") << "(" << utils::Boolean("true") << ")." << std::endl
|
|
||||||
<< utils::RuleName("boolean") << "(" << utils::Boolean("false") << ")." << std::endl;
|
|
||||||
|
|
||||||
const auto &predicates = m_description.domain().predicates();
|
const auto &predicates = m_description.domain().predicates();
|
||||||
|
|
||||||
@ -166,30 +163,20 @@ void TranslatorASP::translatePredicates() const
|
|||||||
|
|
||||||
this->translateVariablesBody(predicate->arguments());
|
this->translateVariablesBody(predicate->arguments());
|
||||||
|
|
||||||
m_outputStream << "." << std::endl;
|
m_outputStream << ".";
|
||||||
|
});
|
||||||
|
|
||||||
m_outputStream
|
m_outputStream
|
||||||
|
<< std::endl << std::endl
|
||||||
|
<< utils::RuleName("boolean") << "(" << utils::Boolean("true") << ")." << std::endl
|
||||||
|
<< utils::RuleName("boolean") << "(" << utils::Boolean("false") << ")." << std::endl
|
||||||
|
<< std::endl
|
||||||
<< utils::RuleName("contains") << "("
|
<< utils::RuleName("contains") << "("
|
||||||
<< utils::Keyword("variable") << "(";
|
<< utils::Keyword("variable") << "(" << utils::Variable("X") << "), "
|
||||||
|
<< utils::Keyword("value") << "(" << utils::Variable("X") << ", " << utils::Variable("B") << ")) :- "
|
||||||
printPredicateName(predicate);
|
<< utils::RuleName("variable") << "(" << utils::Keyword("variable") << "(" << utils::Variable("X") << ")), "
|
||||||
|
<< utils::RuleName("boolean") << "(" << utils::Variable("B") << ")."
|
||||||
m_outputStream << "), " << utils::Keyword("value") << "(";
|
<< std::endl;
|
||||||
|
|
||||||
printPredicateName(predicate);
|
|
||||||
|
|
||||||
m_outputStream << ", " << utils::Variable("B") << "))";
|
|
||||||
|
|
||||||
this->translateVariablesBody(predicate->arguments());
|
|
||||||
|
|
||||||
// TODO: clean up
|
|
||||||
if (predicate->arguments().empty())
|
|
||||||
m_outputStream << " :- ";
|
|
||||||
else
|
|
||||||
m_outputStream << ", ";
|
|
||||||
|
|
||||||
m_outputStream << utils::RuleName("boolean") << "(" << utils::Variable("B") << ")." << std::endl;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user