patrick
/
plasp
Archived
1
0
Fork 0

Made all error and warning messages lowercase consistently.

This commit is contained in:
Patrick Lühne 2016-06-14 16:53:48 +02:00
parent 2984da773d
commit 6fec1cc409
20 changed files with 61 additions and 61 deletions

View File

@ -19,7 +19,7 @@ class ConsistencyException: public std::exception
{
public:
explicit ConsistencyException()
: ConsistencyException("Unspecified consistency error")
: ConsistencyException("unspecified consistency error")
{
}
@ -40,7 +40,7 @@ class ConsistencyException: public std::exception
const char *what() const throw()
{
if (m_message.empty())
return "Unspecified consistency error";
return "unspecified consistency error";
return m_message.c_str();
}

View File

@ -21,7 +21,7 @@ class ParserException: public std::exception
{
public:
explicit ParserException(const utils::Parser &parser)
: ParserException(parser, "Unspecified parser error")
: ParserException(parser, "unspecified parser error")
{
}

View File

@ -133,7 +133,7 @@ void Description::parse()
findSections();
if (m_domainPosition == -1)
throw ConsistencyException("No PDDL domain specified");
throw ConsistencyException("no PDDL domain specified");
parser.seek(m_domainPosition);
m_domain->parse();
@ -188,7 +188,7 @@ void Description::findSections()
else
{
const auto sectionIdentifier = parser.parse<std::string>();
throw utils::ParserException(parser, "Unknown PDDL section “" + sectionIdentifier + "");
throw utils::ParserException(parser, "unknown PDDL section “" + sectionIdentifier + "");
}
m_context.parser.skipWhiteSpace();

View File

@ -53,7 +53,7 @@ void Domain::findSections()
if (unique && sectionPosition != -1)
{
parser.seek(value);
throw utils::ParserException(parser, "Only one “:" + sectionName + "” section allowed");
throw utils::ParserException(parser, "only one “:" + sectionName + "” section allowed");
}
sectionPosition = value;
@ -94,7 +94,7 @@ void Domain::findSections()
const auto sectionIdentifier = parser.parseIdentifier(isIdentifier);
m_context.logger.logWarning(parser, "Section type “" + sectionIdentifier + "” currently unsupported");
m_context.logger.logWarning(parser, "section type “" + sectionIdentifier + "” currently unsupported");
parser.seek(sectionIdentifierPosition);
}
@ -103,7 +103,7 @@ void Domain::findSections()
const auto sectionIdentifier = parser.parseIdentifier(isIdentifier);
parser.seek(position);
throw utils::ParserException(m_context.parser, "Unknown domain section “" + sectionIdentifier + "");
throw utils::ParserException(m_context.parser, "unknown domain section “" + sectionIdentifier + "");
}
// Skip section for now and parse it later
@ -279,7 +279,7 @@ void Domain::checkRequirement(Requirement::Type requirementType) const
if (hasRequirement(requirementType))
return;
throw ConsistencyException("Requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -340,7 +340,7 @@ void Domain::parseTypeSection()
while (parser.currentCharacter() != ')')
{
if (parser.currentCharacter() == '(')
throw utils::ParserException(parser, "Only primitive types are allowed in type section");
throw utils::ParserException(parser, "only primitive types are allowed in type section");
expressions::PrimitiveType::parseTypedDeclaration(m_context, *this);

View File

@ -114,7 +114,7 @@ ExpressionPointer parseExpression(Context &context, ExpressionContext &expressio
const auto expressionIdentifier = parser.parseIdentifier(isIdentifier);
parser.seek(position);
throw utils::ParserException(context.parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
throw utils::ParserException(context.parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -186,7 +186,7 @@ ExpressionPointer parseEffectBodyExpression(Context &context, ExpressionContext
const auto expressionIdentifier = parser.parseIdentifier(isIdentifier);
parser.seek(position);
throw utils::ParserException(context.parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
throw utils::ParserException(context.parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -198,7 +198,7 @@ ExpressionPointer parsePredicate(Context &context, ExpressionContext &expression
if ((expression = expressions::Predicate::parse(context, expressionContext)))
return expression;
throw utils::ParserException(context.parser, "Expected predicate");
throw utils::ParserException(context.parser, "expected predicate");
}
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -59,7 +59,7 @@ std::unique_ptr<InitialState> InitialState::parseDeclaration(Context &context,
const auto expressionIdentifier = parser.parseIdentifier(isIdentifier);
parser.seek(position);
throw utils::ParserException(parser, "Expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
throw utils::ParserException(parser, "expression type “" + expressionIdentifier + "” unknown or not allowed in this context");
};
parser.skipWhiteSpace();

View File

@ -53,7 +53,7 @@ void Problem::findSections()
if (unique && sectionPosition != -1)
{
parser.seek(value);
throw utils::ParserException(parser, "Only one “:" + sectionName + "” section allowed");
throw utils::ParserException(parser, "only one “:" + sectionName + "” section allowed");
}
sectionPosition = value;
@ -89,7 +89,7 @@ void Problem::findSections()
const auto sectionIdentifier = parser.parseIdentifier(isIdentifier);
m_context.logger.logWarning(parser, "Section type “" + sectionIdentifier + "” currently unsupported");
m_context.logger.logWarning(parser, "section type “" + sectionIdentifier + "” currently unsupported");
parser.seek(sectionIdentifierPosition);
}
@ -98,7 +98,7 @@ void Problem::findSections()
const auto sectionIdentifier = parser.parseIdentifier(isIdentifier);
parser.seek(position);
throw utils::ParserException(m_context.parser, "Unknown problem section “" + sectionIdentifier + "");
throw utils::ParserException(m_context.parser, "unknown problem section “" + sectionIdentifier + "");
}
// Skip section for now and parse it later
@ -117,7 +117,7 @@ void Problem::parse()
auto &parser = m_context.parser;
if (m_domainPosition == -1)
throw ConsistencyException("Problem description does not specify the corresponding domain");
throw ConsistencyException("problem description does not specify the corresponding domain");
parser.seek(m_domainPosition);
parseDomainSection();
@ -135,13 +135,13 @@ void Problem::parse()
}
if (m_initialStatePosition == -1)
throw ConsistencyException("Problem description does not specify an initial state");
throw ConsistencyException("problem description does not specify an initial state");
parser.seek(m_initialStatePosition);
parseInitialStateSection();
if (m_goalPosition == -1)
throw ConsistencyException("Problem description does not specify a goal");
throw ConsistencyException("problem description does not specify a goal");
parser.seek(m_goalPosition);
parseGoalSection();
@ -204,7 +204,7 @@ void Problem::parseDomainSection()
const auto domainName = parser.parseIdentifier(isIdentifier);
if (m_domain.name() != domainName)
throw utils::ParserException(parser, "Domains do not match (“" + m_domain.name() + "” and “" + domainName + "”)");
throw utils::ParserException(parser, "domains do not match (“" + m_domain.name() + "” and “" + domainName + "”)");
parser.expect<std::string>(")");
}
@ -261,7 +261,7 @@ void Problem::checkRequirement(Requirement::Type requirementType) const
if (hasRequirement(requirementType))
return;
throw ConsistencyException("Requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
}
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -89,12 +89,12 @@ Requirement Requirement::parse(Context &context)
const auto match = requirementTypesToPDDL.right.find(requirementName);
if (match == requirementTypesToPDDL.right.end())
throw utils::ParserException(context.parser, "Unknown PDDL requirement “" + requirementName + "");
throw utils::ParserException(context.parser, "unknown PDDL requirement “" + requirementName + "");
const auto requirementType = match->second;
if (requirementType == Requirement::Type::GoalUtilities)
context.logger.logWarning(context.parser, "Requirement “goal-utilities” is not part of the PDDL 3.1 specification");
context.logger.logWarning(context.parser, "requirement “goal-utilities” is not part of the PDDL 3.1 specification");
return Requirement(match->second);
}

View File

@ -221,7 +221,7 @@ void TranslatorASP::translateActions() const
else
{
if (precondition.expressionType() != Expression::Type::And)
throw utils::TranslatorException("Only “and” expressions and (negated) predicates supported as action preconditions currently");
throw utils::TranslatorException("only “and” expressions and (negated) predicates supported as action preconditions currently");
const auto &andExpression = dynamic_cast<const expressions::And &>(precondition);
@ -247,7 +247,7 @@ void TranslatorASP::translateActions() const
else
{
if (effect.expressionType() != Expression::Type::And)
throw utils::TranslatorException("Only “and” expressions and (negated) predicates supported as action effects currently");
throw utils::TranslatorException("only “and” expressions and (negated) predicates supported as action effects currently");
const auto &andExpression = dynamic_cast<const expressions::And &>(effect);
@ -342,7 +342,7 @@ void TranslatorASP::translateVariablesBody(const expressions::Variables &variabl
if (variable.type() != nullptr)
{
if (variable.type()->expressionType() != Expression::Type::PrimitiveType)
throw utils::TranslatorException("Only primitive types supported currently");
throw utils::TranslatorException("only primitive types supported currently");
const auto &type = *dynamic_cast<const expressions::PrimitiveType *>(variable.type());
@ -387,7 +387,7 @@ void TranslatorASP::translateLiteral(const Expression &literal) const
printKeyword("false");
}
else
throw utils::TranslatorException("Only primitive predicates and their negations supported as literals currently");
throw utils::TranslatorException("only primitive predicates and their negations supported as literals currently");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -426,7 +426,7 @@ void TranslatorASP::translatePredicate(const expressions::Predicate &predicate)
printVariable(utils::escapeASPVariable(variable.name()));
}
else
throw utils::TranslatorException("Only variables and constants supported in predicates currently");
throw utils::TranslatorException("only variables and constants supported in predicates currently");
}
m_outputStream << "))";
@ -484,10 +484,10 @@ void TranslatorASP::translateInitialState() const
const auto &notExpression = dynamic_cast<const expressions::Not &>(*fact);
if (notExpression.argument()->expressionType() != Expression::Type::Predicate)
throw utils::TranslatorException("Only negations of simple predicates supported in initial state currently");
throw utils::TranslatorException("only negations of simple predicates supported in initial state currently");
}
else
throw utils::TranslatorException("Only predicates and their negations supported in initial state currently");
throw utils::TranslatorException("only predicates and their negations supported in initial state currently");
m_outputStream << ").";
});
@ -533,7 +533,7 @@ void TranslatorASP::translateGoal() const
});
}
else
throw utils::TranslatorException("Only single predicates, their negations, and conjunctions are currently supported in the goal");
throw utils::TranslatorException("only single predicates, their negations, and conjunctions are currently supported in the goal");
m_outputStream << std::endl;
}

