Handling negated head literals.

This commit is contained in:
Patrick Lühne 2016-11-23 03:47:32 +01:00
parent fbe351a85b
commit bdc560869a
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 5 additions and 0 deletions

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);
}