patrick
/
plasp
Archived
1
0
Fork 0

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
1 changed files with 4 additions and 0 deletions

View File

@ -411,6 +411,10 @@ void TranslatorASP::translateLiteral(const Expression &literal) const
else if (literal.expressionType() == Expression::Type::Not)
{
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());
m_outputStream << utils::Keyword("variable") << "(";