Added unit test for recognizing Booleans when hiding statements.

This commit is contained in:
Patrick Lühne 2017-06-05 03:39:10 +02:00
parent 7904b41e60
commit b91e55dfc4
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 15 additions and 0 deletions

View File

@ -106,4 +106,19 @@ TEST_CASE("[hidden predicate elimination] Hidden predicates are correctly elimin
"forall V1 (a(V1) <-> not d(V1))\n"
"forall V2 (d(V2) <-> not not d(V2))\n");
}
SECTION("simple Booleans are recognized")
{
input <<
"a(X) :- c(X).\n"
"b(X) :- d(X).\n"
"c(X).\n"
"#show a/1.\n"
"#show b/1.";
anthem::translate("input", input, context);
CHECK(output.str() ==
"forall V1 (a(V1) <-> #true)\n"
"forall V2 (b(V2) <-> #false)\n");
}
}