Added debug printing function to facilitate testing expression normalization.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include <plasp/pddl/expressions/And.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
namespace plasp
|
||||
{
|
||||
namespace pddl
|
||||
|
@@ -45,6 +45,17 @@ ExpressionPointer At::normalized()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void At::print(std::ostream &ostream) const
|
||||
{
|
||||
ostream << "(at " << m_timePoint << " ";
|
||||
|
||||
m_argument->print(ostream);
|
||||
|
||||
ostream << ")";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -239,6 +239,13 @@ PrimitiveTypePointer Constant::type() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Constant::print(std::ostream &ostream) const
|
||||
{
|
||||
ostream << "(" << m_name << ")";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,18 +15,16 @@ namespace expressions
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool Dummy::isNormalized() const
|
||||
Dummy::Dummy(std::string name)
|
||||
: m_name{name}
|
||||
{
|
||||
return m_isNormalized;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ExpressionPointer Dummy::normalized()
|
||||
void Dummy::print(std::ostream &ostream) const
|
||||
{
|
||||
m_isNormalized = true;
|
||||
|
||||
return this;
|
||||
ostream << "(" << m_name << ")";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -84,6 +84,17 @@ ExpressionPointer Not::normalized()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Not::print(std::ostream &ostream) const
|
||||
{
|
||||
ostream << "(not ";
|
||||
|
||||
m_argument->print(ostream);
|
||||
|
||||
ostream << ")";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -170,6 +170,14 @@ const Expressions &Predicate::arguments() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Predicate::print(std::ostream &ostream) const
|
||||
{
|
||||
// TODO: implement correctly
|
||||
ostream << "(<predicate>)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,6 +87,14 @@ void PredicateDeclaration::normalizeParameterNames()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void PredicateDeclaration::print(std::ostream &ostream) const
|
||||
{
|
||||
// TODO: implement correctly
|
||||
ostream << "(<predicate declaration>)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -169,6 +169,14 @@ const PrimitiveTypes &PrimitiveType::parentTypes() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void PrimitiveType::print(std::ostream &ostream) const
|
||||
{
|
||||
// TODO: implement correctly
|
||||
ostream << "(<primitive type" << m_name << ">)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,6 +41,14 @@ const std::string &Unsupported::type() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Unsupported::print(std::ostream &ostream) const
|
||||
{
|
||||
// TODO: implement correctly
|
||||
ostream << "(<unsupported expression “" << m_type << "”>)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -203,6 +203,14 @@ bool Variable::isDirty() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Variable::print(std::ostream &ostream) const
|
||||
{
|
||||
// TODO: implement correctly
|
||||
ostream << "(<variable " << m_name << ">)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user