From bdc560869a231cd79e7943898b0c85ec1fc5a74b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Wed, 23 Nov 2016 03:47:32 +0100 Subject: [PATCH] Handling negated head literals. --- include/anthem/Head.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/anthem/Head.h b/include/anthem/Head.h index ed27079..958c22d 100644 --- a/include/anthem/Head.h +++ b/include/anthem/Head.h @@ -215,6 +215,11 @@ struct HeadLiteralPrintSubstitutedVisitor { void visit(const Clingo::AST::Literal &literal, const Clingo::AST::HeadLiteral &, const std::vector &terms) { + if (literal.sign == Clingo::AST::Sign::DoubleNegation) + throwErrorAtLocation(literal.location, "double-negated literals currently unsupported"); + else if (literal.sign == Clingo::AST::Sign::Negation) + std::cout << "not "; + literal.data.accept(LiteralPrintSubstitutedVisitor(), literal, terms); }