View File

@ -113,7 +113,7 @@ void Constant::parseTypedDeclarations(Context &context, Domain &domain)
domain.checkRequirement(Requirement::Type::Typing);
// If no types are given, check that typing is not a requirement
else if (domain.hasRequirement(Requirement::Type::Typing))
throw utils::ParserException(parser, "Constant has undeclared type");
throw utils::ParserException(parser, "constant has undeclared type");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -140,7 +140,7 @@ void Constant::parseTypedDeclarations(Context &context, Problem &problem)
problem.checkRequirement(Requirement::Type::Typing);
// If no types are given, check that typing is not a requirement
else if (problem.hasRequirement(Requirement::Type::Typing))
throw utils::ParserException(context.parser, "Constant has undeclared type");
throw utils::ParserException(context.parser, "constant has undeclared type");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -156,7 +156,7 @@ Constant *Constant::parseAndFind(Context &context, const Domain &domain)
if (constant != nullptr)
return constant;
throw utils::ParserException(context.parser, "Constant “" + constantName + "” used but never declared");
throw utils::ParserException(context.parser, "constant “" + constantName + "” used but never declared");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -177,7 +177,7 @@ Constant *Constant::parseAndFind(Context &context, const Problem &problem)
if (constant)
return constant;
throw utils::ParserException(context.parser, "Constant “" + constantName + "” used but never declared");
throw utils::ParserException(context.parser, "constant “" + constantName + "” used but never declared");
}
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -127,7 +127,7 @@ PredicatePointer Predicate::parse(Context &context, const Problem &problem)
while (context.parser.currentCharacter() != ')')
{
if (context.parser.currentCharacter() == '?')
throw utils::ParserException(context.parser, "Variables not allowed in this context");
throw utils::ParserException(context.parser, "variables not allowed in this context");
// Parse objects and constants
const auto *constant = Constant::parseAndFind(context, problem);

View File

@ -109,7 +109,7 @@ PrimitiveType *PrimitiveType::parseAndFind(Context &context, Domain &domain)
const auto typeName = context.parser.parseIdentifier(isIdentifier);
if (typeName.empty())
throw utils::ParserException(context.parser, "No type supplied");
throw utils::ParserException(context.parser, "no type supplied");
const auto match = std::find_if(types.cbegin(), types.cend(),
[&](const auto &primitiveType)
@ -122,11 +122,11 @@ PrimitiveType *PrimitiveType::parseAndFind(Context &context, Domain &domain)
// Only "object" is allowed as an implicit type
if (typeName == "object" || typeName == "objects")
{
context.logger.logWarning(context.parser, "Primitive type “" + typeName + "” should be declared");
context.logger.logWarning(context.parser, "primitive type “" + typeName + "” should be declared");
types.emplace_back(std::make_unique<expressions::PrimitiveType>(typeName));
}
else
throw utils::ParserException(context.parser, "Type “" + typeName + "” used but never declared");
throw utils::ParserException(context.parser, "type “" + typeName + "” used but never declared");
return types.back().get();
}

View File

@ -26,7 +26,7 @@ UnsupportedPointer Unsupported::parse(Context &context)
expression->m_type = parser.parseIdentifier(isIdentifier);
context.logger.logWarning(context.parser, "Expression type “" + expression->m_type + "” currently unsupported in this context");
context.logger.logWarning(context.parser, "expression type “" + expression->m_type + "” currently unsupported in this context");
skipSection(parser);

View File

@ -52,7 +52,7 @@ void Variable::parseDeclaration(Context &context, Variables &parameters)
});
if (match != parameters.cend())
throw utils::ParserException(context.parser, "Variable “" + variable->m_name + "” already declared in this scope");
throw utils::ParserException(context.parser, "variable “" + variable->m_name + "” already declared in this scope");
// Flag variable for potentially upcoming type declaration
variable->setDirty();
@ -132,7 +132,7 @@ void Variable::parseTypedDeclarations(Context &context, ExpressionContext &expre
expressionContext.checkRequirement(Requirement::Type::Typing);
// If no types are given, check that typing is not a requirement
else if (expressionContext.hasRequirement(Requirement::Type::Typing))
throw utils::ParserException(parser, "Variable has undeclared type");
throw utils::ParserException(parser, "variable has undeclared type");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -154,7 +154,7 @@ const Variable *Variable::parseAndFind(Context &context, const ExpressionContext
});
if (match == variables.cend())
throw utils::ParserException(context.parser, "Parameter “" + variableName + "” used but never declared");
throw utils::ParserException(context.parser, "parameter “" + variableName + "” used but never declared");
return match->get();
}

