Handling negated head literals.

This commit is contained in:
Patrick Lühne 2016-11-23 03:47:32 +01:00
parent fbe351a85b
commit bdc560869a
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -215,6 +215,11 @@ struct HeadLiteralPrintSubstitutedVisitor
{
void visit(const Clingo::AST::Literal &literal, const Clingo::AST::HeadLiteral &, const std::vector<const Clingo::AST::Term *> &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);
}