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
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

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 V1 (a(V1) <-> not d(V1))\n"
"forall V2 (d(V2) <-> not not d(V2))\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");
}
} }