View File

@ -169,7 +169,7 @@ void Description::parseContent(utils::Parser &parser)
parser.skipWhiteSpace();
if (!parser.atEndOfStream())
throw utils::ParserException(parser, "Expected end of SAS description (perhaps, input contains two SAS descriptions?)");
throw utils::ParserException(parser, "expected end of SAS description (perhaps, input contains two SAS descriptions?)");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -181,7 +181,7 @@ void Description::parseVersionSection(utils::Parser &parser) const
const auto formatVersion = parser.parse<size_t>();
if (formatVersion != 3)
throw utils::ParserException(parser, "Unsupported SAS format version (" + std::to_string(formatVersion) + ")");
throw utils::ParserException(parser, "unsupported SAS format version (" + std::to_string(formatVersion) + ")");
parser.expect<std::string>("end_version");
}

View File

@ -29,7 +29,7 @@ MutexGroup MutexGroup::fromSAS(utils::Parser &parser, const Variables &variables
mutexGroup.m_facts.emplace_back(Fact::fromSAS(parser, variables));
if (mutexGroup.m_facts[j].value() == Value::None)
throw utils::ParserException(parser, "Mutex groups must not contain <none of those> values");
throw utils::ParserException(parser, "mutex groups must not contain <none of those> values");
}
parser.expect<std::string>("end_mutex_group");

