Support modulus operation (absolute value)
This adds support for computing the absolute value of a term along with an according unit test.
This commit is contained in:
@@ -184,4 +184,12 @@ TEST_CASE("[completion] Rules are completed", "[completion]")
|
||||
|
||||
CHECK(output.str() == "forall V1, V2 not color(V1, V2)\nforall U1, U2, U3 (not color(U1, U2) or not color(U1, U3) or U2 = U3)\n");
|
||||
}
|
||||
|
||||
SECTION("absolute value operation")
|
||||
{
|
||||
input << "adj(X, Y) :- X = 1..n, Y = 1..n, |X - Y| = 1.";
|
||||
anthem::translate("input", input, context);
|
||||
|
||||
CHECK(output.str() == "forall V1, V2 (adj(V1, V2) <-> (V1 in 1..n and V2 in 1..n and |(V1 - V2)| = 1))\n");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user