Fixed misleading error message concerning negated, unsupported body literals.

This commit is contained in:
Patrick Lühne 2017-03-29 23:09:40 +02:00
parent ef715de6c4
commit d0cbdb13e5
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
3 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ Features:
Bug Fixes:
* fixes incorrectly simplified rules with comparisons
* fixes misleading error message concerning negated, unsupported body literals
## 0.1.2 (2017-03-23)

View File

@ -144,8 +144,11 @@ struct BodyLiteralTranslateVisitor
struct BodyBodyLiteralTranslateVisitor
{
std::experimental::optional<ast::Formula> visit(const Clingo::AST::Literal &literal, const Clingo::AST::BodyLiteral &, Context &context)
std::experimental::optional<ast::Formula> visit(const Clingo::AST::Literal &literal, const Clingo::AST::BodyLiteral &bodyLiteral, Context &context)
{
if (bodyLiteral.sign != Clingo::AST::Sign::None)
throwErrorAtLocation(bodyLiteral.location, "only positive body literals supported currently", context);
return literal.data.accept(BodyLiteralTranslateVisitor(), literal, context);
}

View File

@ -65,9 +65,6 @@ struct StatementVisitor
{
const auto &bodyLiteral = *i;
if (bodyLiteral.sign != Clingo::AST::Sign::None)
throwErrorAtLocation(bodyLiteral.location, "only positive literals currently supported", context);
auto argument = bodyLiteral.data.accept(BodyBodyLiteralTranslateVisitor(), bodyLiteral, context);
if (!argument)