Fixed issue with empty integrity constraints and extended unit test.
This commit is contained in:
parent
25a55a6457
commit
6167a83a99
|
@ -62,7 +62,7 @@ struct StatementVisitor
|
||||||
{
|
{
|
||||||
const auto &bodyLiteral = *i;
|
const auto &bodyLiteral = *i;
|
||||||
|
|
||||||
if (!context.headTerms.empty())
|
if (!context.headTerms.empty() || i != rule.body.cbegin())
|
||||||
outputStream << " " << Clingo::AST::BinaryOperator::And << " ";
|
outputStream << " " << Clingo::AST::BinaryOperator::And << " ";
|
||||||
|
|
||||||
if (bodyLiteral.sign != Clingo::AST::Sign::None)
|
if (bodyLiteral.sign != Clingo::AST::Sign::None)
|
||||||
|
|
|
@ -92,10 +92,10 @@ TEST_CASE("[translation] Rules are translated correctly", "[translation]")
|
||||||
|
|
||||||
SECTION("integrity constraint")
|
SECTION("integrity constraint")
|
||||||
{
|
{
|
||||||
input << ":- p(42).";
|
input << ":- p(42), q.";
|
||||||
anthem::translate("input", input, context);
|
anthem::translate("input", input, context);
|
||||||
|
|
||||||
REQUIRE(output.str() == "exists X1 (X1 in 42 and p(X1)) -> #false\n");
|
REQUIRE(output.str() == "exists X1 (X1 in 42 and p(X1)) and q -> #false\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("inf/sup")
|
SECTION("inf/sup")
|
||||||
|
|
Loading…
Reference in New Issue