35 if (condition ==
nullptr) {
38 return mk<Conjunction>(std::move(condition), std::move(c));
53 newCondition = addCondition(std::move(newCondition),
souffle::clone(&condition));
61 auto* mQuery =
const_cast<Query*
>(&query);
63 if (newCondition !=
nullptr) {
66 auto* nestedOp =
const_cast<Operation*
>(&mQuery->getOperation());
67 mQuery->rewrite(nestedOp, mk<Filter>(std::move(newCondition),
souffle::clone(nestedOp)));
73 Own<Condition> newCondition;
74 std::function<Own<Node>(Own<Node>)> filterRewriter = [&](Own<Node> node) -> Own<Node> {
75 if (
auto*
filter =
dynamic_cast<Filter*
>(node.get())) {
76 const Condition& condition =
filter->getCondition();
79 if (
rla->
getLevel(&condition) == search.getTupleId()) {
81 newCondition = addCondition(std::move(newCondition),
souffle::clone(&condition));
89 auto* tupleOp =
const_cast<TupleOperation*
>(&search);
91 if (newCondition !=
nullptr) {
94 tupleOp->rewrite(&tupleOp->getOperation(),
95 mk<Filter>(std::move(newCondition),
souffle::clone(&tupleOp->getOperation())));