ddlog icon indicating copy to clipboard operation
ddlog copied to clipboard

deadlock

Open zhangce opened this issue 9 years ago • 2 comments

Given a rule like

    A(x text).
    B(x text).
    C(x text).

    C(x) :- B(x).
    A(x) :- C(x).
    C(x) :- A(x).

I think the code currently deadlock. It is a separate discussion on whether we should allow recursion, but at least this should throw an error during compilation if we do not support it. @feiranwang

@netj : I don't think we need recursion right now, but I'd love to hear your opinion.

zhangce avatar Jul 09 '15 20:07 zhangce

I think recursive rules are unnecessary complexity for the moment. We could start thinking about it when there's a compelling use case. But until then, we should detect cycles in the rules from the SemanticChecker and reject compiling such programs.

netj avatar Jul 10 '15 01:07 netj

Will add check for this.

feiranwang avatar Jul 10 '15 06:07 feiranwang