Open b-scholz opened 4 years ago
The issue is that predicate out()
appears wrongly in relation __agg_body_rel_0
. The domain for argument r
is extended using out
but out
is a recursive relation.
The part where it adds out(r, x) to the materialised aggregate body multiple times is a mistake that I need to fix. But other than that, I don't know a clear solution to this. There is nothing but out(r, ) to ground r in the scope of the aggregate.
The user can synthesise their own unary relation to ground r, like Boundary(r), otherwise I can see no way for this aggregate to be materialised and survive.
Like if we did
Boundary(r+1) :- Boundary(r), r < 30.
and then used Boundary to ground r instead of using out(r, _), this would be fine, but I can see that it's annoying.
Aggregates in recursive rules are incorrectly transformed:
is transformed to