View File

@ -46,7 +46,7 @@ Predicate Predicate::fromSAS(utils::Parser &parser)
}
catch (const std::exception &e)
{
throw utils::ParserException(parser, "Could not parse operator predicate");
throw utils::ParserException(parser, "could not parse operator predicate");
}
return predicate;

View File

@ -74,7 +74,7 @@ Value Value::fromSAS(utils::Parser &parser)
else if (sasSign == "NegatedAtom")
value.m_sign = Value::Sign::Negative;
else
throw utils::ParserException(parser, "Invalid value sign “" + sasSign + "");
throw utils::ParserException(parser, "invalid value sign “" + sasSign + "");
try
{
@ -90,7 +90,7 @@ Value Value::fromSAS(utils::Parser &parser)
}
catch (const std::exception &e)
{
throw utils::ParserException(parser, std::string("Could not parse variable value (") + e.what() + ")");
throw utils::ParserException(parser, std::string("could not parse variable value (") + e.what() + ")");
}
return value;
@ -106,7 +106,7 @@ const Value &Value::referenceFromSAS(utils::Parser &parser, const Variable &vari
return Value::Any;
if (valueID < 0 || static_cast<size_t>(valueID) >= variable.values().size())
throw utils::ParserException(parser, "Value index out of range (variable " + variable.name() + ", index " + std::to_string(valueID) + ")");
throw utils::ParserException(parser, "value index out of range (variable " + variable.name() + ", index " + std::to_string(valueID) + ")");
return variable.values()[valueID];
}

