Fixed undetected issue with unsupported negations.

This commit is contained in:
Patrick Lühne 2016-08-16 18:43:37 +02:00
parent cdb06fa5bf
commit 69a26cb22f

View File

@ -411,6 +411,10 @@ void TranslatorASP::translateLiteral(const Expression &literal) const
else if (literal.expressionType() == Expression::Type::Not) else if (literal.expressionType() == Expression::Type::Not)
{ {
const auto &notExpression = dynamic_cast<const expressions::Not &>(literal); const auto &notExpression = dynamic_cast<const expressions::Not &>(literal);
if (notExpression.expressionType() != Expression::Type::Predicate)
throw utils::TranslatorException("only negations of primitive predicates supported as literals currently");
const auto &predicate = dynamic_cast<const expressions::Predicate &>(*notExpression.argument()); const auto &predicate = dynamic_cast<const expressions::Predicate &>(*notExpression.argument());
m_outputStream << utils::Keyword("variable") << "("; m_outputStream << utils::Keyword("variable") << "(";