Added rule to PDDL translator output to make all unspecified initial state variables false by default.

This commit is contained in:
Patrick Lühne 2016-08-17 19:02:51 +02:00
parent 91019f52aa
commit 7bd483cd7e
2 changed files with 11 additions and 4 deletions

View File

@ -10,9 +10,6 @@
% Establish initial state % Establish initial state
holds(Variable, Value, 0) :- initialState(Variable, Value). holds(Variable, Value, 0) :- initialState(Variable, Value).
% Make unspecified initial state variables false by default (for PDDL)
holds(variable(Variable), value(Variable, false), 0) :- variable(variable(Variable)), {initialState(variable(Variable), _)} 0.
#program step(t). #program step(t).
% Perform actions % Perform actions

View File

@ -531,7 +531,17 @@ void TranslatorASP::translateInitialState() const
m_outputStream << ")."; m_outputStream << ").";
}); });
m_outputStream << std::endl; m_outputStream
<< std::endl << std::endl
<< utils::RuleName("initialState") << "("
<< utils::Keyword("variable") << "(" << utils::Variable("X") << "), "
<< utils::Keyword("value") << "(" << utils::Variable("X") << ", " << utils::Boolean("false") << ")) :- "
<< utils::RuleName("variable") << "(" << utils::Keyword("variable") << "(" << utils::Variable("X") << ")), "
<< utils::Keyword("not") << " "
<< utils::RuleName("initialState") << "("
<< utils::Keyword("variable") << "(" << utils::Variable("X") << "), "
<< utils::Keyword("value") << "(" << utils::Variable("X") << ", " << utils::Boolean("true") << "))."
<< std::endl;
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////