View File

@ -63,7 +63,7 @@ const Variable &Variable::referenceFromSAS(utils::Parser &parser, const Variable
const auto variableID = parser.parse<size_t>();
if (variableID >= variables.size())
throw utils::ParserException(parser, "Variable index out of range (index " + std::to_string(variableID) + ")");
throw utils::ParserException(parser, "variable index out of range (index " + std::to_string(variableID) + ")");
return variables[variableID];
}

View File

@ -186,7 +186,7 @@ bool Parser::atEndOfStream() const
void Parser::checkStream() const
{
if (atEndOfStream())
throw ParserException(*this, "Reading past end of file");
throw ParserException(*this, "reading past end of file");
if (m_stream.fail())
throw ParserException(*this);
@ -310,7 +310,7 @@ template<>
void Parser::expect<std::string>(const std::string &expectedValue)
{
if (!probe<std::string>(expectedValue))
throw ParserException(*this, "Expected “" + expectedValue + "");
throw ParserException(*this, "expected “" + expectedValue + "");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -344,7 +344,7 @@ template<>
void Parser::expect<char>(const char &expectedValue)
{
if (!probe<char>(expectedValue))
throw ParserException(*this, std::string("Expected “") + expectedValue + "");
throw ParserException(*this, std::string("expected “") + expectedValue + "");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -354,7 +354,7 @@ uint64_t Parser::parseIntegerBody()
checkStream();
if (!std::isdigit(currentCharacter()))
throw ParserException(*this, "Could not parse integer value");
throw ParserException(*this, "could not parse integer value");
uint64_t value = 0;
@ -396,7 +396,7 @@ uint64_t Parser::parse<uint64_t>()
skipWhiteSpace();
if (currentCharacter() == '-')
throw ParserException(*this, "Expected unsigned integer, got signed one");
throw ParserException(*this, "expected unsigned integer, got signed one");
return parseIntegerBody();
}
@ -439,7 +439,7 @@ template<>
void Parser::expect<int64_t>(const int64_t &expectedValue)
{
if (!probe<int64_t>(expectedValue))
throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "");
throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -448,7 +448,7 @@ template<>
void Parser::expect<uint64_t>(const uint64_t &expectedValue)
{
if (!probe<uint64_t>(expectedValue))
throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "");
throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -512,7 +512,7 @@ bool Parser::parse<bool>()
if (probe('1'))
return true;
throw ParserException(*this, "Could not parse Boolean value");
throw ParserException(*this, "could not parse Boolean value");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -523,7 +523,7 @@ void Parser::expect<bool>(const bool &expectedValue)
const auto value = parse<bool>();
if (value != expectedValue)
throw ParserException(*this, "Expected “" + std::to_string(expectedValue) + "");
throw ParserException(*this, "expected “" + std::to_string(expectedValue) + "");
}
////////////////////////////////////////////////////////////////////////////////////////////////////