Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to stratify relation(s) #2266

Closed
sdifv opened this issue Apr 25, 2022 · 5 comments
Closed

Error: Unable to stratify relation(s) #2266

sdifv opened this issue Apr 25, 2022 · 5 comments
Labels

Comments

@sdifv
Copy link

sdifv commented Apr 25, 2022

I'd like to simulate a process of routing prapogation:a node get the BestOspfRoute from (adj) fromNode, and then uses the aggregation function min to compute the BestOspfRoute , and then propagates it to adjs until it reaches the fixpoint.
The main program is written as follows:

OspfRoute(node, prefix, origin, nhip, cost):-
    OspfIntf(node, _, prefix, _),
    origin = node,
    nhip = 0,
    cost = 0.

OspfRoute(node, prefix, origin, nhip, cost1+cost2):-
    BestOspfRoute(nextNode, prefix, origin, preNhip, cost1),
    OspfAdj(node, intf, nextNode, nextIntf),
    Intf(nextNode, nextIntf, nhip, _),
    OspfIntf(node, intf, _, cost2),
    preNhip != nhip,
    node != origin.

BestOspfRoute(node, prefix, origin, nhip, minCost):-
    OspfRoute(node, prefix, origin, nhip, _),
    minCost = min cost: OspfRoute(node, prefix, _, _, cost).

When I ran this souffle` program, I got a error:

Error: Unable to stratify relation(s) {BestOspfRoute,OspfRoute}
Relation OspfRoute in file ospf.dl at line 7
.decl OspfRoute(node: symbol, prefix: symbol, origin: symbol, nhip: unsigned, cost: unsigned)
------^---------------------------------------------------------------------------------------
has cyclic aggregation in file ospf.dl at line 35
    minCost = min cost: OspfRoute(node, prefix, _, _, cost).
------------------------^------------------------------------
1 errors generated, evaluation aborted

It seems like that souffle` can't handle the iterative compute process? Is there any suggestions to solve this problem?
Thank you!

@b-scholz
Copy link
Member

You need recursive aggregates which are currently developed.
#2263

It may work in 2-3 weeks with the new extension.

@sdifv
Copy link
Author

sdifv commented Apr 26, 2022 via email

@asejfia
Copy link

asejfia commented Jun 30, 2022

Any update as to when will the recursive aggregates be merged into main?

@b-scholz
Copy link
Member

b-scholz commented Jul 3, 2022

There are unforeseen delays with the staffing. Would you like to help? The current prototype works for the compiler but not for the interpreter.

@asejfia
Copy link

asejfia commented Jul 6, 2022

I found a workaround for my specific case but I'd be happy to help if the issue persists until after late August. Will write again to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants