Improved output of negated literals and added unit test.
This commit is contained in:
@@ -87,12 +87,10 @@ struct TermPrintVisitor
|
||||
<< argument;
|
||||
}
|
||||
|
||||
outputStream << " " << Clingo::AST::BinaryOperator::And << " ";
|
||||
|
||||
if (literal.sign == Clingo::AST::Sign::Negation)
|
||||
outputStream << Clingo::AST::Sign::Negation << " ";
|
||||
|
||||
outputStream << output::Function(function.name) << "(";
|
||||
outputStream
|
||||
<< " " << Clingo::AST::BinaryOperator::And << " "
|
||||
<< literal.sign
|
||||
<< output::Function(function.name) << "(";
|
||||
|
||||
for (auto i = function.arguments.cbegin(); i != function.arguments.cend(); i++)
|
||||
{
|
||||
|
@@ -222,8 +222,8 @@ struct HeadLiteralPrintSubstitutedVisitor
|
||||
{
|
||||
if (literal.sign == Clingo::AST::Sign::DoubleNegation)
|
||||
throwErrorAtLocation(literal.location, "double-negated literals currently unsupported", context);
|
||||
else if (literal.sign == Clingo::AST::Sign::Negation)
|
||||
context.logger.outputStream() << Clingo::AST::Sign::Negation << " ";
|
||||
|
||||
context.logger.outputStream() << literal.sign;
|
||||
|
||||
literal.data.accept(LiteralPrintSubstitutedVisitor(), literal, context);
|
||||
}
|
||||
|
Reference in New Issue
Block a user