Fixed issue with simplifying binary operations in arguments.
This commit is contained in:
parent
9d1a1249d3
commit
cbe87d8cb7
@ -112,7 +112,7 @@ struct RecursiveTermVisitor
|
|||||||
ReturnType visit(BinaryOperation &binaryOperation, Term &term, Arguments &&... arguments)
|
ReturnType visit(BinaryOperation &binaryOperation, Term &term, Arguments &&... arguments)
|
||||||
{
|
{
|
||||||
binaryOperation.left.accept(*this, binaryOperation.left, std::forward<Arguments>(arguments)...);
|
binaryOperation.left.accept(*this, binaryOperation.left, std::forward<Arguments>(arguments)...);
|
||||||
binaryOperation.right.accept(*this, binaryOperation.left, std::forward<Arguments>(arguments)...);
|
binaryOperation.right.accept(*this, binaryOperation.right, std::forward<Arguments>(arguments)...);
|
||||||
|
|
||||||
return T::accept(binaryOperation, term, std::forward<Arguments>(arguments)...);
|
return T::accept(binaryOperation, term, std::forward<Arguments>(arguments)...);
|
||||||
}
|
}
|
||||||
|
@ -145,4 +145,14 @@ TEST_CASE("[completion] Rules are completed", "[completion]")
|
|||||||
"forall U2 not (U2 in 1..n and not covered(U2))\n"
|
"forall U2 not (U2 in 1..n and not covered(U2))\n"
|
||||||
"forall U3, U4, U5 not (in(U3, U4) and in(U5, U4) and exists X1 (X1 in (U3 + U5) and in(X1, U4)))\n");
|
"forall U3, U4, U5 not (in(U3, U4) and in(U5, U4) and exists X1 (X1 in (U3 + U5) and in(X1, U4)))\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("binary operations with multiple variables")
|
||||||
|
{
|
||||||
|
input << "a(X, Y) :- b(c(X + Y), d(1 + Y)).";
|
||||||
|
anthem::translate("input", input, context);
|
||||||
|
|
||||||
|
CHECK(output.str() ==
|
||||||
|
"forall V1, V2 (a(V1, V2) <-> b(c((V1 + V2)), d((1 + V2))))\n"
|
||||||
|
"forall V3, V4 not b(V3, V4)\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user