From 7665cb7bf1e9c510f3585f196d1c94878efa0d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Mon, 12 Jun 2017 15:32:05 +0200 Subject: [PATCH] Added unit test for the completion of predicates with nested arguments. --- tests/TestCompletion.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/TestCompletion.cpp b/tests/TestCompletion.cpp index 28480c1..764faa1 100644 --- a/tests/TestCompletion.cpp +++ b/tests/TestCompletion.cpp @@ -115,6 +115,17 @@ TEST_CASE("[completion] Rules are completed", "[completion]") "t\n"); } + SECTION("nested arguments") + { + input << + "f(f(f(f(f(X))))) :- f(X).\n" + "f(1..5)."; + anthem::translate("input", input, context); + + CHECK(output.str() == + "forall V1 (f(V1) <-> (exists U1 (V1 = f(f(f(f(U1)))) and f(U1)) or V1 in 1..5))\n"); + } + SECTION("useless implications") { input <<